i´m using Mahapps.Metro and want to change an icon depending on an Property.
Here is the Mahapps sample for their Icons
Setting only the Backgroundcolor("Fill") of the rectangle everything works fine. As soon as the OpacityMask is set the complete rectangle stays blank.
<Rectangle Width="20" Height="20">
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsOnline}" Value="True">
<Setter Property="Fill" Value="Green" />
<Setter Property="OpacityMask">
<Setter.Value>
<VisualBrush Stretch="Fill" Visual="{StaticResource appbar_disconnect}" />
</Setter.Value>
</Setter>
</DataTrigger>
<DataTrigger Binding="{Binding Path=IsOnline}" Value="False">
<Setter Property="Fill" Value="Red" />
<Setter Property="OpacityMask">
<Setter.Value>
<VisualBrush Stretch="Fill" Visual="{StaticResource appbar_connect}" />
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
Any ideas what i do wrong?