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
1690
How to Close a Pane
posted

Hello,

I want to close the Panes, and not just Hide them (put them in the ClosedPanes collection).

There is no CloseAction property on Pane, so how can i accomplish that?

I want to release the memory as the dynamically created documents/toolwindows are closed.

Thank you in advance,

Michael

 

Parents
  • 1670
    posted

    Hello redbyron,

    There is PaneClosing event of XamDockManager, which you could use when trying to close Panes either inside XamDockManager Panes collection or inside DocumentContentHost - in your case when closing documents/toolwindows. If you don't want those Panes to go into ClosedPanes collection you could Cancel the event and then check if the current pane is inside XamDockManager or is inside DocumentContentHost. The logic might look something like the following code snippet : 

     private void Pane_Closing_Event_Handler(object sender, CancellablePaneEventArgs e)
            {
                e.Cancel = true;
                if(this.igXamDockManager.Panes.Contains(e.Pane))
                {
                   this.igXamDockManager.Panes.Remove(e.Pane);
                }
                if (this.igXamDockManager.DocumentContentHost.Panes.Contains(e.Pane.OwnerPane as TabGroupPane))
                {
                    TabGroupPane tgp = e.Pane.OwnerPane as TabGroupPane;
                    tgp.Panes.Remove(e.Pane as ContentPane);
                }
                
            }
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    If you still have question please feel free to ask! 
    
    Regards,
    
    Nikola.
    
    
    

     

Reply Children