1
我已經創建了WPF MVVM應用程序,並將WPFToolkit DataGrid綁定到DataTable,所以我想知道如何實現DataTable屬性以通知已更改。目前我的代碼如下所示。如何使用INotifyPropertyChanged實現DataTable屬性
public DataTable Test
{
get { return this.testTable; }
set
{
...
...
base.OnPropertyChanged("Test");
}
}
public void X()
{
this.Test.Add(...); // I suppose this line will call to getter first (this.Test = get Test) and then it will call add letter, this mean that setter scope will never fire.
base.OnPropertyChanged("Test"); // my solution is here :) but I hope it has better ways.
}
它是否有另一種解決此問題的方法?