-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApplication.xaml
592 lines (499 loc) · 39.2 KB
/
Application.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
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
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<Application x:Class="Application"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyMusicWPF"
StartupUri="TestWindow.xaml">
<Application.Resources>
<ResourceDictionary >
<Color x:Key="MainColor" A="180" R="229" G="20" B="0"/>
<SolidColorBrush x:Key="MainColorBrush" Color="#FFe51400" />
<local:valueplusoneConverter x:Key="valueplusoneConverter" />
<local:volto100Converter x:Key="volto100Converter" />
<local:volpathVisibility0Converter x:Key="volpathVisibility0Converter" />
<local:volpathopactiy33Converter x:Key="volpathopactiy33Converter" />
<local:volbtntooltipConverter x:Key="volbtntooltipConverter" />
<local:listboxitemcontextmenu x:Key="listboxitemcontextmenu" />
<!-- 滚动条样式-->
<Style TargetType="ScrollBar" >
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollBar">
<Grid x:Name="GridRoot" Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" >
<Grid.RowDefinitions>
<RowDefinition MaxHeight="18" />
<RowDefinition Height="0.00001*" />
<RowDefinition MaxHeight="18" />
</Grid.RowDefinitions>
<Border x:Name="scrollBorder" Opacity="1" BorderBrush="{DynamicResource MainColorBrush }" Margin="0" Grid.RowSpan="3">
<Border.Effect>
<DropShadowEffect Color="{DynamicResource MainColor }" ShadowDepth="0" BlurRadius="2"/>
</Border.Effect>
</Border>
<!--上按钮-->
<RepeatButton x:Name="DecreaseRepeat" Command="ScrollBar.LineUpCommand" BorderBrush="Transparent" >
<RepeatButton.Style>
<Style TargetType="RepeatButton" >
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate>
<Grid Margin="0,0,0,0" Name="Grid" Background="Transparent" Opacity="0.5" >
<Path x:Name="TopArrow" Margin="5,4,5,4" Fill="{DynamicResource MainColorBrush }" Stroke="{DynamicResource MainColorBrush }" Stretch="Fill" StrokeThickness="1" Data="M5.2422477,11.132184 L11.5544,11.132184 8.6412958,4.4969033 z" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.5" To="0.9" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.9" To="0.5" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RepeatButton.Style>
</RepeatButton>
<Track Grid.Row="1" x:Name="PART_Track" IsDirectionReversed="True" >
<Track.DecreaseRepeatButton>
<!--上空白-->
<RepeatButton x:Name="PageDown" Command="ScrollBar.PageUpCommand" Style="{DynamicResource myScrollLongRepeatButtonStyle}"/>
</Track.DecreaseRepeatButton>
<Track.Thumb >
<!--滑块-->
<Thumb MinHeight="30" Style="{DynamicResource myThumb}" />
</Track.Thumb>
<Track.IncreaseRepeatButton>
<!--下空白-->
<RepeatButton x:Name="PageUp" Command="ScrollBar.PageDownCommand" Style="{DynamicResource myScrollLongRepeatButtonStyle}"/>
</Track.IncreaseRepeatButton>
</Track>
<!--下按钮-->
<RepeatButton Grid.Row="2" x:Name="IncreaseRepeat" Command="ScrollBar.LineDownCommand" Background="Transparent" BorderBrush="Transparent">
<RepeatButton.Style>
<Style TargetType="RepeatButton" >
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate>
<Grid Name="Grid" Margin="0,0,0,0" Opacity="0.5" >
<Path x:Name="BottomArrow" Margin="5,4,5,4" VerticalAlignment="Stretch" Height="Auto" Fill="{DynamicResource MainColorBrush }" Stretch="Fill" Stroke="{DynamicResource MainColorBrush }" StrokeThickness="1" Data="M5.2422477,11.132184 L11.5544,11.132184 8.6412958,4.4969033 z" RenderTransformOrigin="0.5,0.5">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform ScaleX="1" ScaleY="1" />
<SkewTransform AngleX="0" AngleY="0" />
<RotateTransform Angle="180" />
<TranslateTransform X="0" Y="0" />
</TransformGroup>
</Path.RenderTransform>
</Path>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.5" To="0.9" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.9" To="0.5" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RepeatButton.Style>
</RepeatButton>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter Property="LayoutTransform" TargetName="GridRoot">
<Setter.Value>
<RotateTransform Angle="-90" />
</Setter.Value>
</Setter>
<Setter TargetName="PART_Track" Property="Orientation" Value="Vertical" />
<Setter Property="Command" Value="ScrollBar.LineLeftCommand" TargetName="DecreaseRepeat" />
<Setter Property="Command" Value="ScrollBar.LineRightCommand" TargetName="IncreaseRepeat" />
<Setter Property="Command" Value="ScrollBar.PageLeftCommand" TargetName="PageDown" />
<Setter Property="Command" Value="ScrollBar.PageRightCommand" TargetName="PageUp" />
</Trigger>
<!--<EventTrigger RoutedEvent="MouseEnter" >
<BeginStoryboard >
<Storyboard >
<DoubleAnimation Storyboard.TargetName="scrollBorder" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave" >
<BeginStoryboard >
<Storyboard >
<DoubleAnimation Storyboard.TargetName="scrollBorder" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>-->
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key ="myScrollLongRepeatButtonStyle" TargetType="{x:Type RepeatButton}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid>
<Rectangle x:Name="myRepeatButton" Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" />
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="myThumb" TargetType="Thumb" >
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate TargetType="Thumb" >
<Grid Margin="0,1,0,1" x:Name="Grid" Opacity="0.4" Background="Transparent" >
<Rectangle x:Name="HoverRectangle" MinHeight="25" Height="Auto" Fill="{DynamicResource MainColorBrush}" RadiusX="3" RadiusY="3" Margin="5,-2,5,-2" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsFocused" Value="True"/>
<Trigger Property="IsMouseOver" Value="true">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.4" To="0.7" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.7" To="0.4" Duration="0:0:0.3" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsEnabled" Value="False"/>
<Trigger Property="IsDragging" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.7" To="0.9" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions >
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="Grid" Storyboard.TargetProperty="Opacity" From="0.9" To="0.7" Duration="0:0:0.2" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- - - - - - -->
<!-- ToolTip提示信息工具 -->
<Style TargetType="ToolTip" >
<Setter Property="Template" >
<Setter.Value>
<ControlTemplate >
<Border >
<Grid Margin="10" Background="Transparent">
<Border Background="White" BorderBrush="{DynamicResource MainColorBrush }" BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="10" Color="{DynamicResource MainColor }" ShadowDepth="0"/>
</Border.Effect>
</Border>
<Border Margin="5">
<ContentPresenter TextBlock.TextAlignment="Justify" Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}" SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--Simple Simple Slider-->
<Style TargetType="{x:Type Slider}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Slider}">
<Grid x:Name="GridRoot" Background="{TemplateBinding Background }">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto" MinHeight="{TemplateBinding MinHeight}"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- TickBar shows the ticks for Slider -->
<TickBar Visibility="Collapsed" x:Name="TopTick" Height="5" SnapsToDevicePixels="True" Placement="Top" Fill="{DynamicResource MainColorBrush }"/>
<!--<Border Grid.Row="1" Margin="0" x:Name="Border" Height="5" Background="White" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>-->
<!-- The Track lays out the repeat buttons and thumb -->
<Track Grid.Row="1" x:Name="PART_Track" IsDirectionReversed="False" >
<Track.DecreaseRepeatButton>
<RepeatButton Command="Slider.DecreaseLarge">
<RepeatButton.Style>
<Style TargetType="{x:Type RepeatButton}">
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid Margin="2">
<Rectangle Height="5" Fill ="{DynamicResource MainColorBrush }" Stroke="{DynamicResource MainColorBrush }" StrokeThickness="1" RadiusX="1" RadiusY="1" >
<Rectangle.Effect>
<DropShadowEffect BlurRadius="7" Color="White" Opacity="0.7" ShadowDepth="0"/>
</Rectangle.Effect>
</Rectangle>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RepeatButton.Style>
</RepeatButton>
</Track.DecreaseRepeatButton>
<Track.Thumb>
<Thumb>
<Thumb.Style >
<Style TargetType="{x:Type Thumb}">
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="Height" Value="15"/>
<Setter Property="Width" Value="15"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Grid>
<Ellipse x:Name="Ellipse" Fill="{DynamicResource MainColorBrush }" Stroke="White" StrokeThickness="0">
<Ellipse.Effect>
<DropShadowEffect Color="Black" Opacity="0.6" BlurRadius="5" ShadowDepth="3"/>
</Ellipse.Effect>
</Ellipse>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Thumb.Style>
</Thumb>
</Track.Thumb>
<Track.IncreaseRepeatButton>
<RepeatButton Command="Slider.IncreaseLarge" >
<RepeatButton.Style>
<Style TargetType="{x:Type RepeatButton}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<Grid Margin="2">
<Rectangle Height="5" Fill ="White" Stroke="White" StrokeThickness="1" RadiusX="1" RadiusY="1" >
<Rectangle.Effect>
<DropShadowEffect BlurRadius="5" Color="White" Opacity="0.5" ShadowDepth="0"/>
</Rectangle.Effect>
</Rectangle>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</RepeatButton.Style>
</RepeatButton>
</Track.IncreaseRepeatButton>
</Track>
<TickBar Visibility="Collapsed" Grid.Row="2" x:Name="BottomTick" Height="4" SnapsToDevicePixels="True" Placement="Bottom" Fill="{TemplateBinding Foreground}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TickPlacement" Value="TopLeft">
<Setter Property="Visibility" Value="Visible" TargetName="TopTick"/>
</Trigger>
<Trigger Property="TickPlacement" Value="BottomRight">
<Setter Property="Visibility" Value="Visible" TargetName="BottomTick"/>
</Trigger>
<Trigger Property="TickPlacement" Value="Both">
<Setter Property="Visibility" Value="Visible" TargetName="TopTick"/>
<Setter Property="Visibility" Value="Visible" TargetName="BottomTick"/>
</Trigger>
<!--<Trigger Property="IsEnabled" Value="false">
<Setter Property="Opacity" Value="0.4" TargetName="Border" />
</Trigger>-->
<!-- Use a rotation to create a Vertical Slider form the default Horizontal -->
<Trigger Property="Orientation" Value="Vertical">
<Setter Property="LayoutTransform" TargetName="GridRoot">
<Setter.Value>
<RotateTransform Angle="-90"/>
</Setter.Value>
</Setter>
<!-- Track rotates itself based on orientation so need to force it back -->
<Setter TargetName="PART_Track" Property="Orientation" Value="Horizontal"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 进度条 Simple SimpleProgressBar
The template uses two Border controls to show the Track and Progress
Limitations : It only supports a horizontal orientated ProgressBar -->
<Style x:Key="SimpleProgressBar" TargetType="{x:Type ProgressBar}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ProgressBar}">
<Grid>
<!-- This Border is the track. It must be named PART_Track -->
<Border x:Name="PART_Track" Background="Black" BorderBrush="#353535" BorderThickness="1" CornerRadius="6"/>
<!-- This Border shows progress. It must be named PART_Indicator for the control to function -->
<Border Background="Transparent" HorizontalAlignment="Left" x:Name="PART_Indicator">
<Grid>
<Rectangle Stroke ="Transparent" StrokeThickness="4" RadiusX="6" RadiusY="6">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1" >
<GradientStop Color="Blue" Offset="1" />
<GradientStop x:Name="gs1" Color="LightBlue" Offset="1"/>
<GradientStop Color="Blue" Offset="0"/>
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
</Border>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type MenuItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type MenuItem}">
<Border x:Name="MainBorder" CornerRadius="1" Height="auto" MinHeight="25" Background="Transparent" >
<Grid >
<!-- The Grid is used to hold together columns for an Icon, Content, Glyph checkmark and Arrow to show the next level
Size sharing is used in Grid so that the Icon, Content, Arrow for each MenuItem align together -->
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup"/>
<ColumnDefinition Width="14" />
</Grid.ColumnDefinitions>
<!-- 图标ContentPresenter to show an Icon if needed -->
<ContentPresenter x:Name="Icon" VerticalAlignment="Center" ContentSource="Icon"/>
<!-- 选择 勾 Glyph is a checkmark if needed for a checkable menu -->
<Grid Visibility="Hidden" Margin="4,0,6,0" x:Name="GlyphPanel" VerticalAlignment="Center">
<Path x:Name="GlyphPanelpath" VerticalAlignment="Center" Fill="{DynamicResource MainColorBrush }" Data="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z" FlowDirection="LeftToRight"/>
</Grid>
<!-- 文本Content for the menu text etc -->
<ContentPresenter Grid.Column="1" VerticalAlignment="Center" TextElement.FontSize="12" Margin="{TemplateBinding Padding}" x:Name="HeaderHost" RecognizesAccessKey="True" ContentSource="Header"/>
<!-- 箭头Arrow drawn path which points to the next level of the menu -->
<Grid Grid.Column="3" Margin="4,0,6,0" x:Name="ArrowPanel" VerticalAlignment="Center">
<Path x:Name="ArrowPanelPath" VerticalAlignment="Center" Fill="{TemplateBinding Foreground}" Data="M0,0 L0,8 L4,4 z"/>
</Grid>
<!-- 子菜单The Popup is the body of the menu which expands down or across depending on the level of the item -->
<Popup x:Name="SubMenuPopup" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PopupAnimation="Fade" Focusable="false" AllowsTransparency="true" VerticalOffset="-3">
<Border>
<Grid x:Name="SubMenu" Margin="5" Background="Transparent" >
<Border x:Name="SubMenuBorder" Background="White" BorderBrush="{DynamicResource MainColorBrush }" BorderThickness="1">
<Border.Effect>
<DropShadowEffect BlurRadius="10" Color="{DynamicResource MainColor }" ShadowDepth="0"/>
</Border.Effect>
</Border>
<!-- StackPanel holds children of the menu. This is set bu IsItemsHost=True -->
<Border Background="White" Margin="4">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Cycle"/>
</Border>
</Grid>
</Border>
</Popup>
</Grid>
</Border>
<!-- These triggers re-configure the four arrangements of MenuItem to show different levels of menu via Role -->
<ControlTemplate.Triggers>
<!-- Role = TopLevelHeader : this is the root menu item in a menu; the Popup expands down -->
<Trigger Property="Role" Value="TopLevelHeader">
<Setter Property="Margin" Value="0,1,0,1"/>
<Setter Property="Padding" Value="6,3,6,3"/>
<Setter Property="Grid.IsSharedSizeScope" Value="true"/>
<Setter Property="Placement" Value="Bottom" TargetName="SubMenuPopup"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>
<!-- Role = TopLevelItem : this is a child menu item from the top level without any child items-->
<Trigger Property="Role" Value="TopLevelItem">
<Setter Property="Margin" Value="0,1,0,1"/>
<Setter Property="Padding" Value="6,3,6,3"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>
<!-- Role = SubMenuHeader : this is a child menu item which does not have children -->
<Trigger Property="Role" Value="SubmenuHeader">
<Setter Property="DockPanel.Dock" Value="Top"/>
<Setter Property="Padding" Value="0,2,0,2"/>
<Setter Property="Grid.IsSharedSizeScope" Value="true"/>
</Trigger>
<!-- Role = SubMenuItem : this is a child menu item which has children-->
<Trigger Property="Role" Value="SubmenuItem">
<Setter Property="DockPanel.Dock" Value="Top"/>
<Setter Property="Padding" Value="0,2,0,2"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="ArrowPanel"/>
</Trigger>
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
<Setter Property="PopupAnimation" Value="None" TargetName="SubMenuPopup"/>
</Trigger>
<!-- If no Icon is present the we collapse the Icon Content -->
<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
</Trigger>
<!-- The GlyphPanel contains the CheckMark -->
<Trigger Property="IsChecked" Value="true">
<Setter Property="Visibility" Value="Visible" TargetName="GlyphPanel"/>
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
</Trigger>
<Trigger Property="AllowsTransparency" SourceName="SubMenuPopup" Value="true">
<Setter Property="Margin" Value="0,0,3,3" TargetName="SubMenu"/>
</Trigger>
<!--<Trigger Property="IsHighlighted" Value="true">
<Setter Property="Background" Value="{DynamicResource MainColorBrush }" TargetName="Border"/>
</Trigger>-->
<Trigger Property="IsMouseOver" SourceName="MainBorder" Value="true">
<Setter Property="Background" Value="{DynamicResource MainColorBrush}" TargetName="MainBorder" />
<Setter Property="Fill" Value="white" TargetName="GlyphPanelpath" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type Button}" >
<Setter Property="ToolTipService.ShowDuration" Value="20000"/>
</Style>
</ResourceDictionary>
<!--<Color x:Key="MainColor" R="255" G="192" B="203"/>
<SolidColorBrush x:Key="MainColorBrush" Color="Pink" />-->
</Application.Resources>
</Application>