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.
Unfortunately, activation email could not send to your email. Please try again.

Loading dynamically added children

Thread ID:

Created:

Updated:

Platform:

Replies:

128345 Jan 16,2017 09:56 AM Jan 18,2017 06:21 AM UWP 3
loading
Tags: SfDockingManager
DanDev
Asked On January 16, 2017 09:56 AM

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 04:26 AM

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.

Regards,
Marimuthu S.
 


DanDev
Replied On January 17, 2017 07:19 AM

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 06:21 AM

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

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Regards,
Marimuthu S. 


CONFIRMATION

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.

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.

;