Fixed CheckBox Mark Size calculated Bug

This commit is contained in:
polarboy 2024-09-28 14:41:18 +08:00
parent d0f71b4cc5
commit aeca918ce5
3 changed files with 9 additions and 3 deletions

View File

@ -130,7 +130,6 @@ internal class CheckBoxIndicator : Control, IWaveAdornerInfoProvider
public override void ApplyTemplate()
{
base.ApplyTemplate();
SetupIndicatorCheckedMarkEffectSize();
Transitions ??= new Transitions
{
AnimationUtils.CreateTransition<SolidColorBrushTransition>(BackgroundProperty),
@ -177,6 +176,12 @@ internal class CheckBoxIndicator : Control, IWaveAdornerInfoProvider
WaveSpiritAdorner.ShowWaveAdorner(this, WaveType.RoundRectWave);
}
}
if (e.Property == SizeProperty)
{
CollectStyleState();
SetupIndicatorCheckedMarkEffectSize();
}
}
private void SetupIndicatorCheckedMarkEffectSize()

View File

@ -46,6 +46,7 @@ internal class CheckBoxTheme : BaseControlTheme
{
Name = IndicatorPart
};
CreateTemplateParentBinding(indicator, CheckBoxIndicator.IsEnabledProperty, CheckBox.IsEnabledProperty);
CreateTemplateParentBinding(indicator, CheckBoxIndicator.IsCheckedProperty, CheckBox.IsCheckedProperty);
layout.Children.Add(indicator);

View File

@ -47,8 +47,8 @@ internal class RadioButtonTheme : BaseControlTheme
{
Name = IndicatorPart
};
CreateTemplateParentBinding(indicator, CheckBoxIndicator.IsCheckedProperty, RadioButton.IsCheckedProperty);
CreateTemplateParentBinding(indicator, RadioIndicator.IsEnabledProperty, RadioButton.IsEnabledProperty);
CreateTemplateParentBinding(indicator, RadioIndicator.IsCheckedProperty, RadioButton.IsCheckedProperty);
layout.Children.Add(indicator);
var contentPresenter = new ContentPresenter()