Breaker.xaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. <UserControl x:Class="NEIntelligentControl2.Views.BoostStation.Breaker"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:NEIntelligentControl2.Views.BoostStation"
  7. mc:Ignorable="d"
  8. Width="15" Height="27" Background="#02000000" Loaded="UserControl_Loaded">
  9. <Rectangle Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Width}" Height="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Height}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown">
  10. <Rectangle.Style>
  11. <Style TargetType="Rectangle">
  12. <Style.Triggers>
  13. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=IsSelected}" Value="True">
  14. <Setter Property="Effect">
  15. <Setter.Value>
  16. <DropShadowEffect ShadowDepth="0" BlurRadius="9" Color="WhiteSmoke"/>
  17. </Setter.Value>
  18. </Setter>
  19. </DataTrigger>
  20. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Value}" Value="-1">
  21. <Setter Property="Fill" Value="DarkGray"/>
  22. </DataTrigger>
  23. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Value}" Value="1">
  24. <Setter Property="Fill" Value="#FFFF0005"/>
  25. </DataTrigger>
  26. <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}, Mode=FindAncestor}, Path=Value}" Value="0">
  27. <Setter Property="Fill" Value="#FF419B48"/>
  28. </DataTrigger>
  29. </Style.Triggers>
  30. </Style>
  31. </Rectangle.Style>
  32. </Rectangle>
  33. </UserControl>