public class ViewModel : INotifyPropertyChanged, IDisposable
{
public event PropertyChangedEventHandler PropertyChanged;
public virtual void Dispose()
{
}
protected virtual void RaisePropertyChanged(string propertyName)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
PropertyChangedEventArgs e = new PropertyChangedEventArgs(propertyName);
handler(this, e);
}
}
}
继承两个接口:INotifyPropertyChanged和IDisposable。用来激发更改的变量和释放资源。
ViewModel基类
最新推荐文章于 2023-06-19 12:55:29 发布