Rick Hodder
Rick Hodder

Reputation: 2252

Hooking Up to Telerik Silverlight RadPane close

I am dynamically adding radpanes to a dockinghost. But I want to trap when the pane is closed. But I cant seem to find how.

Here's the code I use to dynamically add the radpanes. What could I add to it to hook up the closing of the pane?

public RadDocumentPane AddDocumentPane(string title, UserControl control, string paneGroup, DockPosition position)
         {
             RadPaneGroup group = FindName(paneGroup) as RadPaneGroup;
             RadDocumentPane r = null;

            if (group != null)
             {
                 r = new RadDocumentPane();                
                r.Title = title;
                 r.Content = control;                
                group.AddItem(r, position);
             }

            return r;
         }

Upvotes: 0

Views: 310

Answers (1)

Silver Solver
Silver Solver

Reputation: 2320

Are you using RadDocking for your DockingHost? If so the events to listen for are all on the host itself.

A Close event handler would look something like this:

void RadDocking_Close(object sender,  Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
{
    foreach (var pane in e.Panes)
    {
        //do something with the pane
    }
}

Upvotes: 1

Related Questions