public class MainWindowViewModel : INotifyPropertyChanged { private ObservableCollection<string> _Collections; public ObservableCollection<string> Collections { get { return _Collections; } set { if (_Collections != value) { _Collections = value; OnPropertyChanged("Collections"); }
} }
public MainWindowViewModel() { }
public void OnPropertyChanged(string name) { if (PropertyChanged != null) { PropertyChanged(this, new PropertyChangedEventArgs(name)); } } public event PropertyChangedEventHandler PropertyChanged; }