This project is read-only.

Flyout Windows not closing

Jan 3, 2011 at 5:33 PM

I am using AvalonDock with the Fluent ribbon and it is working fairly well.   I will drop this note off in case anyone comes across the same issue.

When you click in the fluent ribbon if you had a flyout window showing it will not close.  If you click again within the AvalonDock work area the window will close.  I assume this would have something to do with focus not being moved correctly from the flyout window to another portion of the program.  Quick hack again to get it looking properly.

private void OnControlPreviewMouseDown(object sender, MouseButtonEventArgs e)

{

   var tr = new TraversalRequest(FocusNavigationDirection.Right);
   _myDockableContent.MoveFocus(tr);

}

As well, sometimes if you click the flyout tab focus should be set to the flyout tab to ensure it is closed properly.  Just capture the "IsVisibleChanged" event and call the focus method.  If you do these two things when you click outside the flyout tab the window should close as you think it should.

If I had to guess what would fix this within AvalonDock it would be ensuring that when a flyout window is shown that everything else including the main program has lost focus.  I just don't have time to go through the source code at the moment to find it.  

Again if anyone has a better or more elegant solution please post.