diff --git a/WinUI3Controls/GroupBox/GroupBox.cs b/WinUI3Controls/GroupBox/GroupBox.cs index f562a29..9d2de95 100644 --- a/WinUI3Controls/GroupBox/GroupBox.cs +++ b/WinUI3Controls/GroupBox/GroupBox.cs @@ -37,16 +37,14 @@ protected override void OnApplyTemplate() RegisterPropertyChangedCallback(CornerRadiusProperty, (s, d) => ((GroupBox)s).BorderPropertyChanged()); RegisterPropertyChangedCallback(BorderThicknessProperty, (s, d) => ((GroupBox)s).BorderPropertyChanged()); - HeadingPresenter.SizeChanged += (s, e) => - { - if (IsLoaded) - BorderPropertyChanged(); - }; + HeadingPresenter.SizeChanged += (s, e) => BorderPropertyChanged(); SizeChanged += (s, e) => ((GroupBox)s).RedrawBorder(); + Loaded += (s, e) => ((GroupBox)s).RedrawBorder(); + // initialise - Loaded += (s, e) => BorderPropertyChanged(); + BorderPropertyChanged(); } private void RedrawBorder()