From 5ee0334c5d672f9673107c97af3b526eee07fec3 Mon Sep 17 00:00:00 2001 From: Dmitry Vodich Date: Mon, 15 Jul 2019 15:54:07 +0300 Subject: [PATCH] Fix reopening of Floating windows after they were closed from Unload handler of DockingManager --- .../Controls/LayoutFloatingWindowControl.cs | 4 ++-- source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs index 761565c1..844b1b9f 100644 --- a/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs +++ b/source/Components/Xceed.Wpf.AvalonDock/Controls/LayoutFloatingWindowControl.cs @@ -403,9 +403,9 @@ protected virtual IntPtr FilterMessage( IntPtr hwnd, int msg, IntPtr wParam, Int return IntPtr.Zero; } - internal void InternalClose() + internal void InternalClose(bool closeInitiatedByUser = false) { - _internalCloseFlag = true; + _internalCloseFlag = !closeInitiatedByUser; if( !_isClosing ) { _isClosing = true; diff --git a/source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs b/source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs index 81aed4ea..ffdae9b5 100644 --- a/source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs +++ b/source/Components/Xceed.Wpf.AvalonDock/DockingManager.cs @@ -2425,7 +2425,7 @@ private void DockingManager_Unloaded( object sender, RoutedEventArgs e ) fw.SetParentWindowToNull(); fw.KeepContentVisibleOnClose = true; // To avoid calling Close method multiple times. - fw.InternalClose(); + fw.InternalClose(true); } _fwList.Clear();