2010-02-05 62 views
0

這裏的風格擴展按鈕是我的XAML:的TreeView

  <Style x:Key="ExpanderStyle" TargetType="{x:Type ToggleButton}"> 
      <Setter Property="IsEnabled" Value="True" /> 
      <Setter Property="Template"> 
       <Setter.Value> 
        <ControlTemplate> 
         <Image Source="/Images/SHCalendarLeftArrow.tiff" /> 
        </ControlTemplate> 
       </Setter.Value> 
      </Setter> 
     </Style> 

所以,我想是這樣,如果該項目被擴大,然後顯示不同的圖像。

回答

0

沒關係。我用扳機

<Trigger Property="ToggleButton.IsChecked" Value="False"> 
          <Setter x:Name="Expander_Expanded" 
            TargetName="Expander_Normal" Property="Source" 
            Value="/Images/SHCalendarLeftArrow.tiff" /> 
         </Trigger>