|
S.No |
Query |
Answer | |
|
1 |
I run a program, load a txt file and Save layout. The saved XML file looks fine, it has 6 DockingParams elements (2 panes i 4 txt documents, original layout has 5). However, when I close the program, the saved layout XML file is overwritten with the original layout. Why this happens and how to prevent it? |
Currently we don’t have support to serialize the state of DockingManager children which has been added during runtime. Please refer the below documentation for same.
And we are analyzing why the serialized data of DockingManager children added in runtime is removed from saved layout when application is closed and we will update you on 11th March 2020. | |
|
2 |
When I close the program and try to load file with the modified layout, there is no a tab for the previously loaded file. Method PART_DockingManager.LoadDockState returns false. Is it possible to load state for the newly, dynamically added documents, and load this state, just like Visual Studio does ? | ||
|
3 |
How do I correlate a DockingManager tab with its content? I don't see a way to, for example, say that a file should be displayed in a tab, or some object with some internal GUID id, or something like that. Avalon dock has a property ContentId which can be used for this, is there something similar in DockingManager? |
We can correlate the DockingManager tab with its content by using Name property which is unique as ContentId property in AvalonDock . | |
|
4 |
Is there a working demo for restoring a full DockingMnager layout? |
The layout of the DockingManager can be restored to initial layout by using ResetState method as shown in below code snippet.
C#:
|
|
if (!dockingManager.LoadDockState(loadLayoutPath))
{
var savedWindows = GetSavedWindowList(loadLayoutPath);
var missingChildren = FindMissingChidren(dockingManager, savedWindows);
AddMissedChildrensIntoDockingManager(missingChildren);
}
this.dockingManager.LoadDockState(formatter, StorageFormat.Xml, loadLayoutPath); |