Initial layout load

5 posts, 0 answers
  1. Ola
    Ola avatar
    15 posts
    Member since:
    Jun 2014

    Posted 08 Jun 2015 Link to this post

    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

  2. Ola
    Ola avatar
    15 posts
    Member since:
    Jun 2014

    Posted 10 Jun 2015 Link to this post

    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.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 11 Jun 2015 Link to this post

    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
  5. Ola
    Ola avatar
    15 posts
    Member since:
    Jun 2014

    Posted 11 Jun 2015 in reply to Vladi Link to this post

    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.

  6. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 12 Jun 2015 Link to this post

    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
Back to Top
UI for WPF is Visual Studio 2017 Ready