private void FormDockingManagerWindowDeactivatedEventHandler(DockingManager dm, Window wd)
{
var content = ((WindowContent) wd).CurrentContent;
// seems that content may sometimes be null - not sure why
// in this case, just ignore the event
if (content != null)
{
var shelfView = (ShelfView)content.Tag;
shelfView.SetActiveStatus(false);
}
}