WPF TwoWay数据绑定-源通知 [英] WPF TwoWay Databinding - Source notification

查看:151
本文介绍了WPF TwoWay数据绑定-源通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个实现INotifyPropertyChanged的普通类,以便将绑定中的更改通知我的绑定GUI元素.它有效并且很棒.但是,对目标中的更改采取行动的最佳方法是什么-当我的类属性更改时,我想将更改后的值发送给Web服务.属性现在会更改,但我想知道何时.我应该只使用GUI元素的事件(onclick,onchange等...)吗?我是否缺少TwoWay绑定的某些功能?

Hi

I've got a normal class that implements INotifyPropertyChanged in order to notify my binded GUI elements about changes in the source. It works and is great. But what's the best way to act on changes in the target - when my class properties change I want to send the changed values off to a web service. The properties DO change now but I want to know WHEN. Should I just use the GUI element's events (onclick, onchange etc...)?? Am I missing some feature of the TwoWay binding??

推荐答案

您好,

只是触发您的Set过程中的发送类的属性?由于您的类是普通的CLR对象,因此绑定将调用其更改的每个属性的Set过程.
Hi,

what about just triggering the send in the Set procedure of your classes properties? Since your class is a normal CLR object, the Binding will call the Set procedure of every property it changes.


这篇关于WPF TwoWay数据绑定-源通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆