Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml =================================================================== diff -u -r6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a -re783c11dba00e2ade7edfa1d9f49d9319b1b94eb --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml (.../AvalonDockViewHost.xaml) (revision 6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml (.../AvalonDockViewHost.xaml) (revision e783c11dba00e2ade7edfa1d9f49d9319b1b94eb) @@ -60,7 +60,7 @@ - + @@ -69,7 +69,7 @@ - + Index: Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs =================================================================== diff -u -r6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a -re783c11dba00e2ade7edfa1d9f49d9319b1b94eb --- Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision 6ecd02f5f7c642d5624f1e52f528c51b1bf5ab3a) +++ Core/Common/src/Core.Common.Gui/Forms/ViewHost/AvalonDockViewHost.xaml.cs (.../AvalonDockViewHost.xaml.cs) (revision e783c11dba00e2ade7edfa1d9f49d9319b1b94eb) @@ -171,7 +171,7 @@ SetFocusToView(view); layoutAnchorable.Hiding += OnLayoutAnchorableHiding; - layoutAnchorable.Closing += OnLayoutAnchorableClosing; + layoutAnchorable.Closed += OnLayoutAnchorableClosed; } public void Remove(IView view) @@ -195,7 +195,7 @@ else if (toolViews.Contains(view)) { var layoutAnchorable = GetLayoutContent(view); - layoutAnchorable.Hide(); + layoutAnchorable.Close(); UpdateDockingManager(); } @@ -308,7 +308,7 @@ private void OnLayoutDocumentClosing(object sender, CancelEventArgs e) { - var layoutDocument = (LayoutDocument)sender; + var layoutDocument = (LayoutDocument) sender; var view = GetView(layoutDocument.Content); if (ActiveDocumentView == view) @@ -320,36 +320,35 @@ } } - private void OnLayoutAnchorableHiding(object sender, CancelEventArgs eventArgs) + private void OnLayoutDocumentClosed(object sender, EventArgs e) { - var layoutAnchorable = (LayoutAnchorable)sender; + var layoutDocument = (LayoutDocument) sender; - layoutAnchorable.Hiding -= OnLayoutAnchorableHiding; - layoutAnchorable.Closing -= OnLayoutAnchorableClosing; + layoutDocument.Closing -= OnLayoutDocumentClosing; + layoutDocument.Closed -= OnLayoutDocumentClosed; + OnViewClosed(GetView(layoutDocument.Content)); + } + + private static void OnLayoutAnchorableHiding(object sender, CancelEventArgs eventArgs) + { + var layoutAnchorable = (LayoutAnchorable) sender; + layoutAnchorable.Close(); - OnViewClosed(GetView(layoutAnchorable.Content)); eventArgs.Cancel = true; } - private void OnLayoutDocumentClosed(object sender, EventArgs e) + private void OnLayoutAnchorableClosed(object sender, EventArgs e) { - var layoutDocument = (LayoutDocument)sender; + var layoutAnchorable = (LayoutAnchorable) sender; - layoutDocument.Closing -= OnLayoutDocumentClosing; - layoutDocument.Closed -= OnLayoutDocumentClosed; + layoutAnchorable.Hiding -= OnLayoutAnchorableHiding; + layoutAnchorable.Closed -= OnLayoutAnchorableClosed; - OnViewClosed(GetView(layoutDocument.Content)); + OnViewClosed(GetView(layoutAnchorable.Content)); } - private void OnLayoutAnchorableClosing(object sender, CancelEventArgs e) - { - var layoutAnchorable = (LayoutAnchorable)sender; - layoutAnchorable.Hide(); - e.Cancel = true; - } - private void OnViewClosed(IView view) { if (documentViews.Contains(view)) @@ -404,7 +403,7 @@ private void AddLayoutAnchorable(LayoutAnchorable layoutAnchorable, ToolViewLocation toolViewLocation) { - LayoutAnchorablePaneGroup layoutAnchorablePaneGroup = null; + LayoutAnchorablePaneGroup layoutAnchorablePaneGroup; switch (toolViewLocation) { case ToolViewLocation.Left: @@ -432,7 +431,7 @@ layoutAnchorablePaneGroup = rightLayoutAnchorablePaneGroup; break; default: - throw new InvalidEnumArgumentException("toolViewLocation", (int)toolViewLocation, typeof(ToolViewLocation)); + throw new InvalidEnumArgumentException("toolViewLocation", (int) toolViewLocation, typeof(ToolViewLocation)); } layoutAnchorablePaneGroup.Descendents()