|
1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
3 | | - xmlns:system="clr-namespace:System;assembly=mscorlib" |
4 | 3 | xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters" |
| 4 | + xmlns:system="clr-namespace:System;assembly=mscorlib" |
5 | 5 | xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"> |
6 | 6 | <ResourceDictionary.MergedDictionaries> |
7 | 7 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" /> |
|
39 | 39 | <Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" /> |
40 | 40 | <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" /> |
41 | 41 | <Setter Property="BorderThickness" Value="1" /> |
| 42 | + <Setter Property="Cursor" Value="Hand" /> |
42 | 43 | <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" /> |
43 | 44 | <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground), FallbackValue=Black}" /> |
44 | 45 | <Setter Property="Template"> |
|
75 | 76 | <ColumnDefinition Width="Auto" /> |
76 | 77 | <ColumnDefinition Width="*" /> |
77 | 78 | </Grid.ColumnDefinitions> |
78 | | - <Viewbox Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize)}" |
79 | | - Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize)}" |
80 | | - VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
81 | | - <Canvas Width="24" Height="24"> |
| 79 | + <Viewbox x:Name="IconHost" |
| 80 | + Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize)}" |
| 81 | + Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize)}" |
| 82 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
| 83 | + <Canvas Width="24" |
| 84 | + Height="24" |
| 85 | + Background="Transparent"> |
82 | 86 | <Path x:Name="Graphic" |
83 | 87 | Data="M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z" |
84 | 88 | Fill="{DynamicResource MaterialDesign.Brush.RadioButton.Outline}" /> |
85 | 89 | <Ellipse x:Name="InteractionEllipse" |
86 | 90 | Canvas.Left="12" |
87 | 91 | Canvas.Top="12" |
88 | | - IsHitTestVisible="False" |
89 | 92 | Width="0" |
90 | 93 | Height="0" |
91 | 94 | Fill="{TemplateBinding Foreground}" |
| 95 | + IsHitTestVisible="False" |
92 | 96 | Opacity="0" |
93 | 97 | RenderTransformOrigin="0.5,0.5"> |
94 | 98 | <Ellipse.RenderTransform> |
|
102 | 106 | </Ellipse> |
103 | 107 | </Canvas> |
104 | 108 | </Viewbox> |
| 109 | + |
| 110 | + <!-- halo shown when hovering --> |
| 111 | + <Ellipse x:Name="halo" |
| 112 | + Grid.Column="0" |
| 113 | + Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize), Converter={x:Static converters:MathConverter.MultiplyInstance}, ConverterParameter=1.6}" |
| 114 | + Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(wpf:RadioButtonAssist.RadioButtonSize), Converter={x:Static converters:MathConverter.MultiplyInstance}, ConverterParameter=1.6}" |
| 115 | + HorizontalAlignment="Center" |
| 116 | + VerticalAlignment="Center" |
| 117 | + Fill="{TemplateBinding Foreground}" |
| 118 | + IsHitTestVisible="False" |
| 119 | + Opacity="0" |
| 120 | + RenderTransformOrigin="0.5,0.5" /> |
| 121 | + |
105 | 122 | <ContentPresenter x:Name="contentPresenter" |
106 | 123 | Grid.Column="1" |
107 | 124 | Margin="{TemplateBinding Padding}" |
|
117 | 134 | </EventTrigger> |
118 | 135 | <Trigger Property="HasContent" Value="true"> |
119 | 136 | <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" /> |
120 | | - <Setter Property="Padding" Value="4,2,0,0" /> |
| 137 | + <Setter Property="Padding" Value="0,2,0,0" /> |
121 | 138 | </Trigger> |
122 | 139 | <Trigger Property="IsEnabled" Value="false"> |
123 | 140 | <Setter Property="Opacity" Value="0.26" /> |
|
136 | 153 | <Setter TargetName="Graphic" Property="Fill" Value="{DynamicResource MaterialDesign.Brush.ValidationError}" /> |
137 | 154 | <Setter TargetName="contentPresenter" Property="Control.Foreground" Value="{DynamicResource MaterialDesign.Brush.ValidationError}" /> |
138 | 155 | </Trigger> |
| 156 | + <Trigger SourceName="IconHost" Property="IsMouseOver" Value="True"> |
| 157 | + <Setter TargetName="halo" Property="Opacity" Value="{x:Static wpf:Constants.InteractionHoverOpacity}" /> |
| 158 | + </Trigger> |
139 | 159 | </ControlTemplate.Triggers> |
140 | 160 | </ControlTemplate> |
141 | 161 | </Setter.Value> |
|
213 | 233 | <Ellipse x:Name="InteractionEllipse" |
214 | 234 | Canvas.Left="12" |
215 | 235 | Canvas.Top="12" |
216 | | - IsHitTestVisible="False" |
217 | 236 | Width="0" |
218 | 237 | Height="0" |
219 | 238 | Fill="{TemplateBinding Foreground}" |
| 239 | + IsHitTestVisible="False" |
220 | 240 | Opacity="0" |
221 | 241 | RenderTransformOrigin="0.5,0.5"> |
222 | 242 | <Ellipse.RenderTransform> |
|
0 commit comments