自定义 WPF 控件不会在焦点丢失时更新

发布于 2024-11-09 01:51:18 字数 273 浏览 7 评论 0原文

我实现了 Infragistics XamDateTimeEditor 的改编,它不会强迫我使用编辑蒙版。当我通过键盘输入日期时,值会正确更新,但是当我从下拉的 MonthCalendar 中选择日期时,新日期会显示在控件中,但值不会在绑定到控件的 ViewModel 中更新。

有谁知道要寻找什么来纠正这个问题?

任何帮助表示赞赏。

I implemented an adapation of Infragistics XamDateTimeEditor which does not force me to use an Edit Mask. When I enter a date by keyboard the Value is updated correctly, however when I select a date from the drop down MonthCalendar, the new date is displayed in the control, but the value is not updated in the ViewModel that binds to the control.

Does anyone know what to look for to correct this?

Any help is appreciated.

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

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

发布评论

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

评论(1

別甾虛僞 2024-11-16 01:51:18

确保您的 Binding 的 UpdateSourceTrigger 设置正确。 (失去焦点或属性更改)
为了确保您的绑定正常工作,您可以查看这篇文章

Make sure the UpdateSourceTrigger for your Binding is set correctly. (LostFocus or PropertyChanged)
To make sure your Binding is working correct, you can take a look at this article

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