I use component DevExpress DockLayoutManager
According to the documentation on their website
http://documentation.devexpress.com/#WPF/DevExpressXpfDockingLayoutPanel_Uritopic
Control property "returns the root element of the Window / Page" - ie Grid.
Example is in their demo application: DockingDemo.Wpf DocumentGroups.xaml
And here is my code
DocumentGroup documentContainer = dockManager.GetItem("documentContainer") as DocumentGroup;
DocumentPanel panel = dockManager.DockController.AddDocumentPanel(documentContainer,new Uri("/WpfSample;component/MyWindows/Win1.xaml", UriKind.Relative));
panel.Caption = "SomeName";
MyWindow win = ((panel.Control as Grid).Parent as MyWindow);
win.DoInit(object Obj);
And when I call (panel.Control as Grid). Parent - I get a link to DockLayoutManager.
I do not quite understand. Window goes where? DockLayoutManager becomes Parent in the logical tree for the Grid of the Windows?
Tell me please - how to get Window, cast it to the required class and call its method?
ie how to make this code work
MyWindow win = ((panel.Control as Grid).Parent as MyWindow);
win.DoInit(object Obj);