-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathStyles.xaml
More file actions
563 lines (543 loc) · 36.5 KB
/
Styles.xaml
File metadata and controls
563 lines (543 loc) · 36.5 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
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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
<ResourceDictionary
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:my="clr-namespace:Power8" xmlns:Converters="clr-namespace:Power8.Converters"
xmlns:helpers="clr-namespace:Power8.Helpers"
xmlns:views="clr-namespace:Power8.Views"
mc:Ignorable="d">
<!-- Resource dictionary entries should be defined here. -->
<Converters:NameToResourceConverter x:Key="localizer"/>
<Converters:MenuWidthToMarginConverter x:Key="themeApplier" />
<Converters:BitmapSource2VisibilityConverter x:Key="imageDisplay"/>
<Converters:BoolToGridRowConverter x:Key="uiSwitcher"/>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Converters:TextToBoolConverter x:Key="TextToBoolConverter"/>
<Converters:Stretch2BoolConverter x:Key="Stretch2BoolConverter"/>
<!-- Stuff -->
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
<DockPanel IsItemsHost="True"/>
</ItemsPanelTemplate>
<Style TargetType="{x:Type TextBox}" x:Key="SearchBoxStyle">
<Setter Property="Height" Value="24"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="Text" Value="">
<Setter Property="Background">
<Setter.Value>
<VisualBrush Stretch="None" AlignmentX="Left">
<VisualBrush.Visual>
<Grid Background="White" VerticalAlignment="Center">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5"/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" Foreground="White"><Run Text="padding"/></TextBlock>
<TextBlock Grid.Column="1" Foreground="#FFC0C0C0" x:Name="SearchBox"
Height="22" Padding="0,2,0,0"
Text="{Binding Name, Converter={StaticResource localizer}, Mode=OneWay, RelativeSource={RelativeSource Self}}"
/>
</Grid>
</VisualBrush.Visual>
</VisualBrush>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<!-- /Stuff -->
<!-- Buttons -->
<!--TODO: why not to move this to ContentControl style?-->
<Style TargetType="{x:Type Button}" x:Key="Localized">
<Setter Property="Content" Value="{Binding Name, Converter={StaticResource localizer}, Mode=OneWay, RelativeSource={RelativeSource Self}}"/>
</Style>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource Localized}">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="0"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid Width="Auto" x:Name="LayoutRoot" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pressedGradient">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="border">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="border" BorderBrush="{DynamicResource WhiteAlfa30}" CornerRadius="3" Opacity="0">
<Border BorderBrush="{DynamicResource BlackBrush}" BorderThickness="1" CornerRadius="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="1,1,1,0" CornerRadius="1,1,0,0" Background="{DynamicResource WhiteRoundGradient}"/>
<Border BorderBrush="{DynamicResource WhiteAlfa60}" BorderThickness="1" CornerRadius="1" Grid.RowSpan="2"/>
<Border Grid.RowSpan="1" Background="{DynamicResource WhiteAlfa30}" CornerRadius="1,1,0,0"/>
<Border BorderThickness="1,0,1,1" CornerRadius="0,0,1,1" Background="{DynamicResource WhiteRoundGradient}" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1" ScaleX="1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
</Border>
</Grid>
</Border>
</Border>
<Border x:Name="pressedGradient" Grid.RowSpan="1" CornerRadius="2" Height="Auto" BorderThickness="2" Background="{DynamicResource PressedGradientBrush}" Opacity="0"/>
<Border x:Name="border_Copy" BorderBrush="{DynamicResource WhiteAlfa30}" CornerRadius="3" Opacity="0">
<Border BorderBrush="{DynamicResource BlackBrush}" BorderThickness="1" CornerRadius="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="1,1,1,0" CornerRadius="1,1,0,0" Background="{DynamicResource WhiteRoundGradient}"/>
<Border BorderBrush="{DynamicResource WhiteAlfa60}" BorderThickness="1" CornerRadius="1" Grid.RowSpan="2"/>
<Border Grid.RowSpan="1" Background="{DynamicResource WhiteAlfa30}" CornerRadius="1,1,0,0"/>
<Border BorderThickness="1,0,1,1" CornerRadius="0,0,1,1" Background="{DynamicResource WhiteRoundGradient}" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1" ScaleX="1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
</Border>
</Grid>
</Border>
</Border>
<Border Height="{Binding ActualHeight, ElementName=contentPresenter, Mode=OneWay}" Width="{Binding ActualWidth, ElementName=contentPresenter, Mode=OneWay}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" >
<Grid Height="{Binding ActualHeight, ElementName=contentPresenter, Mode=OneWay}" VerticalAlignment="Bottom" Width="{Binding ActualWidth, ElementName=contentPresenter, Mode=OneWay}">
<Rectangle StrokeThickness="5" Stroke="#7FFFFFFF" RadiusX="5" RadiusY="5" Fill="#7FFFFFFF" Margin="-4,3,-4,2">
<Rectangle.Effect>
<BlurEffect Radius="15"/>
</Rectangle.Effect>
</Rectangle>
</Grid>
</Border>
<ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"/>
<Trigger Property="IsKeyboardFocused" Value="true"/>
<Trigger Property="ToggleButton.IsChecked" Value="true"/>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD"/>
</Trigger>
<Trigger Property="IsPressed" Value="True"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Button}" x:Key="MainButtonTransparentStyle">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{DynamicResource BlackBrush}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border x:Name="border" Width="Auto" BorderThickness="1" BorderBrush="{DynamicResource BlackBrush}" SnapsToDevicePixels="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="MouseOverState">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PressedState">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedState">
<EasingDoubleKeyFrame KeyTime="0" Value="0.6"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="Focused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid"/>
<VisualState x:Name="InvalidFocused"/>
<VisualState x:Name="InvalidUnfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid x:Name="grid" Height="Auto">
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Border x:Name="NormalBorder" BorderThickness="1" BorderBrush="{DynamicResource ButtonBorderBrush}">
<Border x:Name="NormalBG" Height="10" VerticalAlignment="Top" MinWidth="40" Background="{DynamicResource ButtonBackgroundBrush}" OpacityMask="{DynamicResource ButtonOpacityMask}" SnapsToDevicePixels="False"/>
</Border>
<Border x:Name="MouseOverState" BorderThickness="1" Visibility="Collapsed" Background="{DynamicResource MouseOverBrush}"/>
<Border x:Name="PressedState" BorderThickness="1" Visibility="Collapsed" Background="{DynamicResource PressedGradientBrush}"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Visibility" TargetName="MouseOverState" Value="Visible"/>
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="true"/>
<Trigger Property="ToggleButton.IsChecked" Value="true"/>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="#ADADAD"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Visibility" TargetName="PressedState" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Button}" x:Key="LeftMenuButtonStyle">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="10,3"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="10,3"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid Width="Auto" x:Name="LayoutRoot" Height="Auto" SnapsToDevicePixels="True" Background="Transparent">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PressedBorder">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="pressedGradient">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="contentPresenter">
<EasingDoubleKeyFrame KeyTime="0" Value="0.6"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="FocusedBorder">
<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualStateGroup.Transitions>
<VisualTransition GeneratedDuration="0:0:0.02"/>
</VisualStateGroup.Transitions>
<VisualState x:Name="Valid"/>
<VisualState x:Name="InvalidFocused"/>
<VisualState x:Name="InvalidUnfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="PressedBorder" BorderBrush="Black" BorderThickness="1" CornerRadius="1,0,0,1" Grid.RowSpan="2" Opacity="0"/>
</Grid>
<Border x:Name="pressedGradient" Grid.RowSpan="1" CornerRadius="2" Height="Auto" BorderThickness="2" Background="{DynamicResource PressedGradientBrush}" Opacity="0"/>
<Border x:Name="FocusedBorder" BorderBrush="{DynamicResource WhiteAlfa30}" BorderThickness="1" CornerRadius="2,0,0,2" Grid.RowSpan="1" Opacity="0"/>
<ContentPresenter x:Name="contentPresenter" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PinToggleButtonStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Grid x:Name="grid" Visibility="Visible">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="MouseOver"/>
<VisualState x:Name="Pressed"/>
<VisualState x:Name="Disabled"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PinIcon">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="UnpinIcon">
<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked"/>
<VisualState x:Name="Indeterminate"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Image x:Name="PinIcon" Source="Images/Pin.png" Width="16" Height="16"/>
<Image x:Name="UnpinIcon" Source="Images/Unpin.png" Width="16" Height="16" Visibility="Collapsed"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- /Buttons -->
<!-- Menu -->
<HierarchicalDataTemplate ItemsSource="{Binding Items}" x:Key="MenuDataTemplate" DataType="my:PowerItem">
<Grid>
<Border Height="{Binding ActualHeight, ElementName=contentPresenter, Mode=OneWay}"
Width="{Binding ActualWidth, ElementName=contentPresenter, Mode=OneWay}"
HorizontalAlignment="Left" Margin="4,0" x:Name="BlurBorder" Visibility="Collapsed">
<Grid Height="{Binding ActualHeight, ElementName=contentPresenter, Mode=OneWay}"
Width="{Binding ActualWidth, ElementName=contentPresenter, Mode=OneWay}"
VerticalAlignment="Bottom">
<Rectangle StrokeThickness="5" Stroke="#7FFFFFFF" RadiusX="5" RadiusY="5" Fill="#7FFFFFFF"
Margin="-4,3,-4,2">
<Rectangle.Effect>
<BlurEffect Radius="15"/>
</Rectangle.Effect>
</Rectangle>
</Grid>
</Border>
<StackPanel Orientation="Horizontal">
<Grid Background="{Binding Icon.Background}" Width="16" Height="16" Margin="{Binding Converter={StaticResource themeApplier}}" >
<Image Source="{Binding Icon.SmallBitmap}" Width="16" Height="16" Stretch="Uniform" x:Name="IconImage"/>
</Grid>
<TextBlock x:Name="contentPresenter" Text="{Binding FriendlyName}" Padding="4,0" Margin="0,0,0,0"
VerticalAlignment="Center"/>
</StackPanel>
</Grid>
<HierarchicalDataTemplate.Triggers>
<DataTrigger Binding="{Binding Parent}" Value="{x:Null}"> <!--i.e. MenuItem Role = "TopLevelHeader"-->
<Setter TargetName="BlurBorder" Property="Visibility" Value="Visible"/>
<Setter TargetName="IconImage" Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</HierarchicalDataTemplate.Triggers>
</HierarchicalDataTemplate>
<Style x:Key="MenuStyle" TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{StaticResource MenuBackground}"/>
<Setter Property="FontFamily" Value="{StaticResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
<Setter Property="FontSize" Value="{StaticResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
<Setter Property="FontStyle" Value="{StaticResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
<Setter Property="FontWeight" Value="{StaticResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Menu}">
<Grid x:Name="grid" Height="Auto" SnapsToDevicePixels="true" Width="Auto">
<Border BorderBrush="{DynamicResource BlackBrush}" BorderThickness="1" CornerRadius="2">
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border BorderThickness="1,1,1,0" CornerRadius="1,1,0,0" Background="{DynamicResource WhiteRoundGradient}"/>
<Border BorderBrush="{DynamicResource WhiteAlfa60}" BorderThickness="1" CornerRadius="2" Grid.RowSpan="2"/>
<Border x:Name="MouseOverBorder" BorderBrush="{DynamicResource WhiteSolidBrush}" BorderThickness="1" CornerRadius="1" Grid.RowSpan="2" Visibility="Collapsed"/>
<Border Grid.RowSpan="1" Background="{DynamicResource WhiteAlfa30}" CornerRadius="1"/>
<Border BorderThickness="1" CornerRadius="1" Background="{DynamicResource WhiteRoundGradient}" Grid.Row="1" RenderTransformOrigin="0.5,0.5">
<Border.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleY="-1" ScaleX="1"/>
<SkewTransform AngleY="0" AngleX="0"/>
<RotateTransform Angle="0"/>
<TranslateTransform/>
</TransformGroup>
</Border.RenderTransform>
</Border>
</Grid>
</Border>
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" d:LayoutOverrides="Width, Height"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="ItemsPanel" Value="{StaticResource ItemsPanelTemplate}"/>
<Setter Property="ItemTemplate" Value="{StaticResource MenuDataTemplate}"/>
</Style>
<Style x:Key="RightMenuStyle" TargetType="{x:Type Menu}">
<Setter Property="Background" Value="{StaticResource MenuBackground}"/>
<Setter Property="FontFamily" Value="{StaticResource {x:Static SystemFonts.MenuFontFamilyKey}}"/>
<Setter Property="FontSize" Value="{StaticResource {x:Static SystemFonts.MenuFontSizeKey}}"/>
<Setter Property="FontStyle" Value="{StaticResource {x:Static SystemFonts.MenuFontStyleKey}}"/>
<Setter Property="FontWeight" Value="{StaticResource {x:Static SystemFonts.MenuFontWeightKey}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Menu}">
<Grid x:Name="grid" Height="Auto" SnapsToDevicePixels="true" Width="Auto">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid"/>
<VisualState x:Name="InvalidFocused"/>
<VisualState x:Name="InvalidUnfocused"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" d:LayoutOverrides="Width, Height"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel" Value="{StaticResource ItemsPanelTemplate}"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
</Style>
<Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="Command" Value="{DynamicResource globalClickCommand}"/>
<Setter Property="CommandParameter" Value="{Binding}"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="MinWidth" Value="{Binding MinWidth}"/>
<Setter Property="ContextMenu" Value="{DynamicResource fsMenuItemsContextMenu}"/>
<Setter Property="Padding" Value="0"/>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding StartMenuOldStyle, RelativeSource={RelativeSource AncestorType=views:BtnStck}}" Value="True"/>
<Condition Binding="{Binding IsMergeableContentHolder}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<StackPanel Orientation="Vertical">
<Separator Style="{StaticResource {x:Static MenuItem.SeparatorStyleKey}}"/>
<ItemsPresenter/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</MultiDataTrigger>
<DataTrigger Binding="{Binding FriendlyName}" Value="{x:Static my:PowerItemTree.SEPARATOR_NAME}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Separator Style="{StaticResource {x:Static MenuItem.SeparatorStyleKey}}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="ContextMenuItemStyle" TargetType="{x:Type MenuItem}">
<Setter Property="Header" Value="{Binding Name, Converter={StaticResource localizer}, Mode=OneWay, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Padding" Value="6,3"/>
</Style>
<!-- /Menu -->
<!-- Checkboxes -->
<Style TargetType="{x:Type CheckBox}" x:Key="CheckBoxStyle">
<Setter Property="Content" Value="{Binding Name, Converter={StaticResource localizer}, Mode=OneWay, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Margin" Value="0,4,0,4"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style TargetType="{x:Type CheckBox}" x:Key="RedCheckBoxStyle" BasedOn="{StaticResource CheckBoxStyle}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsChecked, ElementName=StgSuggestProblems}" Value="true"/>
<Condition Binding="{Binding IsChecked, RelativeSource={x:Static RelativeSource.Self}}" Value="false"/>
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="Crimson"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
<!-- /Checkboxes -->
<!--DataGrid-->
<Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DataGridCell}">
<Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource {x:Static SystemColors.HighlightBrushKey }}"/>
</Trigger>
</Style.Triggers>
</Style>
<!--/DataGrid-->
</ResourceDictionary>