vb.net 和 winforms 中的 INotifyPropertyChanged 接口错误?

发布于 2025-01-11 14:12:24 字数 684 浏览 3 评论 0原文

我在 vb.net 中创建了一个小项目,其中包含一个类和 INotifypropertyChanged 接口。类中的属性绑定到主窗体中的文本框。

一切工作正常,但有一个大问题。如果我通过在文本框中输入新值来更改一个属性,则同一类中所有其他属性的 getter 都会触发。如果我手动输入值,那没有问题,但如果我有外部更改(例如计时器更新),则无法再输入。所有文本框中的光标都会闪烁,因为每次都会触发外部更改的属性。

我的意思是,为什么这是一个错误?我已经在 WPF 和 C# 中构建了相同的应用程序和函数。如果我更改一个属性,则只有该属性的 getter 会触发 - 而不是同一类中的所有其他属性。为了重现这个问题,我在 GitHub 上创建了一个小应用程序。

GitHub 存储库链接:链接

问题中的GIF记录

问题:双数文本框中无法输入值,因为光标闪烁,无法输入。

I've created a small project in vb.net with a class and the INotifypropertyChanged interface. The properties from the class bound to text boxes in the main form.

Everything is working fine, but there is one big problem. If I change one property by entering a new value in the text box, the getter of all other properties in the same class firing to. If I enter values manually, that's no issue, but if I have external changes - like timer updates - no entering is possible anymore. The cursor in all text boxes flickering, because the external changed property is fires every time.

Why, I mean, this is a bug? I've built the same application and functions in WPF and C#. And if I change a property, only the getter of this property firing - not all other in the same class. To reproduce this issue, I’ve created a small application on GitHub.

Link to the GitHub Repo: Link

GIF Record from the issue

The issue: It's not possible to enter a value in the Double Number text box, because the cursor is flickering and no enter is possible.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文