diff --git a/source/Components/AvalonDock/Controls/LayoutFloatingWindowControl.cs b/source/Components/AvalonDock/Controls/LayoutFloatingWindowControl.cs index 71d0602e..ce134df3 100644 --- a/source/Components/AvalonDock/Controls/LayoutFloatingWindowControl.cs +++ b/source/Components/AvalonDock/Controls/LayoutFloatingWindowControl.cs @@ -536,6 +536,26 @@ protected override void OnInitialized(EventArgs e) base.OnInitialized(e); } + protected override void OnClosing(CancelEventArgs e) + { + base.OnClosing(e); + AssureOwnerIsNotMinimized(); + } + + /// + /// Prevents a known bug in WPF, which wronlgy minimizes the parent window, when closing this control + /// + private void AssureOwnerIsNotMinimized() + { + try + { + Owner?.Activate(); + } + catch (Exception) + { + } + } + #endregion Overrides #region Private Methods