-
Notifications
You must be signed in to change notification settings - Fork 218
/
Styles.xaml
194 lines (176 loc) · 9.44 KB
/
Styles.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
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="InfoIcon" TargetType="{x:Type Rectangle}">
<Setter Property="Width" Value="12"/>
<Setter Property="Height" Value="12"/>
<Setter Property="Fill">
<Setter.Value>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M4,7.5C4,5.015 6.015,3 8.5,3 10.985,3 13,5.015 13,7.5 13,9.985 10.985,12 8.5,12 6.015,12 4,9.985 4,7.5" />
<GeometryDrawing Brush="#FF414141" Geometry="F1M9,6L8,6 8,5 9,5z M9,10L8,10 8,7 9,7z M8.5,4C6.567,4 5,5.567 5,7.5 5,9.433 6.567,11 8.5,11 10.433,11 12,9.433 12,7.5 12,5.567 10.433,4 8.5,4" />
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M8,6L9,6 9,5 8,5z M8,10L9,10 9,7 8,7z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="HoverUnderlineStyle" TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="TextBlock.TextDecorations" Value="Underline" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key='ErrorControl' TargetType='ContentControl'>
<Setter Property='Template'>
<Setter.Value>
<ControlTemplate TargetType='ContentControl'>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Rectangle Width="16" Height="16" ToolTip="{Binding ToolTip}" Name="errorIcon" Visibility="Collapsed">
<Rectangle.Fill>
<DrawingBrush>
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" />
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M8,16C3.589,16 0,12.411 0,8 0,3.589 3.589,0 8,0 12.411,0 16,3.589 16,8 16,12.411 12.411,16 8,16" />
<GeometryDrawing Brush="#FFE41400" Geometry="F1M9,10L7,10 7,3 9,3z M9,13L7,13 7,11 9,11z M8,1C4.134,1 1,4.134 1,8 1,11.865 4.134,15 8,15 11.865,15 15,11.865 15,8 15,4.134 11.865,1 8,1" />
<GeometryDrawing Brush="#FFEFEFF0" Geometry="F1M9,11L7,11 7,13 9,13z M9,10L7,10 7,3 9,3z" />
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
<ContentPresenter Grid.Column="1" Name="errorControl" />
</Grid>
<ControlTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource self},Path=Tag}" Value="True">
<Setter TargetName="errorIcon" Property="Visibility" Value="Visible" />
</DataTrigger>
</ControlTemplate.Triggers>
<ControlTemplate.Resources>
<Style TargetType="TextBox">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Tag, RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}" Value="True">
<Setter Property="Border.BorderBrush" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>
</ControlTemplate.Resources>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="ErrorBorder" TargetType="Control">
<Style.Triggers>
<DataTrigger Binding="{Binding HasErrors}" Value="True">
<Setter Property="Border.BorderBrush" Value="Red"/>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="HoverUnderlineStyleWithBackground" TargetType="TextBlock">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="TextBlock.TextDecorations" Value="Underline" />
<Setter Property="TextBlock.Background" Value="LightGray" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="LinkButton" TargetType="Button">
<Setter
Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<TextBlock Style="{DynamicResource HoverUnderlineStyle}" HorizontalAlignment="Left"> <!--TextDecorations="Underline" -->
<ContentPresenter />
</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="ContentButton" TargetType="Button">
<Setter
Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<ContentPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="Foreground" Value="Black" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
</Trigger>
</Style.Triggers>
</Style>
<Style TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Border"
Padding="2"
SnapsToDevicePixels="true">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="Border" Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}"/>
</Trigger>
<Trigger Property="UIElement.IsMouseOver" Value="True">
<Setter Property="Panel.Background" TargetName="Border"
Value="{DynamicResource SelectedRowBackgroundColor}"/>
<Setter Property="Border.BorderBrush" TargetName="Border"
Value="{DynamicResource SelectedRowBackgroundColor}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type DataGridRow}">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="{DynamicResource SelectedRowBackgroundColor}" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{DynamicResource SelectedRowBackgroundColor}" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
<!--<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="Yellow" /> -->
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
<Setter Property="Foreground" Value="{DynamicResource TextColor}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource SelectedRowBackgroundColor}" />
<Setter Property="Foreground" Value="{DynamicResource TextColor}" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="Test" TargetType="{x:Type MenuItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Grid Background="{TemplateBinding Background}">
<TextBlock Title="{TemplateBinding Header}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>