CPDFArrowUI.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <UserControl x:Class="Compdfkit_Tools.Common.CPDFArrowUI"
  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:Compdfkit_Tools.Common"
  7. mc:Ignorable="d"
  8. d:DesignHeight="30" d:DesignWidth="115">
  9. <UserControl.Resources>
  10. <ControlTemplate x:Key="CmbItemTemplate" TargetType="{x:Type ComboBoxItem}">
  11. <Border
  12. Name="Bd"
  13. Padding="{TemplateBinding Control.Padding}"
  14. Background="{TemplateBinding Panel.Background}"
  15. BorderBrush="{TemplateBinding Border.BorderBrush}"
  16. BorderThickness="{TemplateBinding Border.BorderThickness}"
  17. SnapsToDevicePixels="True">
  18. <ContentPresenter
  19. HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
  20. VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
  21. Content="{TemplateBinding ContentControl.Content}"
  22. ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
  23. ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
  24. SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
  25. </Border>
  26. <ControlTemplate.Triggers>
  27. <Trigger Property="UIElement.IsEnabled" Value="False">
  28. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  29. </Trigger>
  30. <MultiTrigger>
  31. <MultiTrigger.Conditions>
  32. <Condition Property="Selector.IsSelected" Value="False" />
  33. <Condition Property="UIElement.IsMouseOver" Value="True" />
  34. <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
  35. </MultiTrigger.Conditions>
  36. <Setter TargetName="Bd" Property="Panel.Background" Value="#1F26A0DA" />
  37. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#A826A0DA" />
  38. </MultiTrigger>
  39. <MultiTrigger>
  40. <MultiTrigger.Conditions>
  41. <Condition Property="Selector.IsSelected" Value="True" />
  42. <Condition Property="UIElement.IsMouseOver" Value="False" />
  43. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  44. </MultiTrigger.Conditions>
  45. <Setter TargetName="Bd" Property="Panel.Background" Value="#3D26A0DA" />
  46. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
  47. </MultiTrigger>
  48. <MultiTrigger>
  49. <MultiTrigger.Conditions>
  50. <Condition Property="Selector.IsSelected" Value="True" />
  51. <Condition Property="UIElement.IsMouseOver" Value="True" />
  52. </MultiTrigger.Conditions>
  53. <Setter TargetName="Bd" Property="Panel.Background" Value="#1A477EDE" />
  54. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />
  55. </MultiTrigger>
  56. <MultiTrigger>
  57. <MultiTrigger.Conditions>
  58. <Condition Property="Selector.IsSelected" Value="True" />
  59. <Condition Property="UIElement.IsMouseOver" Value="False" />
  60. <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
  61. </MultiTrigger.Conditions>
  62. <Setter TargetName="Bd" Property="Panel.Background" Value="#3DDADADA" />
  63. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#DADADA" />
  64. </MultiTrigger>
  65. <MultiTrigger>
  66. <MultiTrigger.Conditions>
  67. <Condition Property="Selector.IsSelected" Value="False" />
  68. <Condition Property="UIElement.IsMouseOver" Value="False" />
  69. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  70. </MultiTrigger.Conditions>
  71. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
  72. </MultiTrigger>
  73. <MultiTrigger>
  74. <MultiTrigger.Conditions>
  75. <Condition Property="Selector.IsSelected" Value="False" />
  76. <Condition Property="UIElement.IsMouseOver" Value="True" />
  77. <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
  78. </MultiTrigger.Conditions>
  79. <Setter TargetName="Bd" Property="Panel.Background" Value="#1A000000" />
  80. <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />
  81. </MultiTrigger>
  82. </ControlTemplate.Triggers>
  83. </ControlTemplate>
  84. </UserControl.Resources>
  85. <Grid>
  86. <Border BorderBrush="#E2E3E6" BorderThickness="0" Width="115" Height="32">
  87. <ComboBox x:Name="ArrowBox" Background="Transparent" BorderThickness="1" BorderBrush="#FFE2E3E6" IsReadOnly="True" MaxDropDownHeight="200" SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}"
  88. VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
  89. <ComboBox.ItemContainerStyle>
  90. <Style TargetType="{x:Type ComboBoxItem}">
  91. <Setter Property="Padding" Value="25 0 0 0"></Setter>
  92. </Style>
  93. </ComboBox.ItemContainerStyle>
  94. <ComboBoxItem VerticalAlignment="Center" Height="32" Template="{StaticResource CmbItemTemplate}">
  95. <Path Fill="#000000" Tag="Line" Height="20">
  96. <Path.Data>
  97. F1 M40,16z M0,0z M34,7.5L34,7.5 34,8.5 6,8.5 6,7.5z
  98. </Path.Data>
  99. </Path>
  100. </ComboBoxItem>
  101. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  102. <Path Fill="#000000" Tag="Arrow" Height="20">
  103. <Path.Data>
  104. F1 M40,16z M0,0z M10.7427521,4.57125354L11.2572479,5.42874646 7.80417468,7.49925354 34,7.5 34,8.5 7.80417468,8.49925354 11.2572479,10.5712535 10.7427521,11.4287465 5.02817468,8 10.7427521,4.57125354z
  105. </Path.Data>
  106. </Path>
  107. </ComboBoxItem>
  108. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  109. <Path Fill="#000000" Tag="CloseArrow" Height="20">
  110. <Path.Data>
  111. F1 M40,16z M0,0z M11.5,4.11690481L11.4991747,7.49990481 34,7.5 34,8.5 11.4991747,8.49990481 11.5,11.8830952 5.02817468,8 11.5,4.11690481z
  112. </Path.Data>
  113. </Path>
  114. </ComboBoxItem>
  115. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  116. <Path Fill="#000000" Tag="Square" Height="20">
  117. <Path.Data>
  118. M11.5,5 L11.5,7.5 L34,7.5 L34,8.5 L11.5,8.5 L11.5,11 L5.5,11 L5.5,5 L11.5,5 Z
  119. </Path.Data>
  120. </Path>
  121. </ComboBoxItem>
  122. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  123. <Path Fill="#000000" Tag="Circle" Height="20">
  124. <Path.Data>
  125. M8.5,5 C9.98660106,5 11.2206526,6.08129303 11.4585702,7.50029469 L34,7.5 L34,8.5 L11.4584039,8.50069618 C11.2200781,9.9192103 9.98625501,11 8.5,11 C6.84314575,11 5.5,9.65685425 5.5,8 C5.5,6.34314575 6.84314575,5 8.5,5 Z
  126. </Path.Data>
  127. </Path>
  128. </ComboBoxItem>
  129. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  130. <Path Fill="#000000" Tag="Diamond" Height="20">
  131. <Path.Data>
  132. M9,4.29289322 L12.2068932,7.49989322 L34,7.5 L34,8.5 L12.2068932,8.49989322 L9,11.7071068 L5.29289322,8 L9,4.29289322 Z
  133. </Path.Data>
  134. </Path>
  135. </ComboBoxItem>
  136. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  137. <Path Fill="#000000" Tag="Butt" Height="20">
  138. <Path.Data>
  139. M7.5,5.5 L7.5,7.5 L34,7.5 L34,8.5 L7.5,8.5 L7.5,10.5 L6.5,10.5 L6.5,5.5 L7.5,5.5 Z
  140. </Path.Data>
  141. </Path>
  142. </ComboBoxItem>
  143. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  144. <Path Fill="#000000" Tag="RArrow" Height="20" >
  145. <Path.Data>
  146. M5.58660083,5.07600085 L9.46460189,7.49900085 L34,7.5 L34,8.5 L9.46460189,8.49900085 L5.58660083,10.9239992 L5.05660189,10.0760008 L8.37960136,8 L5.05660189,5.92399915 L5.58660083,5.07600085 Z
  147. </Path.Data>
  148. </Path>
  149. </ComboBoxItem>
  150. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  151. <Path Fill="#000000" Tag="RCloseArrow" Height="20">
  152. <Path.Data>
  153. M5.5,4.59787618 L10.143,7.49987618 L34,7.5 L34,8.5 L10.143,8.49987618 L5.5,11.4021238 L5.5,4.59787618 Z
  154. </Path.Data>
  155. </Path>
  156. </ComboBoxItem>
  157. <ComboBoxItem VerticalAlignment="Center" Height="32" VerticalContentAlignment="Center" Template="{StaticResource CmbItemTemplate}">
  158. <Path Fill="#000000" Tag="Slash" Height="20">
  159. <Path.Data>
  160. M9.531981,5.84644661 L10.239087,6.55355339 L9.292447,7.49944661 L34,7.5 L34,8.5 L8.292447,8.49944661 L6.703553,10.0890873 L5.996447,9.38198052 L9.531981,5.84644661 Z
  161. </Path.Data>
  162. </Path>
  163. </ComboBoxItem>
  164. </ComboBox>
  165. </Border>
  166. </Grid>
  167. </UserControl>