gpt4 book ai didi

xaml - 为什么要使用 VisualGroup?

转载 作者:行者123 更新时间:2023-12-04 04:49:30 24 4
gpt4 key购买 nike

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

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

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

例如。
VisualStateManager.GoToState(MyButton, "Normal", true);

最佳答案

VisualState s 在 VisualStateGroup 内是互斥的。您可能一次处于多个状态,只要它们在不同的组中即可。

从 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.

关于xaml - 为什么要使用 VisualGroup?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17636868/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com