observable property
1 |
private string _firstName; |
In order to solve this, MVVM Light proposes a few solutions:
- The logic needed to raise the PropertyChanged event can be stored in a ViewModelBase class that every ViewModel inherits from.
- Properties can be identified by a lambda expression instead of a string. This prevents typos or errors when the name of the property changes.
- The remaining lines can be automated using a code snippet in Visual Studio.
MVVM in WPF
WPF MVVM step by step (Basics to Advance Level)
对应的中文翻译
https://www.oschina.net/translate/wpf-mvvm-step-by-step-basics-to-advance-level?lang=chs&page=2#
近期评论