Browse Source

Background is only applicable to the Border#border.

Added Foreground, VerticalContentAlignment and HorizontalContentAlignment for ContentPresenter#PART_ContentPresenter.
pull/1874/head
William David Cossey 8 years ago
parent
commit
2b2255b1c8
  1. 10
      src/Avalonia.Themes.Default/CheckBox.xaml

10
src/Avalonia.Themes.Default/CheckBox.xaml

@ -1,12 +1,16 @@
<Styles xmlns="https://github.com/avaloniaui">
<Style Selector="CheckBox">
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}"/>
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Template">
<ControlTemplate>
<Grid ColumnDefinitions="Auto,*" Background="{TemplateBinding Background}">
<Grid ColumnDefinitions="Auto,*">
<Border Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Width="18"
@ -31,10 +35,12 @@
</Panel>
</Border>
<ContentPresenter Name="PART_ContentPresenter"
TextBlock.Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
Margin="4,0,0,0"
VerticalAlignment="Center"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Grid.Column="1"/>
</Grid>
</ControlTemplate>

Loading…
Cancel
Save