消耗时更改扩展器标题文本

时间:2012-10-01 03:29:08

标签: c# wpf xaml

我有一个扩展器,标头以-90度旋转:

<Expander Name="exProduct" Grid.Column="1" ExpandDirection="Left" 
          HorizontalAlignment="Right" VerticalAlignment="Stretch">
    <Expander.Header>
        <TextBlock Text="Add Product" FontSize="18"        
            <TextBlock.LayoutTransform>                
                <RotateTransform Angle="-90"/>             
            </TextBlock.LayoutTransform>
        </TextBlock>
    </Expander.Header>

我如何使用这样的东西,并且标题以-90度旋转:

<Window.Resources>
<Style x:Key="ExpanderEx" TargetType="Expander">
<Setter Property="Header" Value="Show"/>
<Style.Triggers>
<Trigger Property="IsExpanded" Value="True">
<Setter Property="Header" Value="Hide"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources> 

<Expander Style="{StaticResource ExpanderEx}" >

<StackPanel>
    <Button Width="100" Height="50"/>
</StackPanel>
</Expander>

0 个答案:

没有答案