48 lines
1.1 KiB
C#
48 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Windows.Data;
|
|
|
|
namespace RawDataViewer
|
|
{
|
|
|
|
public class MainWindowViewModel : INotifyPropertyChanged
|
|
{
|
|
private CollectionView slots;
|
|
public CollectionView Slots
|
|
{
|
|
get { return slots; }
|
|
}
|
|
|
|
private int slotSelected;
|
|
|
|
|
|
public int SlotSelected
|
|
{
|
|
get { return slotSelected; }
|
|
set
|
|
{
|
|
if (slotSelected == value) return;
|
|
slotSelected = value;
|
|
OnPropertyChanged("SlotSelected");
|
|
}
|
|
}
|
|
|
|
public MainWindowViewModel()
|
|
{
|
|
IList<int> list = new List<int>();
|
|
list.Add(1);
|
|
list.Add(2);
|
|
slots = new CollectionView(list);
|
|
}
|
|
|
|
private void OnPropertyChanged(string propertyName)
|
|
{
|
|
if (PropertyChanged != null)
|
|
{
|
|
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
public event PropertyChangedEventHandler PropertyChanged;
|
|
}
|
|
|
|
} |