终端一体化运控平台
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
2 роки тому
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <!--#region 编辑开关 ToggleButton 样式-->
  3. <Style x:Key="EditToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  4. <Setter Property="Template">
  5. <Setter.Value>
  6. <ControlTemplate TargetType="{x:Type ToggleButton}">
  7. <Grid>
  8. <Border
  9. x:Name="border2"
  10. Width="{TemplateBinding Width}"
  11. Height="{TemplateBinding Height}"
  12. Margin="{TemplateBinding Padding}"
  13. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  14. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  15. Background="Transparent">
  16. <ContentPresenter
  17. Margin="{TemplateBinding Padding}"
  18. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  19. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  20. RecognizesAccessKey="True"
  21. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  22. </Border>
  23. </Grid>
  24. <ControlTemplate.Triggers>
  25. <!--<Trigger Property="IsPressed" Value="true">
  26. <Setter Property="Background" Value="#FFd2e7f4" />
  27. </Trigger>-->
  28. <!-- 控件选中 -->
  29. <Trigger Property="IsChecked" Value="true">
  30. <Setter Property="Foreground" Value="#ff1002E9" />
  31. </Trigger>
  32. <!-- 控件未选中 -->
  33. <Trigger Property="IsChecked" Value="false">
  34. <Setter Property="Foreground" Value="#ff2AB2E7" />
  35. </Trigger>
  36. <!-- 鼠标进入 -->
  37. <Trigger Property="IsMouseOver" Value="True">
  38. <Setter TargetName="border2" Property="Background" Value="#332AB2E7" />
  39. </Trigger>
  40. <!-- 控件禁用 -->
  41. <Trigger Property="IsEnabled" Value="false">
  42. <Setter Property="Foreground" Value="#662AB2E7" />
  43. </Trigger>
  44. <!-- 控件启用 -->
  45. <Trigger Property="IsEnabled" Value="True">
  46. <Setter Property="Foreground" Value="#ff2AB2E7" />
  47. </Trigger>
  48. </ControlTemplate.Triggers>
  49. </ControlTemplate>
  50. </Setter.Value>
  51. </Setter>
  52. </Style>
  53. <!--#endregion-->
  54. <!--#region 切换开关 ToggleButton 样式-->
  55. <Style x:Key="SwitchToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  56. <Setter Property="Template">
  57. <Setter.Value>
  58. <ControlTemplate TargetType="{x:Type ToggleButton}">
  59. <Viewbox>
  60. <Grid x:Name="gr" Opacity="0.8">
  61. <Border
  62. x:Name="border2"
  63. Width="{TemplateBinding Width}"
  64. Height="{TemplateBinding Height}"
  65. HorizontalAlignment="Left"
  66. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  67. Background="Red"
  68. BorderBrush="{TemplateBinding BorderBrush}"
  69. CornerRadius="15">
  70. <ContentPresenter
  71. Margin="{TemplateBinding Padding}"
  72. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  73. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  74. RecognizesAccessKey="True"
  75. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  76. </Border>
  77. <Ellipse
  78. Name="ell"
  79. Width="{TemplateBinding Height}"
  80. Height="{TemplateBinding Height}"
  81. Margin="0"
  82. HorizontalAlignment="Left"
  83. VerticalAlignment="Center"
  84. Fill="#ddd" />
  85. <TextBlock
  86. Name="tb"
  87. Margin="10,0,10,0"
  88. HorizontalAlignment="Center"
  89. VerticalAlignment="Center"
  90. Foreground="White"
  91. Text="开" />
  92. </Grid>
  93. </Viewbox>
  94. <ControlTemplate.Triggers>
  95. <!-- 控件选中 -->
  96. <Trigger Property="IsChecked" Value="true">
  97. <Setter TargetName="ell" Property="HorizontalAlignment" Value="Right" />
  98. <Setter TargetName="border2" Property="Background" Value="#00c2f4" />
  99. <Setter TargetName="tb" Property="Text" Value="关" />
  100. <Setter TargetName="tb" Property="Margin" Value="0,0,15,0" />
  101. </Trigger>
  102. <!-- 控件未选中 -->
  103. <Trigger Property="IsChecked" Value="false">
  104. <Setter TargetName="border2" Property="Background" Value="gray" />
  105. <Setter TargetName="tb" Property="Text" Value="开" />
  106. <Setter TargetName="tb" Property="Margin" Value="15,0,0,0" />
  107. </Trigger>
  108. <!-- 鼠标进入 -->
  109. <Trigger Property="IsMouseOver" Value="True">
  110. <Setter TargetName="gr" Property="Opacity" Value="1" />
  111. </Trigger>
  112. <!-- 控件禁用 -->
  113. <Trigger Property="IsEnabled" Value="false">
  114. <Setter TargetName="gr" Property="Opacity" Value="0.5" />
  115. </Trigger>
  116. <!-- 控件启用 -->
  117. <Trigger Property="IsEnabled" Value="True">
  118. <Setter TargetName="gr" Property="Opacity" Value="0.8" />
  119. </Trigger>
  120. </ControlTemplate.Triggers>
  121. </ControlTemplate>
  122. </Setter.Value>
  123. </Setter>
  124. </Style>
  125. <!--#endregion-->
  126. </ResourceDictionary>