Index: Core/Gui/src/Core.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs =================================================================== diff -u -r657a26806c182f66f35f045b6714f37586936d92 -r66c330d0a99ef95f30fe34b40700bd86d296862b --- Core/Gui/src/Core.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 657a26806c182f66f35f045b6714f37586936d92) +++ Core/Gui/src/Core.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 66c330d0a99ef95f30fe34b40700bd86d296862b) @@ -1,4 +1,4 @@ -// Copyright (C) Stichting Deltares 2021. All rights reserved. +// Copyright (C) Stichting Deltares 2021. All rights reserved. // // This file is part of Riskeer. // @@ -389,11 +389,10 @@ toolViews.Remove(view); } - CleanupHostControl(view); - view.Data = null; - view.Dispose(); + CleanupHostControl(view); + OnViewClosed(view); Application.DoEvents(); // This method is called in order to get rid of problems caused by AvalonDock's latency @@ -414,7 +413,6 @@ { WindowsFormsHost hostControl = hostControls.First(hc => hc.Child == view); - hostControl.Child = null; // Prevent views from getting disposed here by clearing the child hostControl.Dispose(); hostControls.Remove(hostControl);