/
ColorFormatControl.xaml
66 lines (63 loc) · 3.04 KB
/
ColorFormatControl.xaml
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
<UserControl x:Class="ColorPicker.Controls.ColorFormatControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:p="clr-namespace:ColorPicker.Properties" xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d">
<Border x:Name="MainBorder"
Margin="12,16,12,0"
Width="348"
Height="36"
CornerRadius="2"
HorizontalAlignment="Stretch"
Background="{DynamicResource ColorControlBackgroundBrush}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="64"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="36"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="FormatNameTextBlock"
Opacity="0.6"
Foreground="{DynamicResource PrimaryForegroundBrush}"
Margin="8"
FontWeight="SemiBold"
FontSize="12"
VerticalAlignment="Center"/>
<TextBox x:Name="ColorTextRepresentationTextBlock"
Foreground="{DynamicResource PrimaryForegroundBrush}"
FontFamily="Consolas"
Grid.Column="1"
FontSize="14"
IsTabStop="False"
Background="Transparent"
BorderThickness="0"
IsReadOnly="True"
VerticalAlignment="Center"
Padding="8"
AutomationProperties.Name="{x:Static p:Resources.Color_Code}"
/>
<Button x:Name="CopyToClipboardButton"
ToolTipService.ToolTip="{x:Static p:Resources.Copy_to_clipboard}"
Background="{DynamicResource ColorControlBackgroundBrush}"
Foreground="{DynamicResource PrimaryForegroundBrush}"
Opacity="0.6"
Height="36"
Width="36"
Grid.Column="2"
AutomationProperties.Name="{x:Static p:Resources.Copy_to_clipboard}"
AutomationProperties.HelpText="{Binding ElementName=ColorTextRepresentationTextBlock, Path=Text}"
FontSize="12"
Style="{StaticResource DefaultButtonStyle}"
FontFamily="Segoe MDL2 Assets">
<Button.Content>
<TextBlock Text="" AutomationProperties.Name="{x:Static p:Resources.Copy_to_clipboard}" />
</Button.Content>
</Button>
</Grid>
<Border.Effect>
<DropShadowEffect BlurRadius="6" Opacity="0.24" ShadowDepth="1" />
</Border.Effect>
</Border>
</UserControl>