Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
460
How to redisplay a floating pane.
posted

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);

 


 

Parents
No Data
Reply
  • 54937
    Offline posted

    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.

Children