void DialogueIsLoaded(object a, RoutedEventArgs e) { Height = mainStackPanel.ActualHeight + BtnStackPanel.ActualHeight; var parentHeight = _dialogCoordinator.GetMetroWindowHeight(_viewModel); if (parentHeight > 0) { MaxHeight = Math.Max(parentHeight * .75, 400); DialogSettings.MaximumBodyHeight = Math.Max(Height * .75, 400); } else { DialogSettings.MaximumBodyHeight = Height; } MinHeight = Height > MaxHeight ? MaxHeight : Height; mainStackPanel.Height = Height; DateRangeDialogView.BeginInvoke(() => BtnStackPanel.MoveFocus(new TraversalRequest(FocusNavigationDirection.Next))); }