Checking the value of the window's "WindowState" in a Trigger
Or if you want a control other than the window to respond to the WindowState property you can use a DataTrigger instead:
<DataTrigger Binding="{Binding WindowState, RelativeSource={RelativeSource AncestorType=Window}}"
Value="Normal">
<Setter Property="Fill" Value="Green"/>
</DataTrigger>
Works like this:
<Window.Style>
<Style TargetType="Window">
<Style.Triggers>
<Trigger Property="WindowState" Value="Minimized">
<Setter Property="ShowInTaskbar" Value="False" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Style>
Edit: You need to place your trigger in the Window.Style
.