-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathViewModel.cs
More file actions
32 lines (27 loc) · 837 Bytes
/
ViewModel.cs
File metadata and controls
32 lines (27 loc) · 837 Bytes
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
using System.ComponentModel;
namespace TileWithContextmenu
{
public class ViewModel : INotifyPropertyChanged
{
// Let's have a static Instance which we can access from anywhere
static ViewModel _Instance;
public static ViewModel Instance
{
get
{
return _Instance ??= new ViewModel();
}
}
public event PropertyChangedEventHandler PropertyChanged;
public void OnPropertyChanged(string Name)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(Name));
}
private int _CurrentIndex = 0;
public int CurrentIndex
{
get { return _CurrentIndex; }
set { _CurrentIndex = value; OnPropertyChanged(nameof(CurrentIndex)); }
}
}
}