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

RadDocking with nested RadPaneGroup - Browser crashing on close

1 Answer 90 Views
Docking
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aiden
Top achievements
Rank 1
Aiden asked on 23 Jun 2010, 03:25 PM
We are using version 2010.1.309.1030 of the Telerik controls in our Silverlight 3 application and came across the following issue. I felt it would be good to share this as I have the best part of the last 2 days trying to resolve it.

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>

 

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 25 Jun 2010, 03:55 PM
Hi Aiden,

Thank you for contacting us.

We are not aware of this strange behavior with 3.0.4 and 4.0 version of Silverlight plugin. Sending us a sample running project that illustrates the problem will be really helpful. We appreciate your feedback, which helps us improve our products.

I will be glad to assist you further.

Sincerely yours,
George
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Docking
Asked by
Aiden
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or