Hi,
Somebody can tell me why this trigger doesn't work:
<!--Style-->
<Style x:Key="Test" TargetType="{x:Type Expander}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="IsExpanded" Value="false"></Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- Syle applyed in expander -->
<Expander Header="Expander" Margin="40,89,118,0" Name="expander1" Height="23" VerticalAlignment="Top" >
<Grid>
<Ellipse Height="100" Margin="86,0,-8,-58" Name="ellipse1" Stroke="Black" VerticalAlignment="Bottom" />
</Grid>
</Expander>
<!-- Code Behind -->
private void button1_Click(object sender, RoutedEventArgs e)
{
this.expander1.IsEnabled = false;
}
I try in other ways, but without success.. Have another way to collapse content when expander is disabled.