如何订阅改变DependencyProperty?
可能的重复:
监听依赖属性的更改
请原谅我的英语。
我需要创建一个可以订阅更改 DependencyProperty 的类,并根据该属性的新值来执行某些操作。
就像这样:
MyClass obj = new MyClass();
obj.Subscribe(TextBox.TextProperty, myTextBox);
我该怎么做?
Possible Duplicate:
Listen to changes of dependency property
Excuse me for my English.
I need to create a class that could subscribe to change DependencyProperty, and depending on the new value of this property to perform some action.
Like this:
MyClass obj = new MyClass();
obj.Subscribe(TextBox.TextProperty, myTextBox);
How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一种方法,使用方便的 DependencyPropertyDescriptor 类。
Here is one way of doing it, using the handy DependencyPropertyDescriptor class.