是否有通报机制,当一个依赖属性发生了变化呢? [英] Is there a notification mechanism for when a dependency property has changed?

查看:203
本文介绍了是否有通报机制,当一个依赖属性发生了变化呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Silverlight应用程序我试图找出当一个用户控件的属性发生了变化。我感兴趣的是一个特定的DependencyProperty,但不幸的是,控制本身不实现INotifyPropertyChanged。

In a Silverlight application I'm trying to find out when a property on a usercontrol has changed. I'm interested in one particular DependencyProperty, but unfortunately the control itself doesn't implement INotifyPropertyChanged.

有确定的值发生变化的任何其他方式?

Is there any other way of determining if the value has changed?

推荐答案

在WPF中你有<一个href="http://msdn.microsoft.com/en-us/library/system.componentmodel.dependencypropertydescriptor.addvaluechanged.aspx"相对=nofollow> DependencyPropertyDescriptor.AddValueChanged ,但不幸的是在Silverlight中有没有这样的事情。因此,答案是否定的。

In WPF you have DependencyPropertyDescriptor.AddValueChanged, but unfortunately in Silverlight there's no such thing. So the answer is no.

也许如果您解释一下什么是你想怎么办就可以解决办法的情况下,或使用绑定。

Maybe if you explain what are you trying to do you can workaround the situation, or use bindings.

这篇关于是否有通报机制,当一个依赖属性发生了变化呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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