-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColorPickerDialog.xaml
More file actions
113 lines (106 loc) · 4.67 KB
/
ColorPickerDialog.xaml
File metadata and controls
113 lines (106 loc) · 4.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<Window x:Class="FlowInk.ColorPickerDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:FlowInk.Properties"
Title="{x:Static res:Resources.ColorPicker}"
Width="360"
Height="320"
WindowStartupLocation="CenterOwner"
ResizeMode="NoResize"
Background="#FF1E1E1E"
Foreground="White">
<Grid Margin="14">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0"
Text="{x:Static res:Resources.Color}"
FontWeight="SemiBold"
Margin="0,0,0,6"/>
<DockPanel Grid.Row="1" Margin="0,0,0,12">
<Border Width="52"
Height="52"
CornerRadius="6"
BorderBrush="#AAFFFFFF"
BorderThickness="1"
Margin="0,0,10,0"
SnapsToDevicePixels="True">
<Grid>
<Grid.Resources>
<VisualBrush x:Key="CheckerBrush" TileMode="Tile" Viewport="0,0,12,12" ViewportUnits="Absolute">
<VisualBrush.Visual>
<Grid Width="12" Height="12" Background="#FFFFFFFF">
<Rectangle Width="6" Height="6" Fill="#FFD0D0D0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<Rectangle Width="6" Height="6" Fill="#FFD0D0D0" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Grid.Resources>
<Border Background="{StaticResource CheckerBrush}" CornerRadius="5"/>
<Border CornerRadius="5">
<Border.Background>
<SolidColorBrush x:Name="PreviewBrush"/>
</Border.Background>
</Border>
</Grid>
</Border>
<StackPanel VerticalAlignment="Center">
<TextBlock x:Name="ColorValueTextBlock"
FontFamily="Consolas"
Margin="0,0,0,2"/>
<TextBlock x:Name="AlphaValueTextBlock"/>
</StackPanel>
</DockPanel>
<Button Grid.Row="2"
x:Name="ChooseBaseColorButton"
Content="{x:Static res:Resources.ChooseColor}"
Width="120"
Height="32"
HorizontalAlignment="Left"
Click="ChooseBaseColorButton_Click"/>
<StackPanel Grid.Row="3" Margin="0,16,0,0">
<TextBlock Text="{x:Static res:Resources.Transparency}"
FontWeight="SemiBold"
Margin="0,0,0,6"/>
<Slider x:Name="AlphaSlider"
Minimum="0"
Maximum="255"
TickFrequency="1"
IsSnapToTickEnabled="True"
ValueChanged="AlphaSlider_ValueChanged"/>
<Grid Margin="0,6,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0"
Text="{x:Static res:Resources.TransparencyMinLabel}"
HorizontalAlignment="Left"
VerticalAlignment="Top"/>
<TextBlock Grid.Column="1"
Text="{x:Static res:Resources.TransparencyMaxLabel}"
HorizontalAlignment="Right"
VerticalAlignment="Top"/>
</Grid>
</StackPanel>
<StackPanel Grid.Row="4"
Orientation="Horizontal"
HorizontalAlignment="Right"
Margin="0,14,0,0">
<Button Content="{x:Static res:Resources.OK}"
Width="84"
Height="32"
Margin="0,0,8,0"
IsDefault="True"
Click="OkButton_Click"/>
<Button Content="{x:Static res:Resources.Cancel}"
Width="84"
Height="32"
IsCancel="True"/>
</StackPanel>
</Grid>
</Window>