mku*_*kus 27 mvvm inotifypropertychanged
在MVVM模式中,如何通知视图模型的所有属性都发生了变化?我不想调用所有属性的所有notifypropertychanged事件.
我有一个实体类,在视图模型中,我将实体的所有公共字段都写为公共属性.我想重新绑定新实体,只需编写一行代码来通知所有属性都已更改?
谢谢你的帮助.
Tho*_*que 50
只需PropertyChanged使用空字符串作为属性名称引发事件:
OnPropertyChanged(String.Empty);
Run Code Online (Sandbox Code Playgroud)