State of the deserialized layout

Docking/MDI for WPF Forum

Posted 8 years ago by John Smith
Version: 10.1.0523
Avatar

Hello,

I have a problem with tool windows and its states. Suppose I have 2 tool windows:

(1) Docked to the right side

(2) Docked to the left side

There is MDI with some document windows between them. I serialize layout using DockSiteLayoutSerializer. Then I use AutoHide method on both so their State becomes AutoHide and LastState Docked. In the next step I move (1) to MDI (now State=Document, LastState=AutoHide). In the last step I deserialize from the string.

When I look at the controls they look and behave as expected BUT their properties do not.

(1) Instead of [State=Docked, LastState=Document] I get [State=Document, LastState=Docked]

(2) Instead of [State=Docked, LastState=AutoHide] I get [State=AutoHide, LastState=Docked]

Which also means that when I close e.g. (1) and open it again, it shows in MDI.

Here's some code:

// tool windows init

toolWindow1.Dock(DockSite, Direction.Right);
toolWindow2.Dock(DockSite, Direction.Left);

string SerializedLayout = new DockSiteLayoutSerializer().SaveToString(DockSite);

toolWindow1.AutoHide();
toolWindow2.AutoHide();

toolWindow1.MoveToMdi();

new DockSiteLayoutSerializer().LoadFromString(SerializedLayout, DockSite);

[Modified 8 years ago]

Comments (3)

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

I tried this in the current 2015.1 version and it worked fine.  I noticed that you said you have a version that is over five years old.  I'd recommend trying the latest 2015.1 version to see if it is resolved there, and then upgrade to that if it is since in that case it would be a bug that was fixed since the version you have.


Actipro Software Support

Posted 8 years ago by John Smith
Avatar

Thank you. I will try upgrading in the future but now I need a working solution with this version. Can you check how it behaves with older version (if the problem wasn't specific for my code)?

Supposing the result is as I stated, I think those states may be internally swapped. Is there any way to restore last state?

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi John,

It appears to have been fixed in v10.2.0530:

"Fixed issue with DockingWindow.State property not being properly updated when deserializing layout for a DockSite that is loaded."

Unfortunately after looking at it, I believe all the code is internal that you would need to change to fix this problem.  Sorry but you need to upgrade to a new version to have this resolved.


Actipro Software Support

The latest build of this product (v24.1.1) was released 22 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.