![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN9uu6ihdAayGRJfjEb0jWcwYF82jn4sRBIz-f6N8Id7d8z0xCj2L4_OSi2AOFZu8umWhPO2jDGObiR-vVnsiNJROBsEjFf3mh2iKBndfgV290sxZR00bJD3EcMs38y23zXYY/s400/databindinginwpf.png)
In the illustration I'm trying to show two connected textboxes. When typing the name of a font in the first TextBox, the font of the second should change accordingly.
This event driven synchronization is dependent on the fact that your object inherits DependencyObject and that your properties use DependencyProperties. If you want your UI to be data bound to something that is not a UI component, you can implement the INotifyPropertyChanged interface and fire the PropertyChanged event when your object changes.
The way to publish data to the UI could be to bind all the fields in the UI in relation to a parent container (the windows or something) and then set DataContext to the data object. This way your UI is filled with data very smoothly.
No comments:
Post a Comment