Skip to content

Commit

Permalink
Merge pull request #46 from DHancock/Dev
Browse files Browse the repository at this point in the history
Don't resize in loaded event
  • Loading branch information
DHancock authored Jan 2, 2024
2 parents 3e1ff84 + 19e3b7d commit b328d24
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions WinUI3Controls/GroupBox/GroupBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b328d24

Please sign in to comment.