INotifyPropertyChanged
using System;
using System.ComponentModel;
namespace DGRowDetails
{
public class Task : System.ComponentModel.INotifyPropertyChanged
{
// The Task class implements INotifyPropertyChanged so that
// the datagrid row will be notified of changes to the data
// that are made in the row details section.
// Private task data.
private string m_Name;
private DateTime m_DueDate;
private bool m_Complete;
private string m_Notes;
// Define the public properties.
public string Name
{
get { return this.m_Name; }
set
{
if (value != this.m_Name)
{
this.m_Name = value;
NotifyPropertyChanged("Name");
}
}
}
public DateTime DueDate
{
get { return this.m_DueDate; }
set
{
if (value != this.m_DueDate)
{
this.m_DueDate = value;
NotifyPropertyChanged("DueDate");
}
}
}
public bool Complete
{
get { return this.m_Complete; }
set
{
if (value != this.m_Complete)
{
this.m_Complete = value;
NotifyPropertyChanged("Complete");
}
}
}
public string Notes
{
get { return this.m_Notes; }
set
{
if (value != this.m_Notes)
{
this.m_Notes = value;
NotifyPropertyChanged("Notes");
}
}
}
// Implement INotifyPropertyChanged interface.
public event PropertyChangedEventHandler PropertyChanged;
private void NotifyPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}
'WPF' 카테고리의 다른 글
[WPF]초간단 윈도우즈 창 Drag(드래그) 하기 (0) | 2010.04.14 |
---|---|
[MSDN]BindingSource와 INotifyPropertyChanged 인터페이스를 사용하여 변경 내용 알림 발생 (0) | 2010.04.07 |
실버라이트로 windows mobile 7 프로그램 개발 (0) | 2010.03.17 |
태그삭제 Convert (0) | 2010.01.02 |
ObservableCollection<(Of <(T>)>) Class (0) | 2010.01.02 |
Using Value Converters (0) | 2010.01.02 |
DataGrid 템플릿 (0) | 2010.01.02 |
간단한 data grid 사용법 (0) | 2010.01.02 |
쿠키사용법 (0) | 2009.12.15 |
웹 페이지에 Silverlight 추가 (0) | 2009.12.15 |