using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Windows;
using System.Windows.Input;
using System.Collections.ObjectModel;
namespace BindingXaml {
public class MainViewModel : INotifyPropertyChanged {
public MainViewModel() {
// バインド用のコレクションのインスタンスを設定
this.Items = new ObservableCollection<ItemViewModel>();
}
// *****************************************************// バインド用のコレクションのプロパティ// *****************************************************
public ObservableCollection<ItemViewModel> Items { get; private set; }
// *****************************************************// データが変更された事を通知する為の実装// *****************************************************
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(String propertyName) {
PropertyChangedEventHandler handler = PropertyChanged;
if (null != handler) {
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}