开发者

Dependency property based on POCO property that already notifies

开发者 https://www.devze.com 2023-03-29 05:25 出处:网络
I have a dependency property exposed in my control that takes its value from another object that already implements INotifyPropertyChanged.

I have a dependency property exposed in my control that takes its value from another object that already implements INotifyPropertyChanged.

Is there any way to tell WPF to subscribe directly to this object, or do I have to pl开发者_运维问答umb the change notifications myself?

Cheers


I'm may be unclear on your question, but you could do:

control.SetBinding(YourDependencyProperty, new Binding("YourProperty") { Source = poco });

You can also set Mode to TwoWay to pass values back to the POCO.

0

精彩评论

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