开发者

wpf binding 2 properties of 2 classes

开发者 https://www.devze.com 2023-01-20 06:23 出处:网络
I have a XAML-object (window-control) having his own-properties in the code-behind (in my case it has a property called \'FirstEditableDate\' without any UI-binding).

I have a XAML-object (window-control) having his own-properties in the code-behind (in my case it has a property called 'FirstEditableDate' without any UI-binding).

I also have another XAML-object (user-control) with a property (al开发者_StackOverflow中文版so without UI) and I want to bind the other property to this property.

So, if the property of the (main)class is changing, the other property of the usercontrol is also changing.

How can I do this?

(see for examples my 'answer' below...)


You can implement the INotifyPropertyChanged interface on the Main class and have the usercontrol handle the PropertyChange event.

0

精彩评论

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