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 3 years ago]