2012-06-23 21 views
0

的WinRT控件模板在Win8中,我有以下模板,基本上改變了按鈕的基於其按下狀態的邊框的顏色:變化RC

<ControlTemplate x:Name="SkillIconTemplate" TargetType="Button"> 
     <Border CornerRadius="10" BorderThickness="2" Margin="5" Background="{TemplateBinding Background}"> 
      <VisualStateManager.VisualStateGroups> 
       <VisualStateGroup x:Name="CommonStates"> 
        <VisualStateGroup.Transitions> 
         <VisualTransition To="MouseOver" GeneratedDuration="0:0:0.05"/> 
         <VisualTransition To="Pressed" GeneratedDuration="0:0:0.05"/> 
        </VisualStateGroup.Transitions> 
        <VisualState x:Name="Normal" /> 
        <VisualState x:Name="MouseOver"> 
         <Storyboard> 
          <ColorAnimation Storyboard.TargetName="BorderBrush" 
                Storyboard.TargetProperty="Color" 
                To="Yellow" /> 
         </Storyboard> 
        </VisualState> 
        <VisualState x:Name="Pressed"> 
         <Storyboard> 
          <ColorAnimation Storyboard.TargetName="BorderBrush" 
                Storyboard.TargetProperty="Color" 
                To="Black"/> 
         </Storyboard> 
        </VisualState> 
       </VisualStateGroup> 
      </VisualStateManager.VisualStateGroups> 
      <Border.BorderBrush> 
       <SolidColorBrush x:Name="BorderBrush" Color="White"/> 
      </Border.BorderBrush> 
     </Border> 
    </ControlTemplate> 

現在,它似乎並沒有在Win8的工作RC。在消費者預覽它做了以下內容:

Normal State: White 
Hovered State: Yellow 
Pressed State: Black 

現在它的作用:

Normal State: White 
Hovered State (Before Pressed): White 
Hovered State (After Pressed): Black 
Pressed State: Black 

任何想法,爲什麼?

回答