Repository navigation
Expand file tree
/
Copy pathColorPickerWindow.xaml
More file actions
63 lines (61 loc) · 3.16 KB
/
Copy pathColorPickerWindow.xaml
File metadata and controls
63 lines (61 loc) · 3.16 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
<Window x:Class="HttpTraceAnalyser.ColorPickerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:HttpTraceAnalyser"
Title="Choose Colour" SizeToContent="WidthAndHeight"
ResizeMode="NoResize" ShowInTaskbar="False"
WindowStartupLocation="CenterOwner">
<StackPanel Margin="12" Width="300">
<TextBlock Text="Palette" Margin="0,0,0,6" FontWeight="SemiBold" />
<ItemsControl x:Name="SwatchList">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="10" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Width="26" Height="26" Margin="1" Padding="0"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
Click="Swatch_Click"
ToolTip="{Binding Name}">
<Border Background="{Binding Color, Converter={x:Static local:HighlightsWindow.ColorBrushConverter}}"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="1" />
</Button>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="Hex" Margin="0,12,0,6" FontWeight="SemiBold" />
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="HexTextBox" Grid.Column="0" MaxLength="9"
TextChanged="HexTextBox_TextChanged"
ToolTip="Enter a colour such as #RRGGBB" />
<Border x:Name="PreviewBorder" Grid.Column="1" Width="40" Margin="8,0,0,0"
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
BorderThickness="1" />
</Grid>
<TextBlock x:Name="HexErrorText" Foreground="{DynamicResource SystemFillColorCriticalBrush}"
Text="Not a valid colour." Visibility="Collapsed" Margin="0,4,0,0" />
<Grid Margin="0,16,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Button x:Name="ClearButton" Grid.Column="0" Content="Clear" Width="80"
Click="ClearButton_Click"
ToolTip="Remove the colour and use the automatic value" />
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button x:Name="OkButton" Content="OK" Width="80" Margin="0,0,8,0"
IsDefault="True" Click="OkButton_Click" />
<Button Content="Cancel" Width="80" IsCancel="True" />
</StackPanel>
</Grid>
</StackPanel>
</Window>