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

Adding new pane where old panes are loaded through serialisation

1 Answer 32 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 20 May 2014, 04:52 PM
Hi

I have an app that I have a docked component and the existing panes are saved/loaded via isolated storage. This has been working fine. I've now added a new pane to my app, via XAML, but when it's run on a system where the layout is loaded it is never displayed.

If I exclude the layout load step the new pane appears, so I guess in the load it's overriding the entire layout of the dock component (as expected). If I then manually add a step in the LoadLayout method to add the pane, that also seems to be ignored.

Here is the important code and the examples of what I've tried:

using (IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly())
{
    try
    {
        using (var isoStream = storage.OpenFile("RadDocking_Layout.xml", FileMode.Open))
        {
            this.radDocking.LoadLayout(isoStream);
        }
    }
    catch (Exception ex)
    {
        logger.Error("Reading pane layout");
    }
}
 
if (panelMap.PaneGroup == null)
{
    //this doesn't work
    radDocking.Items.Add(panelMap);
 
    //neither does adding into existing pane group
    paneTest.Items.Add(panelMap);
 
    //neither does building a new group for the pane to go into
    RadPaneGroup rpg = new RadPaneGroup();
    rpg.Items.Add(panelMap);
    radSplit.Items.Add(rpg);
}
 
//Part of the XAML
<tel:RadDocking Name="radDocking" HasDocumentHost="False">
    <tel:RadSplitContainer x:Name="radSplit" Width="365" InitialPosition="DockedLeft" Orientation="Vertical">
        <tel:RadPaneGroup x:Name="paneTest">
            <tel:RadPane x:Name="panelMap" Header="Map" CanUserClose="False" Height="24" VerticalAlignment="Bottom" IsSelected="True" tel:RadDocking.SerializationTag="Map">

 
I've obviously got something missing, but when I've looked a the examples I can't seem to figure out what.

Thanks...

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 23 May 2014, 07:39 AM
Hi Mike,

Try to create the pane in the code behind. You can find a sample project which after loading the layout creates a new pane and add it next to the existing one. 

Hope this helps.

Regards,
George
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
Docking
Asked by
Mike
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or