Renaming Panels and their reference in the ToolWindowLayoutData

Docking/MDI for Windows Forms Forum

Posted 3 years ago by Amyn Virani - Software Developer, MicroAutomation, Inc.
Version: 20.1.0401
Platform: .NET 4.6
Environment: Windows 10 (64-bit)
Avatar

I understand that the ToolWindowLayoutData property for the DockManager stores all the information about panels that are in the Docking control. We use the data inside it to retain the position of all the panels and restore it on application startup.

From what I can see in that data, the property "Key" for ToolWindow is what is used to match the panel. For us, we are setting the Key to be the form name.

My question is, if we would like to change the form name, is there any way the old ToolWindowLayoutData could identify the new panel name to be the same?

To give a better example, we are setting the ToolWindow.Key = "PanelUSER1". Now instead, we'd like to store the record ID instead of "USER1" i.e. ToolWindow.Key = "Panel101", so the username could be changed and the layout would not be impacted since it will be referencing the ID.

Thanks.

[Modified 3 years ago]

Comments (1)

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

Hello,

The ToolWindow.Key in API must match the <ToolWindow Key="" /> in the layout XML for it to be resolved properly.  If you need to coerce the key values, perhaps you could scan the XML for ToolWindow.Key attributes prior to loading the layout XML.  Then if you detect that a key needs to change based on the ToolWindow.Key values currently in the DockManager, you could update the layout XML's Key attributes as appropriate.  Once those are coerced to match the DockManager's ToolWindows, then load the layout XML.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.