[Version 2.0] Floating Window causes incorrect ActiveContent

Nov 13, 2012 at 2:24 PM


i´ve the problem that the ActiveContent of LayoutRoot doesn´t contain the LayoutContent of a FloatingWindow.

The behaviour can be observed by the AvalonDock.TestApp.
The MainWindow contains the OnLayoutRootPropertyChanged event handler, which handles the ActiveContent property.

        private void OnLayoutRootPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
            var activeContent = ((LayoutRoot)sender).ActiveContent;
            if (e.PropertyName == "ActiveContent")
                Debug.WriteLine(string.Format("ActiveContent-> {0}", activeContent));
                if (activeContent is LayoutContent)
                     Debug.WriteLine(string.Format("ActiveContent-> {0}", ((LayoutContent)activeContent).Title));

Run the app and make Document1 floating.
Everything is ok, ActiveContent contains the LayoutContent of Document1.
Then click into menu bar, the ActiveContent changes to Document2.

The problem is that then a menu item, which operates over the ActiveContent with the documents can not reach the FloatingWindow.

Dec 4, 2012 at 6:45 AM

The AvalonDock.MVVMTestApp has the same problem.

Over the File->Open menu item create some documents.

Than make one document floating and click on File->SaveAs menu item, not the floating document will be saved.

Instead the SaveAs command will be executed for a docked document.