Skip to content

Instantly share code, notes, and snippets.

@Krumelur
Created June 28, 2017 08:36
Show Gist options
  • Save Krumelur/fc02b88668dd1a13a90af78a710034f3 to your computer and use it in GitHub Desktop.
Save Krumelur/fc02b88668dd1a13a90af78a710034f3 to your computer and use it in GitHub Desktop.
Style setters
<Style x:Key="infoLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="Green" />
</Style>
<Style x:Key="testStyle" TargetType="Label">
<Setter Property="TextColor" Value="Red" />
</Style>
<Label x:Name="totalOutput" Text="0.00" Style="{StaticResource infoLabelStyle}" Grid.Row="2" Grid.Column="1">
<Label.Triggers>
<DataTrigger TargetType="Label"
Binding="{Binding Source={x:Reference sw}, Path=IsToggled}" Value="true">
<Setter Property="Style" Value="{StaticResource testStyle}" />
</DataTrigger>
</Label.Triggers>
</Label>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment