-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainWindow.xaml
More file actions
81 lines (79 loc) · 3.95 KB
/
MainWindow.xaml
File metadata and controls
81 lines (79 loc) · 3.95 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
<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp5"
mc:Ignorable="d"
Title="MainWindow" Height="600" Width="1024" Left="0" Top="0">
<Window.Resources>
<SolidColorBrush x:Key="LightGreyBrush"
Color="LightGray"/>
<SolidColorBrush x:Key="MidGreyBrush"
Color="MediumBlue"/>
<SolidColorBrush x:Key="DarkGreyBrush"
Color="Gray"/>
<Style TargetType="{x:Type Button}"
x:Key="3DButtonStyle">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<Border x:Name="TopLeftBorder"
BorderBrush="{StaticResource LightGreyBrush}"
BorderThickness="2,2,0,0"/>
<Border x:Name="BottomRightBorder"
BorderBrush="{StaticResource DarkGreyBrush}"
BorderThickness="0,0,2,2"/>
<Grid Margin="3">
<Grid.Background>
<LinearGradientBrush EndPoint="0.5,1"
StartPoint="0.5,0">
<GradientStop Color="AliceBlue"
Offset="0"/>
<GradientStop Color="LightBlue"
Offset="1"/>
</LinearGradientBrush>
</Grid.Background>
<ContentPresenter Margin="{TemplateBinding Padding}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed"
Value="True">
<Setter TargetName="TopLeftBorder"
Property="BorderBrush"
Value="{StaticResource DarkGreyBrush}"/>
<Setter TargetName="BottomRightBorder"
Property="BorderBrush"
Value="{StaticResource LightGreyBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<ToolBar x:Name="tBar" Grid.Row="0">
<Label Content="Background"/>
<local:ColorComboBox x:Name="cbBackground" MinWidth="200" DisplayType="WebColors" SelectionChanged="cbBackground_SelectionChanged"/>
<Separator/>
<Label Content="Foreground"/>
<local:ColorComboBox x:Name="cbForeground" MinWidth="200" DisplayType="WebColors" SelectionChanged="cbForeground_SelectionChanged"/>
<Separator/>
<Button x:Name="btnWebColors" Content="Web Colors" Style="{StaticResource 3DButtonStyle}" Click="btnWebColors_Click"/>
<Separator/>
<Button x:Name="btnSysColors" Content="System Colors" Style="{StaticResource 3DButtonStyle}" Click="btnSysColors_Click"/>
<Separator/>
<Button x:Name="btnAllColors" Content="All Colors" Style="{StaticResource 3DButtonStyle}" Click="btnAllColors_Click"/>
</ToolBar>
<ScrollViewer Grid.Row="1">
<TextBlock x:Name="TB" Margin="20,10" FontSize="36" TextWrapping="Wrap"/>
</ScrollViewer>
</Grid>
</Window>