This repository has been archived by the owner on Jan 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MasterPageViewModel.cs
53 lines (48 loc) · 1.85 KB
/
MasterPageViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using MasterDemo.Views;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace MasterDemo
{
/// <summary>
/// Represents the <see cref="MasterPageViewModel"/>.
/// </summary>
public class MasterPageViewModel : INotifyPropertyChanged
{
/// <summary>
/// Initializes a new instance of the <see cref="MasterPageViewModel"/>.
/// </summary>
public MasterPageViewModel()
{
// defining the menu items.
MenuItems = new ObservableCollection<MenuItem>(new[]
{
new MenuItem { Title = "Home", TargetType = typeof(HomePage) },
new MenuItem { Title = "Profile", TargetType = typeof(ProfilePage) },
new MenuItem { Title = "Logout", TargetType = typeof(LogoutPage) },
new MenuItem { Title = "TabbedPage", TargetType = typeof(MainTabbedPage)}
});
}
/// <summary>
/// Gets or sets the menu items.
/// </summary>
/// <value>
/// An ObservableCollection of <see cref="MenuItem"/>.
/// </value>
public ObservableCollection<MenuItem> MenuItems { get; set; }
/// <summary>
/// The event for changed properties.
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
/// <summary>
/// Callback method for <see cref="PropertyChanged"/>.
/// </summary>
/// <param name="propertyName">The propertyname. Default is an empty string.</param>
void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
if (PropertyChanged == null)
return;
PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}