-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathMainViewModel.cs
31 lines (28 loc) · 932 Bytes
/
MainViewModel.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
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
namespace SwipeCards.Demo.Forms
{
public class MainViewModel : INotifyPropertyChanged
{
ObservableCollection<string> cards;
public ObservableCollection<string> Cards
{
get { return cards; }
set { cards = value; RaisePropertyChanged(); }
}
public MainViewModel()
{
cards = new ObservableCollection<string>
{
"Card No 1",
"Card No 2",
"Card No 3",
"Card No 4"
};
}
// Implementation of INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
void RaisePropertyChanged([CallerMemberName] string name = null) => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}