Skip to content

Commit

Permalink
ContentDialog restore height resize (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nice3point authored Nov 22, 2023
1 parent e7b1625 commit df28ac0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Wpf.Ui/Controls/ContentDialog/ContentDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,13 @@ protected virtual void OnLoaded()
private Size GetNewDialogSize(Size desiredSize)
{
var paddingWidth = Padding.Left + Padding.Right;
var paddingHeight = Padding.Top + Padding.Bottom;

var marginHeight = DialogMargin.Bottom + DialogMargin.Top;
var marginWidth = DialogMargin.Left + DialogMargin.Right;

var width = desiredSize.Width - marginWidth + paddingWidth;
var height = desiredSize.Height - marginHeight;
var height = desiredSize.Height - marginHeight + paddingHeight;

return new Size(width, height);
}
Expand Down

0 comments on commit df28ac0

Please sign in to comment.