ColorDropBoxPop.xaml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <UserControl x:Class="ComPDFKitDemo.AnntControl.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:ComPDFKitDemo.AnntControl"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800" Width="194" Height="243">
  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. </Grid.RowDefinitions>
  36. <TextBlock FontFamily="SegoeUI" FontSize="14" LineHeight="20" Margin="8,2,0,3">Recently used color</TextBlock>
  37. <ListView Grid.Row="1" BorderThickness="0" Name="RecentlyColorList" Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
  38. <ListView.ItemsPanel>
  39. <ItemsPanelTemplate>
  40. <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
  41. </WrapPanel>
  42. </ItemsPanelTemplate>
  43. </ListView.ItemsPanel>
  44. <ListView.ItemTemplate>
  45. <DataTemplate>
  46. <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
  47. </DataTemplate>
  48. </ListView.ItemTemplate>
  49. </ListView>
  50. <TextBlock Grid.Row="2" FontFamily="SegoeUI" FontSize="14" LineHeight="20" Margin="8,2,0,3">Theme colors</TextBlock>
  51. <ListView Grid.Row="3" BorderThickness="0" Name="ThemeColorList" Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionMode="Single">
  52. <ListView.ItemsPanel>
  53. <ItemsPanelTemplate>
  54. <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
  55. </WrapPanel>
  56. </ItemsPanelTemplate>
  57. </ListView.ItemsPanel>
  58. <ListView.ItemTemplate>
  59. <DataTemplate>
  60. <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
  61. </DataTemplate>
  62. </ListView.ItemTemplate>
  63. </ListView>
  64. <StackPanel Orientation="Horizontal" Grid.Row="4">
  65. <Rectangle Width="16" Height="16" Margin="8,0,2,0" MouseLeftButtonDown="TransparentColor_MouseLeftButtonDown">
  66. <Rectangle.Fill>
  67. <DrawingBrush>
  68. <DrawingBrush.Drawing>
  69. <DrawingGroup>
  70. <GeometryDrawing Brush="White">
  71. <GeometryDrawing.Pen>
  72. <Pen Thickness="1" Brush="#E2E3E6"></Pen>
  73. </GeometryDrawing.Pen>
  74. <GeometryDrawing.Geometry>
  75. <RectangleGeometry Rect="0,0,16,16"></RectangleGeometry>
  76. </GeometryDrawing.Geometry>
  77. </GeometryDrawing>
  78. <GeometryDrawing>
  79. <GeometryDrawing.Pen>
  80. <Pen Thickness="2" Brush="#FF3B30"></Pen>
  81. </GeometryDrawing.Pen>
  82. <GeometryDrawing.Geometry>
  83. <LineGeometry StartPoint="16,0" EndPoint="0,16"></LineGeometry>
  84. </GeometryDrawing.Geometry>
  85. </GeometryDrawing>
  86. </DrawingGroup>
  87. </DrawingBrush.Drawing>
  88. </DrawingBrush>
  89. </Rectangle.Fill>
  90. </Rectangle>
  91. <TextBlock FontFamily="SegoeUI" FontSize="14" LineHeight="20" VerticalAlignment="Center">Transparent</TextBlock>
  92. </StackPanel>
  93. <StackPanel Orientation="Horizontal" Grid.Row="5" MouseDown="SystemColorPicker_ClickPop" Margin="0,8,0,0">
  94. <Ellipse Width="16" Height="16" Margin="5,0,0,0" VerticalAlignment="Center">
  95. <Ellipse.Fill>
  96. <DrawingBrush>
  97. <DrawingBrush.Drawing>
  98. <ImageDrawing ImageSource="../Resources/colorIcon.png">
  99. <ImageDrawing.Rect>
  100. <Rect Width="16" Height="16"></Rect>
  101. </ImageDrawing.Rect>
  102. </ImageDrawing>
  103. </DrawingBrush.Drawing>
  104. </DrawingBrush>
  105. </Ellipse.Fill>
  106. </Ellipse>
  107. <TextBlock VerticalAlignment="Center" Padding="4,4,0,0" FontFamily="SegoeUI" FontSize="14" LineHeight="20">Other Colors</TextBlock>
  108. </StackPanel>
  109. </Grid>
  110. </Border>
  111. </Grid>
  112. </UserControl>