我正在向对接主机动态添加radpanes。但我希望在窗格关闭时陷阱。但我似乎无法找到。
这是我用来动态添加radpanes的代码。我可以添加什么来连接窗格的关闭?
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;
}
答案 0 :(得分:1)
您是否在DockingHost上使用RadDocking? 如果是这样,要监听的事件都在主机上。
Close事件处理程序看起来像这样:
void RadDocking_Close(object sender, Telerik.Windows.Controls.Docking.StateChangeEventArgs e)
{
foreach (var pane in e.Panes)
{
//do something with the pane
}
}