I have the following code to programatically add a new split pane witht content. Once the user close the pane, it stays in the collection. How can I remove it from the xamDockManagerMain.Panes collection. I tried remove but that does not seem to actually remove it. I need to either remove it so that it can be re-added, or how to you display it again once it has been hidden?
SplitPane sp = new SplitPane();sp.Name = "sp" + chatUser + WindowCount.ToString();ContentPane cp = new ContentPane();sp.Panes.Add(cp);cp.Name = "cp" + _screenName + WindowCount.ToString();cp.Header = "Chat " + _screenName + " and " + chatUser;//cp.CloseAction = PaneCloseAction.RemovePane;ChatWindow cw = new ChatWindow(_aimSession, _screenName, chatUser);cw.MinHeight = 100;cw.MinWidth = 100;cp.Content = cw;XamDockManager.SetFloatingLocation(sp, new Point(20, 20));XamDockManager.SetFloatingSize(sp, new Size(200, 200));XamDockManager.SetInitialLocation(sp, InitialPaneLocation.DockableFloating);xamDockManagerMain.Panes.Add(sp);
Setting the Visibility of the ContentPane to Visible should show the floating window again. In my tests, it has worked. If you still get a problem perhaps you can post a small sample that shows the problem?
HI,
The close action is the default with is to collapse, but when I call the visible the window does not come back. Does it have anything to do with it being a floating window?
If the CloseAction is left to the default - HidePane - then when the pane is closed (e.g. clicking the X in the pane header) its Visibility is set to Collapsed. To reshow the pane you would just set its Visibility back to Visible. When the CloseAction is RemovePane and the user clicks the close button or you execute the ContentPaneCommands.Close on the ContentPane, the pane as well as any placeholders for alternate positions of the pane (docked, floating, document) will be removed from the xamDockManager so if you want to remove the pane completely, set the CloseAction as such and use the ExecuteCommand method of the pane with the ContentPaneCommands.Close command.