-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainViewModel.cs
50 lines (39 loc) · 1.02 KB
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Generic;
using XBindConverterSimulation.ComponentModel;
namespace XBindConverterSimulation
{
public class MainViewModel : NotifyPropertyChangedBase
{
#region Fields
private string[] _itemsSource = new string[]
{
"Test 1",
"Test 2",
"Test 3",
null
};
private string _selectedItem;
#endregion
#region Properties
public string SelectedItem
{
get => _selectedItem;
set
{
if (_selectedItem != value)
{
_selectedItem = value;
OnPropertyChanged();
}
}
}
public IEnumerable<string> ItemsSource => _itemsSource;
#endregion
#region Constructor
public MainViewModel()
{
_selectedItem = _itemsSource[0];
}
#endregion
}
}