Docking layout not always persisted correctly

2 posts, 0 answers
  1. Ed
    Ed avatar
    3 posts
    Member since:
    Feb 2016

    Posted 02 Feb Link to this post

    Hello,

     In our project we make use of the LoadLayout and SaveLayout functionality provided by RadDocking.
    This works well using the example provided in the documentation found at: persist docking layout

    The example provided here will create a file inside the IsolatedStorage folder on my machine.
    As said all works well; when I close the app, the layout is being saved, when I open the app the layout is being loaded correctly.

    It stops working as should as soon as you add another extra pane to the xaml (after all, new panes may be added, long time after the persist docking layout feature was created).

    After adding a new pane the layout will not be saved anymore to the xml. Instead the old version will be saved and loaded over and over. The only work around I have come up with so far is locating the xml file inside the IsolatedStorage (renaming/'deleting') it, then restart the app, close down (this will save a new xml) and have my new panel in place the first time I restart the app again.

     It may be a trivial thing to solve, question is, how can this be solved? Is there a solution if any?

     Thanks in advance for any answer,

     
    Best regards,

     

    Ed


     
  2. Ed
    Ed avatar
    3 posts
    Member since:
    Feb 2016

    Posted 02 Feb in reply to Ed Link to this post

    Ok for anyone running into the same issue, a possible solution can be:

    On application entry:
    call a LoadLayout method which does the following:
    First create an empty memory stream and call the SaveLayout on the RadDocking with this stream.
    Next compare this stream to the stream stored in your 'storage', which in my case is a usersetting.

     When both streams are compatible, e.g. matching layouts, then load from the storage otherwise do nothing.

    The only drawback of this solution is, is that when you have added extra pane's, the layout will be reset. This is only once and for our specific situation it was acceptable.

     

     

     

     

     

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top