-
-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathRadioMenuItem.xaml
More file actions
130 lines (127 loc) · 10.6 KB
/
RadioMenuItem.xaml
File metadata and controls
130 lines (127 loc) · 10.6 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
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:iNKORE.UI.WPF.Modern.Controls"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern">
<ikw:SharedSizeGroupConverter x:Key="SharedSizeGroupConverter" />
<Style TargetType="local:RadioMenuItem">
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemRevealBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemRevealBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutItemRevealBorderThickness}" />
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" />
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePadding}" />
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="Margin" Value="2,1.3,1.5,1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="local:RadioMenuItem">
<ControlTemplate.Resources>
<StreamGeometry x:Key="RadioBullet">M 10 6.25 C 10.514322 6.25 11 6.347656 11.455078 6.542969 C 11.910807 6.738281 12.30957 7.006836 12.651367 7.348633 C 12.993164 7.69043 13.261719 8.089193 13.457031 8.544922 C 13.652344 9 13.75 9.485678 13.75 10 C 13.75 10.520834 13.652344 11.007487 13.457031 11.459961 C 13.261719 11.912436 12.993164 12.30957 12.651367 12.651367 C 12.30957 12.993164 11.910807 13.261719 11.455078 13.457031 C 11 13.652344 10.514322 13.75 10 13.75 C 9.479166 13.75 8.992513 13.652344 8.540039 13.457031 C 8.087564 13.261719 7.69043 12.993164 7.348633 12.651367 C 7.006836 12.30957 6.738281 11.912436 6.542969 11.459961 C 6.347656 11.007487 6.25 10.520834 6.25 10 C 6.25 9.485678 6.347656 9 6.542969 8.544922 C 6.738281 8.089193 7.006836 7.69043 7.348633 7.348633 C 7.69043 7.006836 8.087564 6.738281 8.540039 6.542969 C 8.992513 6.347656 9.479166 6.25 10 6.25 Z</StreamGeometry>
</ControlTemplate.Resources>
<Border
x:Name="LayoutRoot"
Margin="{TemplateBinding Margin}"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{DynamicResource ControlCornerRadius}"
SnapsToDevicePixels="true">
<Grid x:Name="AnimationRoot">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemCheckColumnGroup}" />
<ColumnDefinition Width="Auto" SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemIconColumnGroup}" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:FontIconFallback
x:Name="CheckGlyph"
Width="13"
Margin="0,0,12,0"
Data="{StaticResource RadioBullet}"
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="13"
Foreground="{DynamicResource ToggleMenuFlyoutItemCheckGlyphForeground}"
Opacity="0" />
<Viewbox
x:Name="IconRoot"
Grid.Column="1"
Width="16"
Height="16"
Margin="0,0,12,0"
HorizontalAlignment="Left"
VerticalAlignment="Center">
<ContentPresenter
x:Name="IconContent"
ContentSource="Icon"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Viewbox>
<ContentPresenter
x:Name="ContentPresenter"
Grid.Column="2"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Header"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}" />
<TextBlock
x:Name="KeyboardAcceleratorTextBlock"
Grid.Column="3"
Margin="24,0,2,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
Style="{DynamicResource CaptionTextBlockStyle}"
Text="{TemplateBinding InputGestureText}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Icon" Value="{x:Null}">
<Setter TargetName="IconRoot" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="InputGestureText" Value="">
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckGlyph" Property="Opacity" Value="1" />
</Trigger>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutItemRevealBackgroundPointerOver}" />
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemRevealBorderBrushPointerOver}" />
<Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" />
<Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource ToggleMenuFlyoutItemCheckGlyphForegroundPointerOver}" />
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutItemRevealBackgroundPressed}" />
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemRevealBorderBrushPressed}" />
<Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPressed}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPressed}" />
<Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource ToggleMenuFlyoutItemCheckGlyphForegroundPressed}" />
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundDisabled}" />
<Setter TargetName="LayoutRoot" Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemRevealBorderBrushDisabled}" />
<Setter TargetName="IconContent" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" />
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" />
<Setter TargetName="CheckGlyph" Property="Foreground" Value="{DynamicResource ToggleMenuFlyoutItemCheckGlyphForegroundDisabled}" />
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>