- Mastering Windows Presentation Foundation
- Sheridan Yuen
- 202字
- 2021-06-24 16:49:02
Data binding
One often overlooked aspect of the MVVM pattern is its requirement for data binding. We could not have the full Separation of Concerns without it, as there would be no easy way of communicating between the Views and View Models. The XAML markup, data binding classes, and ICommand and INotifyPropertyChanged interfaces are the main tools in WPF that provide this functionality.
The ICommand interface is how commanding is implemented in the .NET Framework. It provides behavior that implements and even extends the ever useful Command pattern, in which an object encapsulates everything needed to perform an action. Most of the UI controls in WPF have Command properties that we can use to connect them to the functionality that the commands provide.
The INotifyPropertyChanged interface is used to notify binding clients that property values have been changed. For example, if we had a User object and it had a Name property, then our User class would be responsible for raising the PropertyChanged event of the INotifyPropertyChanged interface, specifying the name of the property each time its value was changed. We'll look much deeper into all of this later, but now let's see how the arrangement of these components help us.
- Android Wearable Programming
- 玩轉Scratch少兒趣味編程
- Rust實戰
- HTML5游戲開發案例教程
- HDInsight Essentials(Second Edition)
- jQuery開發基礎教程
- Spring Boot企業級項目開發實戰
- Unity 5 for Android Essentials
- Android開發:從0到1 (清華開發者書庫)
- Python網絡爬蟲技術與應用
- Magento 2 Beginners Guide
- Python Deep Learning
- Mastering PowerCLI
- Effective C++:改善程序與設計的55個具體做法(第三版)中文版(雙色)
- 網絡綜合布線與組網實戰指南