2

我试图理解为什么像下面这样使用 VisualGroup:

<VisualStateManager.VisualStateGroups>
    <VisualStateGroup x:Name="CommonStates">
        <VisualState x:Name="Normal" />

当改变视觉状态时,通常独立于 VisualGroup 参数

例如。

VisualStateManager.GoToState(MyButton, "Normal", true);
4

1 回答 1

3

VisualStateVisualStateGroup中的 s是互斥的。您可能一次处于多个状态,只要它们位于不同的组中。

从 MSDN 文档:

For example, the CheckBox has two VisualStateGroup objects. One contains the 
states, Normal, MouseOver, Pressed, and Disabled. The other contains the states, 
Checked, UnChecked, and Indeterminate. The CheckBox can be in states MouseOver 
and UnChecked at the same time, but it cannot be in the MouseOver and Pressed 
states at the same time.
于 2013-07-14T05:49:48.747 回答