MVVM绑定中的枚举类型未触发Propertychange事件 [英] Propertychange event not triggered for enum type in MVVM binding

查看:62
本文介绍了MVVM绑定中的枚举类型未触发Propertychange事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用两个名为"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.

此致

推荐答案

由于您的示例似乎来自同步融合,而且大多数人没有,我看不到很多人下载该示例.

Since your example seems to be from syncfusion and most people do not have that I cannot see many people downloading the example.

您应该显示一些代码.


这篇关于MVVM绑定中的枚举类型未触发Propertychange事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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