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

Docking layout not always persisted correctly

1 Answer 60 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Ed
Top achievements
Rank 1
Ed asked on 02 Feb 2016, 08:03 AM

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


 

1 Answer, 1 is accepted

Sort by
0
Ed
Top achievements
Rank 1
answered on 02 Feb 2016, 04:13 PM

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.

 

 

 

 

 

Tags
Docking
Asked by
Ed
Top achievements
Rank 1
Answers by
Ed
Top achievements
Rank 1
Share this question
or