コメント |
[[ListMain.cs]]
@DIV
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace LBOX_ListBox
{
public class ListMain : INotifyPropertyChanged
{
// *****************************************************
// コンストラクタ
// *****************************************************
public ListMain()
{
// バインド用のコレクションのインスタンスを設定
this.Items = new ObservableCollection<ListItem2>();
}
// *****************************************************
// バインド用のコレクションのプロパティ
// ※ ListItem クラスを使用しています
// *****************************************************
public ObservableCollection<ListItem2> Items { get; private set; }
// **********************************************
// ソースが変更されたことをバインド エンジンに通知する
// ※ 初回のロードのみならば特に使用しない
// **********************************************
public event PropertyChangedEventHandler PropertyChanged;
public void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this,
new PropertyChangedEventArgs(propertyName));
}
}
}
}
@END
|