ColorDropBoxPop.xaml 8.7 KB

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