问题描述
我用两个名为"Width"的按钮创建了简单的MVVM示例. (枚举绑定)和"150" (整数绑定)在WPF中. "150"正确触发了ZoomMode.cs类中的ZoomPropertyChanged按钮.但是ZoomModePropertyChanged 当宽度"为0时,不会触发ZoomMode.cs类中的按钮被点击.
I have created simple MVVM sample with two buttons named "Width" (enumeration binding) and "150" (integer binding) in WPF. The "150" button is properly triggered the ZoomPropertyChanged in ZoomMode.cs class. But the ZoomModePropertyChanged in ZoomMode.cs class is not triggered when the "Width" button is clicked.
重现此问题的步骤:
1.下载示例
https://expirebox.com/download/37fc1d7a1e1fb061e7a5369672f5b747.html
https://expirebox.com/download/37fc1d7a1e1fb061e7a5369672f5b747.html
2.将断点放在ZoomMode.cs类文件中的ZoomModePropertyChanged和ZoomPropertyChanged事件处理程序中.
2.Place the break point in ZoomModePropertyChanged and ZoomPropertyChanged event handler in ZoomMode.cs class file.
3.运行示例,然后单击按钮"150"(触发ZoomPropertyChanged)
3.Run the sample and click the button "150"(ZoomPropertyChanged is triggered)
4.现在单击宽度"按钮(不会触发ZoomModePropertyChanged)
4.Now click the button "Width"(ZoomModePropertyChanged is not triggered)
为什么没有触发ZoomModePropertyChanged?
Why ZoomModePropertyChanged is not triggered?
请让我知道我是否做错了任何事情.
Kindly let me know if im doing any thing wrong.
此致
推荐答案
您应该显示一些代码.
这篇关于MVVM绑定中的枚举类型未触发Propertychange事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!