Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能确认或否认 Silverlight 的 NumericUpDown 支持 NotifyOnValidationError 和/或 ValidatesOnExceptions?
它有,也没有。
之所以这样做,是因为它派生于Control绑定验证机制与 UI 代码相遇的地方。它具有通常的视觉状态Valid,InvalidFocused并且InvalidUnfocused通过绑定设置来通知验证错误,控件的视觉状态将设置为这种适当的状态之一。
Control
Valid
InvalidFocused
InvalidUnfocused
这并不是因为工具包代码中包含的默认控件模板实际上没有任何 UI 来表示或显示验证。
因此,为了支持NotifyOnValidationError您将需要复制和编辑默认模板并添加一些 UI 进行验证。您可以通过查看 TextBox 的模板来了解所需的验证 UI。
NotifyOnValidationError