private void InsertControlToPropertiesView(Window window) { layersView = new LayersView(editor); tilesetsView = new TilesetsView(editor, brushesViewModel, tilesetsViewModel); // Root of the window. Grid root = LogicalTreeHelper.FindLogicalNode(window, "root") as Grid; // Get root docking manager and view panel. DockingManager rootDockingManager = LogicalTreeHelper.FindLogicalNode(root, "dockingManager") as DockingManager; LayoutAnchorable propertiesLayoutAnchorable = rootDockingManager.FindName("propertiesView") as LayoutAnchorable; // Get vies docking manager. //DockingManager propertiesDockingManager = propertiesLayoutAnchorable.Content as DockingManager; //LayoutPanelControl propertiesLayoutPanel = propertiesDockingManager.LayoutRootPanel; StackPanel stackPanel = propertiesLayoutAnchorable.Content as StackPanel; // Insert new controls. stackPanel.Children.Add(layersView); stackPanel.Children.Add(tilesetsView); }