开发者

silverlight receive INotifyPropertyChanged in non UI class hook

开发者 https://www.devze.com 2023-01-15 23:30 出处:网络
I\'ve a class that raises INotifyPropertyChanged events. I\'m quite happy with databinding to UI controls, but I\'d like to get these events fired into a non-UI class, but am unsure of what to registe

I've a class that raises INotifyPropertyChanged events. I'm quite happy with databinding to UI controls, but I'd like to get these events fired into a non-UI class, but am unsure of what to register or hook into.

I know it should be simple, and it probably is, I'm just after a quick pointer down 开发者_StackOverflowthis road.

Many Thanks

Paul


I may be misunderstanding you, but can't you just use the public event in INotifyProperyChanged to do what you want to do?

MyClassInstance.PropertyChanged += (sender, e) =>
{
     if (e.PropertyName == "MyProperty")
     {
          // do something
     }
};
0

精彩评论

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