- 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.
- Mastering OpenLayers 3
- Android Jetpack開發:原理解析與應用實戰
- Debian 7:System Administration Best Practices
- 深入理解Django:框架內幕與實現原理
- 微服務設計原理與架構
- 新手學Visual C# 2008程序設計
- Java開發入行真功夫
- Java程序設計與計算思維
- Python王者歸來
- 21天學通C++(第6版)
- GeoServer Beginner's Guide(Second Edition)
- Creating Mobile Apps with jQuery Mobile(Second Edition)
- 基于SpringBoot實現:Java分布式中間件開發入門與實戰
- Instant Debian:Build a Web Server
- 后臺開發:核心技術與應用實踐