mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
fix Checkbox null content behavior, and icon stretch in menu.
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
<MenuItem Header="Menu Item with _Checkbox">
|
||||
<MenuItem.Icon>
|
||||
<CheckBox
|
||||
Padding="0"
|
||||
BorderThickness="0"
|
||||
IsChecked="True"
|
||||
IsHitTestVisible="False" />
|
||||
@@ -115,6 +116,7 @@
|
||||
<MenuItem Header="Menu Item with _Checkbox">
|
||||
<MenuItem.Icon>
|
||||
<CheckBox
|
||||
Padding="0"
|
||||
BorderThickness="0"
|
||||
IsChecked="True"
|
||||
IsHitTestVisible="False" />
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
<Grid
|
||||
Grid.Column="0"
|
||||
Margin="0,2,0,0"
|
||||
Margin="0,0,0,0"
|
||||
VerticalAlignment="Center">
|
||||
<Border
|
||||
x:Name="NormalRectangle"
|
||||
@@ -51,6 +51,8 @@
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
IsVisible="{TemplateBinding Content,
|
||||
Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
RecognizesAccessKey="True"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
|
||||
@@ -132,15 +132,17 @@
|
||||
|
||||
<Viewbox
|
||||
Name="PART_IconPresenter"
|
||||
Width="12"
|
||||
Height="12"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="{DynamicResource MenuItemIconMargin}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
IsVisible="False"
|
||||
Stretch="UniformToFill"
|
||||
StretchDirection="DownOnly">
|
||||
<ContentPresenter Content="{TemplateBinding Icon}" />
|
||||
Stretch="Uniform">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Content="{TemplateBinding Icon}" />
|
||||
</Viewbox>
|
||||
|
||||
<ContentPresenter
|
||||
|
||||
Reference in New Issue
Block a user