Win 8 Metroコントロール用のカスタムControlTemplate(XAML)を作成する場合、VisualStateManagerを使用してVisualState遷移に従ってコントロールを更新する必要があります。以下のサンプルはMSDN全体で見られますが、VisualStateGroupの「CommonStates」が文書化されている場所と、「PointerOver」と「Normal」以外に定義されている他のVisualStateが見つかりません。ボタンのデフォルトのControlTemplateを見つけるために、SDKを掘り下げる必要がありますか?もしそうなら、どこ?
<ControlTemplate TargetType="Button">
<Grid >
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<!--Take one half second to transition to the PointerOver state.-->
<VisualTransition To="PointerOver"
GeneratedDuration="0:0:0.5"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal" />
<!--Change the SolidColorBrush, ButtonBrush, to red when the
Pointer is over the button.-->
<VisualState x:Name="PointerOver">
<Storyboard>
<ColorAnimation Storyboard.TargetName="ButtonBrush"
Storyboard.TargetProperty="Color" To="Red" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid.Background>
<SolidColorBrush x:Name="ButtonBrush" Color="Green"/>
</Grid.Background>
</Grid>
</ControlTemplate>