Subclassing RadPane & Serialization...

2 posts, 0 answers
  1. RoadWarrior
    RoadWarrior avatar
    45 posts
    Member since:
    Jan 2010

    Posted 22 Feb 2010 Link to this post

    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. 
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Feb 2010 Link to this post

    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.
Back to Top