feat: enhancement.
This commit is contained in:
parent
92c13081f3
commit
e4497df65d
@ -2,17 +2,27 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||||
|
<StackPanel Background="{DynamicResource SemiBackground0Color}">
|
||||||
|
<CheckBox>Hello</CheckBox>
|
||||||
|
<CheckBox>Hello</CheckBox>
|
||||||
|
<CheckBox Theme="{DynamicResource CardCheckBox}">Hello</CheckBox>
|
||||||
|
<CheckBox Theme="{DynamicResource PureCardCheckBox}">Hello</CheckBox>
|
||||||
|
</StackPanel>
|
||||||
|
</ThemeVariantScope>
|
||||||
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
|
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="CheckBox">
|
<ControlTemplate TargetType="CheckBox">
|
||||||
<Border
|
<Border
|
||||||
@ -50,8 +60,8 @@
|
|||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
RecognizesAccessKey="True"
|
|
||||||
FontSize="{TemplateBinding FontSize}"
|
FontSize="{TemplateBinding FontSize}"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
@ -175,14 +185,14 @@
|
|||||||
<ControlTheme x:Key="SimpleCheckBox" TargetType="CheckBox">
|
<ControlTheme x:Key="SimpleCheckBox" TargetType="CheckBox">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CheckBoxDefaultBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxDefaultBorderBrush}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxBoxCornerRadius}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="CheckBox">
|
<ControlTemplate TargetType="CheckBox">
|
||||||
<Border
|
<Border
|
||||||
@ -322,27 +332,31 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="CardCheckBox" TargetType="CheckBox">
|
<ControlTheme x:Key="CardCheckBox" TargetType="CheckBox">
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
||||||
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="CheckBox">
|
<ControlTemplate TargetType="CheckBox">
|
||||||
<Border
|
<Border
|
||||||
Name="RootBorder"
|
x:Name="RootBorder"
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}">
|
CornerRadius="{TemplateBinding CornerRadius}">
|
||||||
<Grid
|
<Grid
|
||||||
x:Name="RootGrid"
|
|
||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
ColumnDefinitions="Auto,*">
|
ColumnDefinitions="Auto,*">
|
||||||
<Grid Grid.Column="0" VerticalAlignment="Top">
|
<Panel
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Margin="{DynamicResource CheckBoxBoxMargin}">
|
||||||
<Border
|
<Border
|
||||||
x:Name="NormalRectangle"
|
x:Name="NormalRectangle"
|
||||||
Width="{DynamicResource CheckBoxBoxWidth}"
|
Width="{DynamicResource CheckBoxBoxWidth}"
|
||||||
@ -353,21 +367,23 @@
|
|||||||
CornerRadius="{DynamicResource CheckBoxBoxCornerRadius}"
|
CornerRadius="{DynamicResource CheckBoxBoxCornerRadius}"
|
||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False" />
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Name="CheckGlyph"
|
x:Name="CheckGlyph"
|
||||||
Width="{DynamicResource CheckBoxBoxGlyphWidth}"
|
Width="{DynamicResource CheckBoxBoxGlyphWidth}"
|
||||||
Height="{DynamicResource CheckBoxBoxGlyphHeight}"
|
Height="{DynamicResource CheckBoxBoxGlyphHeight}"
|
||||||
Foreground="{DynamicResource CheckBoxGlyphFill}" />
|
Foreground="{DynamicResource CheckBoxGlyphFill}" />
|
||||||
|
</Panel>
|
||||||
|
|
||||||
</Grid>
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
x:Name="ContentPresenter"
|
x:Name="PART_ContentPresenter"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
Margin="8,0,0,0"
|
Margin="{DynamicResource CheckBoxContentMargin}"
|
||||||
VerticalAlignment="Center"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
IsVisible="{TemplateBinding Content,
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Converter={x:Static ObjectConverters.IsNotNull}}"
|
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
|
FontSize="{TemplateBinding FontSize}"
|
||||||
RecognizesAccessKey="True"
|
RecognizesAccessKey="True"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
@ -397,7 +413,7 @@
|
|||||||
|
|
||||||
<!-- Unchecked Disabled state -->
|
<!-- Unchecked Disabled state -->
|
||||||
<Style Selector="^:disabled">
|
<Style Selector="^:disabled">
|
||||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||||
@ -448,7 +464,7 @@
|
|||||||
<Style Selector="^ /template/ Border#RootBorder">
|
<Style Selector="^ /template/ Border#RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||||
@ -503,7 +519,7 @@
|
|||||||
<Style Selector="^ /template/ Border#RootBorder">
|
<Style Selector="^ /template/ Border#RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCardCheckedDisabledBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CheckBoxDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Border#NormalRectangle">
|
<Style Selector="^ /template/ Border#NormalRectangle">
|
||||||
@ -519,20 +535,22 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="PureCardCheckBox" TargetType="CheckBox">
|
<ControlTheme x:Key="PureCardCheckBox" TargetType="CheckBox">
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
|
||||||
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource CheckBoxCardPadding}" />
|
||||||
|
<Setter Property="FontSize" Value="{DynamicResource CheckBoxFontSize}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource CheckBoxCardCornerRadius}" />
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
|
<Setter Property="BorderThickness" Value="{DynamicResource CheckBoxCardBorderThickness}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="CheckBox">
|
<ControlTemplate TargetType="CheckBox">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
x:Name="PART_ContentPresenter"
|
x:Name="PART_ContentPresenter"
|
||||||
Margin="{TemplateBinding Margin}"
|
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
@ -540,7 +558,8 @@
|
|||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
RecognizesAccessKey="True"
|
RecognizesAccessKey="True"
|
||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
|
|
||||||
|
@ -3,31 +3,27 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
<Design.PreviewWith>
|
<Design.PreviewWith>
|
||||||
<StackPanel Margin="20">
|
<ThemeVariantScope RequestedThemeVariant="Dark">
|
||||||
<RadioButton>Hello Button2</RadioButton>
|
<StackPanel Background="{DynamicResource SemiBackground0Color}">
|
||||||
<RadioButton>Hello Button3</RadioButton>
|
<RadioButton>Hello</RadioButton>
|
||||||
<Border Theme="{StaticResource RadioButtonGroupBorder}">
|
<RadioButton>Hello</RadioButton>
|
||||||
<StackPanel Orientation="Horizontal">
|
<RadioButton Theme="{DynamicResource CardRadioButton}">Hello</RadioButton>
|
||||||
<RadioButton Theme="{StaticResource ButtonRadioButton}">Hello Button2</RadioButton>
|
<RadioButton Theme="{DynamicResource PureCardRadioButton}">Hello</RadioButton>
|
||||||
<RadioButton Theme="{StaticResource ButtonRadioButton}">Hello Button3</RadioButton>
|
</StackPanel>
|
||||||
</StackPanel>
|
</ThemeVariantScope>
|
||||||
</Border>
|
|
||||||
<RadioButton Theme="{StaticResource PureCardRadioButton}">Hello Button3</RadioButton>
|
|
||||||
<RadioButton Theme="{StaticResource PureCardRadioButton}">Hello Button3</RadioButton>
|
|
||||||
</StackPanel>
|
|
||||||
</Design.PreviewWith>
|
</Design.PreviewWith>
|
||||||
<!-- Theme: Default, Button, Card, PureCard -->
|
<!-- Theme: Default, Button, Card, PureCard -->
|
||||||
<ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton">
|
<ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalAlignment" Value="Top" />
|
<Setter Property="VerticalAlignment" Value="Top" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonBoxCornerRadius}" />
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource RadioButtonDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource RadioButtonDefaultBackground}" />
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonDefaultBorderBrush}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonDefaultBorderBrush}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonBoxCornerRadius}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="RadioButton">
|
||||||
<Border
|
<Border
|
||||||
@ -68,8 +64,8 @@
|
|||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
RecognizesAccessKey="True"
|
|
||||||
FontSize="{TemplateBinding FontSize}"
|
FontSize="{TemplateBinding FontSize}"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
TextWrapping="Wrap" />
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
@ -159,14 +155,14 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="ButtonRadioButton" TargetType="RadioButton">
|
<ControlTheme x:Key="ButtonRadioButton" TargetType="RadioButton">
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonButtonCornerRadius}" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
|
<Setter Property="Padding" Value="{DynamicResource RadioButtonButtonDefaultPadding}" />
|
||||||
<Setter Property="Margin" Value="2" />
|
<Setter Property="Margin" Value="2" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="FontWeight" Value="{DynamicResource RadioButtonButtonFontWeight}" />
|
<Setter Property="FontWeight" Value="{DynamicResource RadioButtonButtonFontWeight}" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource RadioButtonButtonDefaultFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource RadioButtonButtonDefaultFontSize}" />
|
||||||
<Setter Property="Padding" Value="{DynamicResource RadioButtonButtonDefaultPadding}" />
|
|
||||||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonUncheckedForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource RadioButtonButtonUncheckedForeground}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonButtonCornerRadius}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="RadioButton">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
@ -214,21 +210,18 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="CardRadioButton" TargetType="RadioButton">
|
<ControlTheme x:Key="CardRadioButton" TargetType="RadioButton">
|
||||||
<Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
|
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
|
||||||
<Setter Property="VerticalAlignment" Value="Center" />
|
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
|
<Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
|
||||||
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
|
||||||
|
<Setter Property="BorderThickness" Value="{DynamicResource RadioButtonBorderThickness}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="RadioButton">
|
||||||
<Border
|
<Border
|
||||||
Name="RootBorder"
|
x:Name="RootBorder"
|
||||||
Margin="{TemplateBinding Margin}"
|
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
@ -238,9 +231,12 @@
|
|||||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
ColumnDefinitions="Auto,*">
|
ColumnDefinitions="Auto,*">
|
||||||
<Grid Margin="{DynamicResource RadioButtonIconMargin}" VerticalAlignment="Top">
|
<Panel
|
||||||
|
Grid.Column="0"
|
||||||
|
VerticalAlignment="Top"
|
||||||
|
Margin="{DynamicResource RadioButtonIconMargin}">
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Name="OuterEllipse"
|
x:Name="OuterEllipse"
|
||||||
Width="{DynamicResource RadioButtonIconRadius}"
|
Width="{DynamicResource RadioButtonIconRadius}"
|
||||||
Height="{DynamicResource RadioButtonIconRadius}"
|
Height="{DynamicResource RadioButtonIconRadius}"
|
||||||
Fill="{DynamicResource RadioButtonUncheckIconDefaultBackground}"
|
Fill="{DynamicResource RadioButtonUncheckIconDefaultBackground}"
|
||||||
@ -249,26 +245,27 @@
|
|||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False" />
|
||||||
|
|
||||||
<Ellipse
|
<Ellipse
|
||||||
Name="CheckGlyph"
|
x:Name="CheckGlyph"
|
||||||
Width="{DynamicResource RadioButtonGlyphRadius}"
|
Width="{DynamicResource RadioButtonGlyphRadius}"
|
||||||
Height="{DynamicResource RadioButtonGlyphRadius}"
|
Height="{DynamicResource RadioButtonGlyphRadius}"
|
||||||
Fill="{DynamicResource RadioButtonCheckGlyphFill}"
|
Fill="{DynamicResource RadioButtonCheckGlyphFill}"
|
||||||
Opacity="0"
|
|
||||||
Stroke="{DynamicResource RadioButtonCheckGlyphFill}"
|
Stroke="{DynamicResource RadioButtonCheckGlyphFill}"
|
||||||
StrokeThickness="0"
|
|
||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False" />
|
||||||
</Grid>
|
</Panel>
|
||||||
|
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
Name="PART_ContentPresenter"
|
x:Name="PART_ContentPresenter"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
Margin="{DynamicResource RadioButtonContentMargin}"
|
||||||
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
Content="{TemplateBinding Content}"
|
Content="{TemplateBinding Content}"
|
||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
|
IsVisible="{TemplateBinding Content,Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||||
RecognizesAccessKey="True"
|
RecognizesAccessKey="True"
|
||||||
TextElement.FontSize="{DynamicResource RadioButtonFontSize}"
|
FontSize="{TemplateBinding FontSize}"
|
||||||
TextElement.Foreground="{DynamicResource RadioButtonForeground}" />
|
TextWrapping="Wrap" />
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
@ -290,9 +287,6 @@
|
|||||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPointeroverBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="0" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Unchecked Pressed State -->
|
<!-- Unchecked Pressed State -->
|
||||||
@ -301,9 +295,6 @@
|
|||||||
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
<Style Selector="^ /template/ Ellipse#OuterEllipse">
|
||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconPressedBorderBrush}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="0" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Unchecked Disabled state -->
|
<!-- Unchecked Disabled state -->
|
||||||
@ -312,9 +303,6 @@
|
|||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonUncheckIconDisabledBorderBrush}" />
|
||||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDisabledBackground}" />
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonUncheckIconDisabledBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="0" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource RadioButtonDisabledForeground}" />
|
||||||
</Style>
|
</Style>
|
||||||
@ -344,9 +332,6 @@
|
|||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPointeroverBorderBrush}" />
|
||||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPointeroverBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Checked Pressed State -->
|
<!-- Checked Pressed State -->
|
||||||
@ -356,9 +341,6 @@
|
|||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconPressedBorderBrush}" />
|
||||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconPressedBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="1" />
|
|
||||||
</Style>
|
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<!-- Checked Disabled State -->
|
<!-- Checked Disabled State -->
|
||||||
@ -367,9 +349,6 @@
|
|||||||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
|
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckIconDisabledBorderBrush}" />
|
||||||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
|
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style Selector="^ /template/ Ellipse#CheckGlyph">
|
|
||||||
<Setter Property="Opacity" Value="1" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="^ /template/ Border#RootBorder">
|
<Style Selector="^ /template/ Border#RootBorder">
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
|
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonCheckIconDisabledBackground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
|
<Setter Property="Background" Value="{DynamicResource RadioButtonCardCheckedBackground}" />
|
||||||
@ -382,21 +361,22 @@
|
|||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
|
|
||||||
<ControlTheme x:Key="PureCardRadioButton" TargetType="RadioButton">
|
<ControlTheme x:Key="PureCardRadioButton" TargetType="RadioButton">
|
||||||
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
|
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||||
<Setter Property="BorderThickness" Value="1" />
|
|
||||||
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
|
||||||
<Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
|
<Setter Property="Padding" Value="{DynamicResource RadioButtonCardPadding}" />
|
||||||
|
<Setter Property="FontSize" Value="{DynamicResource RadioButtonFontSize}" />
|
||||||
|
<Setter Property="CornerRadius" Value="{DynamicResource RadioButtonCardCornerRadius}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
|
<Setter Property="Background" Value="{DynamicResource RadioButtonCardDefaultBackground}" />
|
||||||
|
<Setter Property="BorderThickness" Value="{DynamicResource RadioButtonBorderThickness}" />
|
||||||
|
<Setter Property="Cursor" Value="Hand" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<ControlTemplate TargetType="RadioButton">
|
<ControlTemplate TargetType="RadioButton">
|
||||||
<ContentPresenter
|
<ContentPresenter
|
||||||
x:Name="PART_ContentPresenter"
|
x:Name="PART_ContentPresenter"
|
||||||
Margin="{TemplateBinding Margin}"
|
|
||||||
Padding="{TemplateBinding Padding}"
|
Padding="{TemplateBinding Padding}"
|
||||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
@ -404,7 +384,8 @@
|
|||||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}"
|
CornerRadius="{TemplateBinding CornerRadius}"
|
||||||
RecognizesAccessKey="True"
|
RecognizesAccessKey="True"
|
||||||
UseLayoutRounding="False" />
|
UseLayoutRounding="False"
|
||||||
|
TextWrapping="Wrap" />
|
||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
</Setter>
|
</Setter>
|
||||||
<Style Selector="^:unchecked">
|
<Style Selector="^:unchecked">
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
<x:Double x:Key="CheckBoxFontSize">14</x:Double>
|
<x:Double x:Key="CheckBoxFontSize">14</x:Double>
|
||||||
<x:Double x:Key="CheckBoxBoxWidth">16</x:Double>
|
<x:Double x:Key="CheckBoxBoxWidth">16</x:Double>
|
||||||
<x:Double x:Key="CheckBoxBoxHeight">16</x:Double>
|
<x:Double x:Key="CheckBoxBoxHeight">16</x:Double>
|
||||||
|
<Thickness x:Key="CheckBoxBoxMargin">0 2 0 0</Thickness>
|
||||||
<Thickness x:Key="CheckBoxContentMargin">8 0 0 0</Thickness>
|
<Thickness x:Key="CheckBoxContentMargin">8 0 0 0</Thickness>
|
||||||
|
|
||||||
<x:Double x:Key="CheckBoxBoxGlyphWidth">10</x:Double>
|
<x:Double x:Key="CheckBoxBoxGlyphWidth">10</x:Double>
|
||||||
@ -14,6 +15,6 @@
|
|||||||
<StreamGeometry x:Key="CheckBoxIndeterminateGlyph">M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716 19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z</StreamGeometry>
|
<StreamGeometry x:Key="CheckBoxIndeterminateGlyph">M5 12.5C5 11.6716 5.67157 11 6.5 11H17.5C18.3284 11 19 11.6716 19 12.5C19 13.3284 18.3284 14 17.5 14H6.5C5.67157 14 5 13.3284 5 12.5Z</StreamGeometry>
|
||||||
|
|
||||||
<Thickness x:Key="CheckBoxCardBorderThickness">1</Thickness>
|
<Thickness x:Key="CheckBoxCardBorderThickness">1</Thickness>
|
||||||
<Thickness x:Key="CheckBoxCardPadding">16</Thickness>
|
<Thickness x:Key="CheckBoxCardPadding">16 12</Thickness>
|
||||||
<CornerRadius x:Key="CheckBoxCardCornerRadius">3</CornerRadius>
|
<CornerRadius x:Key="CheckBoxCardCornerRadius">3</CornerRadius>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
@ -3,7 +3,7 @@
|
|||||||
<x:Double x:Key="RadioButtonIconRadius">16</x:Double>
|
<x:Double x:Key="RadioButtonIconRadius">16</x:Double>
|
||||||
<x:Double x:Key="RadioButtonGlyphRadius">6</x:Double>
|
<x:Double x:Key="RadioButtonGlyphRadius">6</x:Double>
|
||||||
<x:Double x:Key="RadioButtonFontSize">14</x:Double>
|
<x:Double x:Key="RadioButtonFontSize">14</x:Double>
|
||||||
<Thickness x:Key="RadioButtonIconMargin">0 2 8 0</Thickness>
|
<Thickness x:Key="RadioButtonIconMargin">0 2 0 0</Thickness>
|
||||||
|
|
||||||
<x:Double x:Key="RadioButtonUncheckIconDefaultThickness">1</x:Double>
|
<x:Double x:Key="RadioButtonUncheckIconDefaultThickness">1</x:Double>
|
||||||
<Thickness x:Key="RadioButtonContentMargin">8 0 0 0</Thickness>
|
<Thickness x:Key="RadioButtonContentMargin">8 0 0 0</Thickness>
|
||||||
@ -24,6 +24,7 @@
|
|||||||
<x:Double x:Key="RadioButtonButtonLargeFontSize">14</x:Double>
|
<x:Double x:Key="RadioButtonButtonLargeFontSize">14</x:Double>
|
||||||
|
|
||||||
<!-- CardRadioButton -->
|
<!-- CardRadioButton -->
|
||||||
|
<Thickness x:Key="RadioButtonBorderThickness">1</Thickness>
|
||||||
<Thickness x:Key="RadioButtonCardPadding">16 12</Thickness>
|
<Thickness x:Key="RadioButtonCardPadding">16 12</Thickness>
|
||||||
<CornerRadius x:Key="RadioButtonCardCornerRadius">3</CornerRadius>
|
<CornerRadius x:Key="RadioButtonCardCornerRadius">3</CornerRadius>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
Loading…
x
Reference in New Issue
Block a user