我想在ZoomOutView
活动时停用某些按钮。根据MSDN,VisualStateGroup 的名称是“SemanticZoomStates”,而 VisualState 的名称是“ZoomOutView”。所以我尝试了以下方法:
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SemanticZoomStates">
<VisualState x:Name="ZoomInView" />
<VisualState x:Name="ZoomOutView">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="editDocButton" Storyboard.TargetProperty="IsEnabled">
<DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="deleteDocButton" Storyboard.TargetProperty="IsEnabled">
<DiscreteObjectKeyFrame KeyTime="0" Value="False"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
当我将ObjectAnimationUsingKeyFrames
-elements 放入让我们说“Snapped”VisualState(和适当的 VisualStateGroup)时,它可以工作,所以按钮名称应该没有问题。