ColorDropBoxPop.xaml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <UserControl x:Class="PDF_Office.CustomControl.ColorDropBoxPop"
  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:PDF_Office.CustomControl"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800" Width="194" Height="auto">
  9. <UserControl.Resources>
  10. <local:ColorToBrushConverter x:Key="ColorToBrushConverter"></local:ColorToBrushConverter>
  11. <Style TargetType="ListViewItem">
  12. <Setter Property="Width" Value="15" ></Setter>
  13. <Setter Property="Height" Value="15" ></Setter>
  14. <Setter Property="Padding" Value="0"></Setter>
  15. <Setter Property="BorderThickness" Value="1"></Setter>
  16. <Setter Property="BorderBrush" Value="#33000000"></Setter>
  17. <Setter Property="Margin" Value="1"></Setter>
  18. </Style>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Border Background="White" Name="ContainerBorder" BorderThickness="1">
  22. <Border.Effect>
  23. <DropShadowEffect Color="#000000" ShadowDepth="0" BlurRadius="24" Opacity="0.22">
  24. </DropShadowEffect>
  25. </Border.Effect>
  26. <Grid>
  27. <Grid.RowDefinitions>
  28. <RowDefinition Height="auto"></RowDefinition>
  29. <RowDefinition Height="auto"></RowDefinition>
  30. <RowDefinition Height="auto"></RowDefinition>
  31. <RowDefinition Height="auto"></RowDefinition>
  32. <RowDefinition Height="auto"></RowDefinition>
  33. <RowDefinition Height="auto"></RowDefinition>
  34. <RowDefinition Height="auto"></RowDefinition>
  35. <RowDefinition Height="auto"></RowDefinition>
  36. </Grid.RowDefinitions>
  37. <TextBlock x:Name="RecentlyColorText" VerticalAlignment="Bottom" LineHeight="20" FontFamily="Segoe UI" FontSize="14" Margin="8,8,0,3">Recently used color</TextBlock>
  38. <ListView Grid.Row="1" BorderThickness="0" Name="RecentlyColorList" Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
  39. <ListView.ItemsPanel>
  40. <ItemsPanelTemplate>
  41. <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
  42. </WrapPanel>
  43. </ItemsPanelTemplate>
  44. </ListView.ItemsPanel>
  45. <ListView.ItemTemplate>
  46. <DataTemplate>
  47. <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
  48. </DataTemplate>
  49. </ListView.ItemTemplate>
  50. </ListView>
  51. <TextBlock x:Name="ThemeColorsText" Grid.Row="2" FontFamily="SegoeUI" FontSize="14" LineHeight="20" Margin="8,5,0,1">Theme colors</TextBlock>
  52. <ListView Grid.Row="3" BorderThickness="0" Name="ThemeColorList" Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionMode="Single">
  53. <ListView.ItemsPanel>
  54. <ItemsPanelTemplate>
  55. <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
  56. </WrapPanel>
  57. </ItemsPanelTemplate>
  58. </ListView.ItemsPanel>
  59. <ListView.ItemTemplate>
  60. <DataTemplate>
  61. <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
  62. </DataTemplate>
  63. </ListView.ItemTemplate>
  64. </ListView>
  65. <Separator Grid.Row="4" Width="190" Height="1" Background="#26000000" HorizontalAlignment="Center" Margin="2,9,2,8"></Separator>
  66. <StackPanel Orientation="Horizontal" Grid.Row="5" Name="TransparentPanel" Margin="0 0 0 8" Visibility="Collapsed">
  67. <Rectangle Width="16" Height="16" Margin="8,0,2,0" MouseLeftButtonDown="TransparentColor_MouseLeftButtonDown">
  68. <Rectangle.Fill>
  69. <DrawingBrush>
  70. <DrawingBrush.Drawing>
  71. <DrawingGroup>
  72. <GeometryDrawing Brush="White">
  73. <GeometryDrawing.Pen>
  74. <Pen Thickness="1" Brush="#E2E3E6"></Pen>
  75. </GeometryDrawing.Pen>
  76. <GeometryDrawing.Geometry>
  77. <RectangleGeometry Rect="0,0,16,16"></RectangleGeometry>
  78. </GeometryDrawing.Geometry>
  79. </GeometryDrawing>
  80. <GeometryDrawing>
  81. <GeometryDrawing.Pen>
  82. <Pen Thickness="2" Brush="#FF3B30"></Pen>
  83. </GeometryDrawing.Pen>
  84. <GeometryDrawing.Geometry>
  85. <LineGeometry StartPoint="16,0" EndPoint="0,16"></LineGeometry>
  86. </GeometryDrawing.Geometry>
  87. </GeometryDrawing>
  88. </DrawingGroup>
  89. </DrawingBrush.Drawing>
  90. </DrawingBrush>
  91. </Rectangle.Fill>
  92. </Rectangle>
  93. <TextBlock x:Name="TransparentText" FontFamily="Segoe UI" FontSize="14" VerticalAlignment="Center">Transparent</TextBlock>
  94. </StackPanel>
  95. <StackPanel Orientation="Horizontal" Grid.Row="6" MouseDown="SystemColorPicker_ClickPop">
  96. <Ellipse Width="16" Height="16" Margin="8,0,2,10" VerticalAlignment="Center">
  97. <Ellipse.Fill>
  98. <DrawingBrush>
  99. <DrawingBrush.Drawing>
  100. <ImageDrawing ImageSource="../Resources/PropertyPanel/colorIcon.png">
  101. <ImageDrawing.Rect>
  102. <Rect Width="16" Height="16"></Rect>
  103. </ImageDrawing.Rect>
  104. </ImageDrawing>
  105. </DrawingBrush.Drawing>
  106. </DrawingBrush>
  107. </Ellipse.Fill>
  108. </Ellipse>
  109. <TextBlock x:Name="OtherColorsText" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="14" Margin="0 0 0 8">Other Colors</TextBlock>
  110. </StackPanel>
  111. </Grid>
  112. </Border>
  113. </Grid>
  114. </UserControl>