WPF:属性更改时通知多个自定义控件

发布于 2024-10-09 08:12:33 字数 108 浏览 0 评论 0原文

我们有一个特定的情况,即具有各种类型的自定义控件,当属性更改时它们必须做出不同的反应。

在 WPF 中处理此问题的最佳方法是什么?如果您有快速教程,我们将不胜感激。

谢谢

We have a specific case of having various type of custom controls that must react differently when a property change.

What would be the best way to handle this in WPF and if you have a quick tutorial, it would be appreciated.

Thx

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风流物 2024-10-16 08:12:33

INotifyPropertyChanged 有什么问题?每个控件都可以订阅 PropertyChanged 事件并以自己特定的方式对其做出反应

What's wrong with INotifyPropertyChanged ? Each control can subscribe to the PropertyChanged event and react to it in its own specific way

谁人与我共长歌 2024-10-16 08:12:33

是的,在要将所有不同 UI 组件绑定到的对象上使用 INotifiyPropertyChanged 接口。这是msdn的示例:

http://msdn.microsoft.com/en-us/ Library/ms743695.aspx

尽情享受吧!

Yeah, use the INotifiyPropertyChanged interface on the object you are binding all of the different UI components to. here is msdn's example:

http://msdn.microsoft.com/en-us/library/ms743695.aspx

Enjoy!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文