This is a migrated thread and some comments may be shown as answers.

Close event and pane groups

3 Answers 80 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Patrick asked on 21 Jan 2014, 04:04 PM
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

3 Answers, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 24 Jan 2014, 11:05 AM
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 >>
0
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
answered on 24 Jan 2014, 12:36 PM
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
0
Vladi
Telerik team
answered on 24 Jan 2014, 02:44 PM
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 >>
Tags
Docking
Asked by
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Vladi
Telerik team
Patrick
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or