I have some style coding for a custom maximize Button and i'm getting some issues.
<Style TargetType="Button">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}" BorderThickness="0">
<ContentPresenter Margin="10,7,10,7" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Background" Value="#01000000"/>
<Setter Property="Foreground" Value="#FFFFFFFF"/>
<Setter Property="Margin" Value="0"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#50FFFFFF"/>
</Trigger>
<!--This trigger fails-->
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType=acrylic:AcrylicWindow}}" Value="Maximized">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Path Height="10" Width="10" Data="M2,0 L8,0 L8,6 M0,3 L6,3 M0,2 L6,2 L6,8 L0,8 Z"
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type Button}}}"
StrokeThickness="1"
SnapsToDevicePixels="True"/>
</Grid>
</Setter.Value>
</Setter>
</DataTrigger>
<!--It Works Correctly-->
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource FindAncestor, AncestorType=acrylic:AcrylicWindow}}" Value="Normal">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Path Width="10" Height="10" Data="F1M0,0L0,9 9,9 9,0 0,0 0,3 8,3 8,8 1,8 1,3z"
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
SnapsToDevicePixels="True"/>
</Grid>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
When the Window is maximized the Button content disappears, it doesn't show the path, it's empty (but clickable and the fade in InMouseOver works). When the Window is in normal state the button content is correct.
I was trying to change the path data but i didn't see any change.