开发者

Can only Framework Elements subscribe to property change notifications?

开发者 https://www.devze.com 2023-02-11 17:38 出处:网络
I have been looking at both INotifyPropertyChanged and creating custom Dependency Properties.What I wanted to be able to do is have, for example, the colors of fixed ink strokes on an ink presenter or

I have been looking at both INotifyPropertyChanged and creating custom Dependency Properties. What I wanted to be able to do is have, for example, the colors of fixed ink strokes on an ink presenter or variables in code subscribe to a color property in a class that's been fitted out approp开发者_JS百科riately and then update themselves whenever the color property of the class changes. I'm beginning to think that it is not possible to do this - thoughts or solutions please anyone?


Of course they can, normally you'd use bindings for that (there's a good few ways to bind up objects). In your scenario binding source is you color settings and the binding target is you presenter's FrameworkElement. Could you concretise what types of objects do you have on both sides, as in POCO source - FrameworkElement target or something else.

0

精彩评论

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