Detect Floating Window Closed

2 posts, 0 answers
  1. Zack
    Zack avatar
    112 posts
    Member since:
    Jun 2012

    Posted 23 Sep 2011 Link to this post

    I have an issue with detecting floating panes being closed.

    On our dock manager we use both PaneStateChange and ActivePaneChanged to try to track which panes in the dock mgr are visible and give the user visual options to show and hide panes.

    When a pane is floating and they click the close button, sometimes the ActivePaneChanged event will fire and sometimes it doesn't leaving our pane visual switchboard incorrect.

    What would be the sure way to detect floating panes being closed?

    Preferrably a trigger from the dock manager because some of our panes are dynamically generated at runtime and I would rather not have triggers attached to every possible pane for this purpose.
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 27 Sep 2011 Link to this post

    Hello Zack,

    You can use the PreviewClose event of the Docking control. There from the event arguments you can get the Pane which was closed and check if it is floating, for example:

    private void RadDocking_PreviewClose(object sender, StateChangeEventArgs e)
    {
        RadPane[] panes = e.Panes as RadPane[];
        RadPane pane = panes[0];
        if (pane.IsFloating == true)
        {
               //DO some work 
        }
    }

    Hope this helps.

    Greetings,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top