Close event and pane groups

4 posts, 0 answers
  1. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 21 Jan 2014 Link to this post

    Hello,
    in the documentation of the RadDocking.Close event, it is said that it occurs when a pane or group is closed.
    But the arguments of the event is of type StateChangeEventArgs, that contains only a Panes property. How can I be notified that a group is closed?
    Patrick
  2. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 24 Jan 2014 Link to this post

    Hi,

    In the current version of RadDocking there isn't an explicit event that is triggered when the entire ToolWindow (floating PaneGroup) is closed. In those cases the Close event of the control is triggered multiple times for each RadPane present in that PaneGroup.

    If the desired behavior is to get an event triggered when the entire ToolWindow is closed you could create a custom DefaultGeneratedItemsFactory, override its CreateToolWindow in which attach the Unloaded event to it. That event will be triggered when that ToolWindow gets closed. The next code snippets show how that factory should look like:
    public class CustomGeneratedItemsFactory : DefaultGeneratedItemsFactory
    {
        public override ToolWindow CreateToolWindow()
        {
            var window = base.CreateToolWindow();
            window.Unloaded += window_Unloaded;
            return window;
        }

        void window_Unloaded(object sender, RoutedEventArgs e)
        {
            // Do something when the hole group was closed
        }
    }

    and in the xaml:
    <telerik:RadDocking>
        <telerik:RadDocking.GeneratedItemsFactory>
            <local:CustomGeneratedItemsFactory />
        </telerik:RadDocking.GeneratedItemsFactory>
        ...
    </telerik:RadDocking>

    Hope this is helpful.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Patrick
    Patrick avatar
    372 posts
    Member since:
    Aug 2012

    Posted 24 Jan 2014 Link to this post

    Hi Vladi,
    I've found another solution: when a pane is closed, I get a reference to its group and look if it is empty (no more panes on it). If it is empty, I consider it closed.
    But the real question was about the documentation, that says that the event occurs when a pane or group is closed.
    Patrick
  5. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 24 Jan 2014 Link to this post

    Hi,

    The mentioned "Occurs when a pane or a group is closed." comment is correct because that event is triggered when closing a single Pane and multiple Panes (closing a PaneGroup). This comment is taken from the API of the RadDocking control and we will make sure to update it in a way it will be more descriptive.

    For more detailed documentation about the most common events in the RadDocking control please refer our Events Overview help article.

    Regards,
    Vladi
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top