The scenerio is:
The Silverlight application in question using the MVVM pattern. The Shell view binds it's DataContext property to a model created for this view. We also use Unity to inject dependencies and register an instance of our RadDocking object when creating the Shell. See Prism for more details.
The RadDocking control contains a number of RadSplitContainer controls which each in turn contain RadPaneGroup control. These are bound to a Region as required by the pattern so views can be added to the correct regions in code. See the XAML sample at the bottom of this post.
The code ran perfectly using 3.0.5 version of the Silverlight plug-in but others versions e.g. 3.0.4 and the more recent 4.0 versions were causing the browser instance to crash when closing either a tab or the entire window. It took ages of painful commenting out of code and trial and error to track down but eventually it came down to the RadDocking and RadPaneGroup controls. When cleaning up the resources in code for the Shell view we were simply clearing the Triggers and setting the control to null. This was not good enough as the RadGroupPane controls themselves needed to be removed from their containers. The code below shows how I overcame the issue. The key modification was to drill down to the nested RadPaneGroup controls and call RemoveFromParent() on each of them. This stopped the browser crashing on close.
if
(this.RadDockingMainDockingControl != null)
{
foreach (var item in this.RadDockingMainDockingControl.Items)
{
if (item is RadSplitContainer)
{
RadSplitContainer splitContainer = item as RadSplitContainer;
if (splitContainer.Items.Count > 0 && splitContainer.Items[0] is RadPaneGroup)
{
RadPaneGroup paneGroup = splitContainer.Items[0] as RadPaneGroup;
paneGroup.RemoveFromParent();
}
}
}
this.RadDockingMainDockingControl.Triggers.Clear();
this.RadDockingMainDockingControl = null;
}
E.g. of XAML:
<
telerikDocking:RadDocking x:Name="RadDockingMainDockingControl" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Style="{StaticResource RadDockingStyle1}">
<telerikDocking:RadSplitContainer InitialPosition="DockedLeft">
<telerikDocking:RadPaneGroup Regions:RegionManager.RegionName="DockedLeftRegion" infadpt:RadPaneGroupRegionAdapter.RadDockingParent="{Binding Path=DockManager}" Style="{StaticResource RadPaneGroupStyle1}" infadpt:RadPaneGroupRegionAdapter.TabItemStyle="{StaticResource RadPaneStyle1}" />
</telerikDocking:RadSplitContainer>
...
</telerikDocking:RadDocking>