WPF(MultiTrigger)

原文 http://blog.csdn.net/haifengzhilian/article/details/8822098

  1. <Window x:Class="TestResourcesTriggle.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. Title="MainWindow" Height="350" Width="525">
  5. <Window.Resources>
  6. <Style TargetType="CheckBox" >
  7. <Style.Triggers>
  8. <MultiTrigger >
  9. <MultiTrigger.Conditions>
  10. <Condition Property="IsChecked"
  11. Value="true" />
  12. <Condition Property="Content"
  13. Value="正如我悄悄的来" />
  14. </MultiTrigger.Conditions>
  15. <MultiTrigger.Setters >
  16. <Setter Property="FontSize" Value="20" />
  17. <Setter Property="Foreground" Value="Orange" />
  18. </MultiTrigger.Setters>
  19. </MultiTrigger>
  20. </Style.Triggers>
  21. </Style>
  22. </Window.Resources>
  23. <StackPanel >
  24. <CheckBox Content="悄悄的我走了" Margin="5" />
  25. <CheckBox Content="正如我悄悄的来" Margin="5,0" />
  26. <CheckBox Content="我挥一挥衣袖" Margin="5" />
  27. <CheckBox Content="不带走一片云彩" Margin="5,0" Width="496" />
  28. </StackPanel>
  29. </Window>
上一篇:C#操作SQLite数据库


下一篇:如何向Maven仓库(私服)中上传第三方jar包