Small bug in DockingManager ?

Dec 2, 2010 at 9:47 AM

Hello,

When we release CTRL/Tab keys we get an error at line 1097 of DockingManager.cs: Iif no selection has been done navigatorWindow.Documents.CurrentItem is null in line

var docSelected = (navigatorWindow.Documents.CurrentItem as NavigatorWindowDocumentItem).ItemContent as DocumentContent;

Quite easy to solve:

 var currentItem = (navigatorWindow.Documents.CurrentItem as NavigatorWindowDocumentItem);
if (currentItem != null)
{
    var docSelected = currentItem.ItemContent as DocumentContent;
    docSelected.Activate();
}

It may be a bug or may be caused by the way we dynamically create DockableContent. (Advertising: We are building a wrapper for AvalonDock, visit http://sofawpf.codeplex.com).

We would like to know if other people encountered the same error, if not this indicates there's something twisted in our code!