原文 http://blog.csdn.net/haifengzhilian/article/details/8822098
- <Window x:Class="TestResourcesTriggle.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- Title="MainWindow" Height="350" Width="525">
- <Window.Resources>
- <Style TargetType="CheckBox" >
- <Style.Triggers>
- <MultiTrigger >
- <MultiTrigger.Conditions>
- <Condition Property="IsChecked"
- Value="true" />
- <Condition Property="Content"
- Value="正如我悄悄的来" />
- </MultiTrigger.Conditions>
- <MultiTrigger.Setters >
- <Setter Property="FontSize" Value="20" />
- <Setter Property="Foreground" Value="Orange" />
- </MultiTrigger.Setters>
- </MultiTrigger>
- </Style.Triggers>
- </Style>
- </Window.Resources>
- <StackPanel >
- <CheckBox Content="悄悄的我走了" Margin="5" />
- <CheckBox Content="正如我悄悄的来" Margin="5,0" />
- <CheckBox Content="我挥一挥衣袖" Margin="5" />
- <CheckBox Content="不带走一片云彩" Margin="5,0" Width="496" />
- </StackPanel>
- </Window>