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

Subclassing RadPane & Serialization...

1 Answer 90 Views
Docking
This is a migrated thread and some comments may be shown as answers.
RoadWarrior
Top achievements
Rank 1
RoadWarrior asked on 22 Feb 2010, 02:56 PM
Is Subclassing the RadPane supported?  I've implemented a RadPane subclass to add of my own DependencyProperties and customizations.  So far so good.  However, it seems to break down on serialization (Save/Load).  The Telerik Save/Load APIs will serialize a subclassed RadPane (e.g. XYZPane) as a RadPane.  Therefore the custom subclassed type is lost on reload.  Please advise on how I might achieve this or if it is something you would consider supporting in a future release. 

1 Answer, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Feb 2010, 04:56 PM
Hello Rick,

If you are not creating your custom panes dynamically (they are defined in XAML), the easiest fix for this problem is to set the RadDocking.SerializationTag attached property to the pane. Unfortunately if you are adding this kind of panes dynamically this will not help for all cases. In this situation you will need to handle the ElementLoading event of the Docking control and to use the SetAffectedElement method of its arguments to point the instance you want to use when loading. Please, refer to the following code sample that demonstrates how to do that.
private void RadDocking_ElementLoading(object sender, Telerik.Windows.Controls.LayoutSerializationLoadingEventArgs e)
{
    if (e.AffectedElementSerializationTag.StartsWith("MyPane_"))
    {
        e.SetAffectedElement(new MyPane());
    }
}

Hope this helps.

Kind regards,
Miroslav Nedyalkov
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
RoadWarrior
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question
or