We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Close Icon
Unfortunately, activation email could not send to your email. Please try again.
Close Icon
close icon
Vote for your favorite ebook
Succinctly Readers Awards 2020
Syncfusion Feedback

Loading dynamically added children

Thread ID:





128345 Jan 16,2017 02:56 PM UTC Jan 18,2017 11:21 AM UTC UWP 3
Tags: SfDockingManager
Asked On January 16, 2017 02:56 PM UTC

I am making a visual studio-style IDE in UWP and need to serialize the layout of the widgets. Using SaveDockState/LoadDockState always seems to mess up the layout when loading, by mixing up the positions or not even showing at all.

It's hard to understand this paragraph of the documentation

"Since the SfDockingManager state persistence feature implemented in such a way that the SfDockingManager matches the child collection of saved layout with current SfDockingManager layout internally and loads properly when SfDockingManager children collection remains same, so when any child collection changes dynamically, it results in an improper layout."

Does this refer to the order of elements in the child collection or any changes at all to the widget?

Marimuthu Sivalingam [Syncfusion]
Replied On January 17, 2017 09:26 AM UTC

Hi Daniel,

Thank you for contacting Syncfusion support.

We have prepared the sample which tries to meet your requirement. In this sample we have used Save, Load, Reset Dock states of SfDockingManager to perform serialization operations. Please download the sample from the following link.

Sample: SfDockingSerialization

Query: "It's hard to understand this paragraph of the documentation"

SfDockingManager control loads the saved state of SfDockingManager correctly, when the children collection matches with the Saved state file. You can save and load the dynamically added children by changing its state until the application closes. Since after closing the application, the dynamically added children are removed from the children collection of DockingManager. So on loading it would result in an improper layout.

Please get back to us with more details if we have misunderstood your requirement.

Marimuthu S.

Replied On January 17, 2017 12:19 PM UTC

In the provided sample, if I drag the App.xaml.cs document and dock it to the bottom of the Mainwindow.xaml document, save the state, close the app, re-open the app, then load the state, it does not show up anymore.

"Since after closing the application, the dynamically added children are removed from the children collection of DockingManager."

I'm calling SaveLayout() in the OnSuspending override in my App class. The children are still in the collection at that point.
In OnSuspending:

I call SaveLayout()
I foreach through the children collection, adding their ViewModels to a list.
I then serialize the list with JSON.NET

When I load the app:
Deserialize the list of view models, adding their views to the Children collection.
call LoadLayout()

Sometimes this works, other times the the widgets mix up their places, other times nothing displays at all (even though they are in the children collection).

Marimuthu Sivalingam [Syncfusion]
Replied On January 18, 2017 11:21 AM UTC

Hi Daniel,

Thank you for your update.

We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates


Marimuthu S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon