且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

未在 WinRT XAML 中设置自定义 VisualState

更新时间:2023-10-11 18:22:16

您不应使用来自不同组的两种状态来为同一属性设置动画.在这种情况下,这不起作用,因为您已经第二次处于 HasError 状态(您永远不会离开该状态).

You should not use two states from different groups to animate the same property. In this case, this is not working because you already are in the state HasError the second time (you never leave that state).

一个解决方案是向您的CustomStates"组添加一个名为NoError"的额外状态.

A solution is to add an extra state to your "CustomStates" group called "NoError".

添加视觉元素(例如只有您的状态才会动画的附加矩形或边框).然后,您必须从 OnGoFocus 覆盖中触发 NoError 状态.

Add visual element (such as an additional rectangle or border that only your state will animate). Then you'll have to trigger the NoError state from OnGoFocus override.