Quantcast
Channel: AvalonDock
Viewing all articles
Browse latest Browse all 2690

Commented Issue: Exception at DockingManager unload time [AssemblyVersion("2.0.1771")] [15962]

$
0
0
By advance, excuse-me because I'm a new user of CodePlex (so I don't know how to report an issue), and because I'm... French, so my english can be bad very often !! YeWell, here's the issue:
When a DockingManager is created but is never visible (for example in a TabItem of a TabControl), _autoHideWindowManager member stays null. But when this DockingManager is unloader, the event handler DockingManager_Unloaded is called and there is an exception on "_autoHideWindowManager.HideAutoWindow();" line since _autoHideWindowManager is null.

I think that this code :
if (_autoHideWindowManager != null)
{
_autoHideWindowManager.HideAutoWindow();
}
should be better to manage this case (DockingManager never visible before to be unloaded)
Comments: ** Comment from web user: rickSaw **

So I gave my vote, but did we ever get a work around for this issue?

I have the same issue as the original, my dockingManager is in a tab control. I tried the null reference check but was still given the NullReferenceException.

```
void DockingManager_Unloaded(object sender, RoutedEventArgs e)
{
if (!DesignerProperties.GetIsInDesignMode(this))
{
if (_autoHideWindowManager != null)
{
_autoHideWindowManager.HideAutoWindow();
}

foreach (var fw in _fwList.ToArray())
{
//fw.Owner = null;
fw.SetParentWindowToNull();
fw.KeepContentVisibleOnClose = true;
fw.Close();
}

DestroyOverlayWindow();
FocusElementManager.FinalizeFocusManagement(this);
}
}
```


Viewing all articles
Browse latest Browse all 2690

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>