ColorDropBoxPop.xaml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <UserControl
  2. x:Class="PDF_Office.CustomControl.ColorDropBoxPop"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:PDF_Office.CustomControl"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. Width="194"
  9. Height="auto"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <local:ColorToBrushConverter x:Key="ColorToBrushConverter" />
  15. <Style TargetType="ListViewItem">
  16. <Setter Property="Width" Value="15" />
  17. <Setter Property="Height" Value="15" />
  18. <Setter Property="Padding" Value="0" />
  19. <Setter Property="BorderThickness" Value="1" />
  20. <Setter Property="BorderBrush" Value="#33000000" />
  21. <Setter Property="Margin" Value="1" />
  22. </Style>
  23. </UserControl.Resources>
  24. <Grid>
  25. <Border
  26. Name="ContainerBorder"
  27. Background="White"
  28. BorderThickness="1">
  29. <Border.Effect>
  30. <DropShadowEffect
  31. BlurRadius="24"
  32. Opacity="0.22"
  33. ShadowDepth="0"
  34. Color="#000000" />
  35. </Border.Effect>
  36. <Grid>
  37. <Grid.RowDefinitions>
  38. <RowDefinition Height="auto" />
  39. <RowDefinition Height="auto" />
  40. <RowDefinition Height="auto" />
  41. <RowDefinition Height="auto" />
  42. <RowDefinition Height="auto" />
  43. <RowDefinition Height="auto" />
  44. <RowDefinition Height="auto" />
  45. <RowDefinition Height="auto" />
  46. </Grid.RowDefinitions>
  47. <TextBlock
  48. x:Name="RecentlyColorText"
  49. Margin="8,8,0,3"
  50. VerticalAlignment="Bottom"
  51. FontFamily="Segoe UI"
  52. FontSize="14"
  53. LineHeight="20">
  54. Recently used color
  55. </TextBlock>
  56. <ListView
  57. Name="RecentlyColorList"
  58. Grid.Row="1"
  59. Margin="9,0,9,0"
  60. BorderThickness="0"
  61. ScrollViewer.HorizontalScrollBarVisibility="Hidden">
  62. <ListView.ItemsPanel>
  63. <ItemsPanelTemplate>
  64. <WrapPanel Width="{Binding ElementName=ThemeColorList, Path=ActualWidth}" />
  65. </ItemsPanelTemplate>
  66. </ListView.ItemsPanel>
  67. <ListView.ItemTemplate>
  68. <DataTemplate>
  69. <Rectangle
  70. Width="14"
  71. Height="14"
  72. Fill="{Binding Converter={StaticResource ColorToBrushConverter}}"
  73. MouseLeftButtonDown="Rectangle_MouseLeftButtonDown" />
  74. </DataTemplate>
  75. </ListView.ItemTemplate>
  76. </ListView>
  77. <TextBlock
  78. x:Name="ThemeColorsText"
  79. Grid.Row="2"
  80. Margin="8,5,0,1"
  81. FontFamily="SegoeUI"
  82. FontSize="14"
  83. LineHeight="20">
  84. Theme colors
  85. </TextBlock>
  86. <ListView
  87. Name="ThemeColorList"
  88. Grid.Row="3"
  89. Margin="9,0,9,0"
  90. BorderThickness="0"
  91. ScrollViewer.HorizontalScrollBarVisibility="Hidden"
  92. SelectionMode="Single">
  93. <ListView.ItemsPanel>
  94. <ItemsPanelTemplate>
  95. <WrapPanel Width="{Binding ElementName=ThemeColorList, Path=ActualWidth}" />
  96. </ItemsPanelTemplate>
  97. </ListView.ItemsPanel>
  98. <ListView.ItemTemplate>
  99. <DataTemplate>
  100. <Rectangle
  101. Width="14"
  102. Height="14"
  103. Fill="{Binding Converter={StaticResource ColorToBrushConverter}}"
  104. MouseLeftButtonDown="Rectangle_MouseLeftButtonDown" />
  105. </DataTemplate>
  106. </ListView.ItemTemplate>
  107. </ListView>
  108. <Separator
  109. Grid.Row="4"
  110. Width="190"
  111. Height="1"
  112. Margin="2,9,2,8"
  113. HorizontalAlignment="Center"
  114. Background="#26000000" />
  115. <StackPanel
  116. Name="TransparentPanel"
  117. Grid.Row="5"
  118. Margin="0,0,0,8"
  119. Orientation="Horizontal"
  120. Visibility="Collapsed">
  121. <Rectangle
  122. Width="16"
  123. Height="16"
  124. Margin="8,0,2,0"
  125. MouseLeftButtonDown="TransparentColor_MouseLeftButtonDown">
  126. <Rectangle.Fill>
  127. <DrawingBrush>
  128. <DrawingBrush.Drawing>
  129. <DrawingGroup>
  130. <GeometryDrawing Brush="White">
  131. <GeometryDrawing.Pen>
  132. <Pen Brush="#E2E3E6" Thickness="1" />
  133. </GeometryDrawing.Pen>
  134. <GeometryDrawing.Geometry>
  135. <RectangleGeometry Rect="0,0,16,16" />
  136. </GeometryDrawing.Geometry>
  137. </GeometryDrawing>
  138. <GeometryDrawing>
  139. <GeometryDrawing.Pen>
  140. <Pen Brush="#FF3B30" Thickness="2" />
  141. </GeometryDrawing.Pen>
  142. <GeometryDrawing.Geometry>
  143. <LineGeometry StartPoint="16,0" EndPoint="0,16" />
  144. </GeometryDrawing.Geometry>
  145. </GeometryDrawing>
  146. </DrawingGroup>
  147. </DrawingBrush.Drawing>
  148. </DrawingBrush>
  149. </Rectangle.Fill>
  150. </Rectangle>
  151. <TextBlock
  152. x:Name="TransparentText"
  153. VerticalAlignment="Center"
  154. FontFamily="Segoe UI"
  155. FontSize="14">
  156. Transparent
  157. </TextBlock>
  158. </StackPanel>
  159. <StackPanel
  160. Grid.Row="6"
  161. MouseDown="SystemColorPicker_ClickPop"
  162. Orientation="Horizontal">
  163. <Ellipse
  164. Width="16"
  165. Height="16"
  166. Margin="8,0,2,10"
  167. VerticalAlignment="Center">
  168. <Ellipse.Fill>
  169. <DrawingBrush>
  170. <DrawingBrush.Drawing>
  171. <ImageDrawing ImageSource="../Resources/PropertyPanel/colorIcon.png">
  172. <ImageDrawing.Rect>
  173. <Rect Width="16" Height="16" />
  174. </ImageDrawing.Rect>
  175. </ImageDrawing>
  176. </DrawingBrush.Drawing>
  177. </DrawingBrush>
  178. </Ellipse.Fill>
  179. </Ellipse>
  180. <TextBlock
  181. x:Name="OtherColorsText"
  182. Margin="0,0,0,8"
  183. VerticalAlignment="Center"
  184. FontFamily="Segoe UI"
  185. FontSize="14">
  186. Other Colors
  187. </TextBlock>
  188. </StackPanel>
  189. </Grid>
  190. </Border>
  191. </Grid>
  192. </UserControl>