How do I get a WPF element to respond to changes in a VB Module?
Objects whose Propert开发者_JAVA百科ies are observed for changes must implement the System.ComponentModel.INotifyPropertyChanged event to alert their WPF-element observers that a change has occurred.
If I have a Visual Basic Module whose Properties I wish to have observed by a WPF element, how should I go about routing the Properties of that Module through to the WPF, considering that Modules cannot, themselves, implement Interfaces?
EDIT: Modules are Static classes, for you C# readers, IIRC.
Define an event called [Property]Changed in your module, where [Property] is the name of the property that is changing. WPF will respond to these, as well as to the PropertyChanged events raised by INotifyPropertyChanged objects.
精彩评论