private void RestoreMaximizedWindow()
{
if (windowState != WindowState.Normal)
{
if (maximizeButton != null && restoreButton != null && HostPanel != null)
{
if (this.ShowMaximizeButton)
maximizeButton.SetVisible(true);
if (this.ShowRestoreButton)
restoreButton.SetVisible(false);
VisualStateManager.GoToState(maximizeButton, VSMSTATE_StateNormal, true);
}
// Restore the outer border
if (contentBorder != null)
{
contentBorder.BorderThickness = contentBorderThickness;
contentBorder.CornerRadius = contentBorderCornerRadius;
}
Border border = chrome as Border;
if (border != null)
border.CornerRadius = chromeBorderCornerRadius;
StartRestoringAnimation();
windowState = WindowState.Normal;
}
else
{
Show(Position);
}
}