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

Initial layout load

4 Answers 139 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Ola
Top achievements
Rank 1
Ola asked on 08 Jun 2015, 09:30 AM

What is the best way to initialize RadDocking with a saved layout?

I want my application to save layout whenever a RadDocking control is loaded I want to load the saved layout, but I cant find any good event to hook into to run LoadLayout.

I am using Prism with a RegionAdapter as in your ShellPrism sample project.

 

/Ola

4 Answers, 1 is accepted

Sort by
0
Ola
Top achievements
Rank 1
answered on 10 Jun 2015, 09:10 AM

Ok, I realize this was more of a Prism issue than yours. Still I think it might be relevant to you.

I have come up with a solution that works for me. It is the AutoPopuplateRegionBehavior that adds the panes to RadDocking, so I did my own implementation of the behavior that also runs LoadLayout once all panes are added. I override the ConfigureDefaultRegionBehaviors in Bootstrapper to load my own behavior instead of the default AutoPopuplateRegionBehavior.

0
Vladi
Telerik team
answered on 11 Jun 2015, 08:10 AM
Hello Ola,

Thank you for contacting us.

Indeed you can take a look at our "ShellPrism" SDK example available in our GitHub repository here, this example demonstrates the best way of using the RadDocking control with the PRISM library. Regarding your question about when is the best time to load the previously saved layout into the RadDocking, there is no specific event that is the best fit for all scenarios but the one that comes the closest would be the Loaded event of the control.

I created and attached a sample project for you that shows how to save the layout of the control when the application is closed and load it when the application is started. For simplicity the project does not implement any PRISM related behaviors but rather only the required events, hope this is helpful.

Regards,
Vladi
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Ola
Top achievements
Rank 1
answered on 11 Jun 2015, 08:40 AM

Thanks Vladi for reply.

Your sample project does not work for me since it is too early to LoadLayout on the Loaded event. The RadDocking.PanesSource is populated by the RegionAdapter together with AutoPopulateRegionBehavior when my view is loaded, but I need to wait for it to finish before I can do LoadLayout.

I will stick with my solution with the modified AutoPopulateRegionBehavior.

0
Vladi
Telerik team
answered on 12 Jun 2015, 06:54 AM
Hello Ola,

Indeed using the Loaded event could be too early when a full PRISM implementation is does in the context of the RadDocking control.

Thank you for sharing your solution to this case with us. Using the modified AutoPopulateRegionBehavior looks like would be the best fit for the described scenario.

Regards,
Vladi
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Docking
Asked by
Ola
Top achievements
Rank 1
Answers by
Ola
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or