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
20
Floating window - closing tabs
posted

Hi,

When I drag a TabGroupPane outside the main window it becomes a floating window. If I press the Close button on the Floating window it closes the whole window, not an active tab. Is this possible to change this behaviour? I discovered there is an event 'PaneClosing' in XamDockManager but in Silverlight edition, not WPF. So how can I intercept this event in WPF or change the described behaviour in any way?

 

Parents
No Data
Reply
  • 200
    Verified Answer
    posted

    The solution is to handle XamDockManager WindowClosing event. However in order to subscribe to this event, you need to subscribe to XamDockManager ToolWindowLoaded event which is fired whenever ContentPane or TabGroupPane is dragged out as floating window. Within ToolWindowLoaded you should subscribe to WindowClosing event:

    void xamDockManager1_ToolWindowLoaded(object sender, PaneToolWindowEventArgs e)
    {
       e.Window.Closing +=
    new System.ComponentModel.CancelEventHandler(xamDockManager1_WindowClosing);
    }

     

Children
No Data