开发者

How do I get a WPF element to respond to changes in a VB Module?

开发者 https://www.devze.com 2023-01-19 10:10 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号