You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a strange issue with a restored layout that contains a floating window.
It looks like DockingManager.DockingManager_Loaded is called twice and calls the CreateUIElementForModel method twice for the same FloatingWindows.
The callstack of the second time is long, but includes the first call of CreateUIElementForModel (see below).
There is a comment above this code that suggests, that this was an issue before. But I don't think that it fixes the issue.
// load floating windows not already loaded! (issue #59)varitems=newList<LayoutFloatingWindow>(Layout.FloatingWindows.Where(fw =>!_fwList.Any(fwc =>fwc.Model==fw)));foreach(varfwinitems)_fwList.Add(CreateUIElementForModel(fw)asLayoutFloatingWindowControl);
The Add is not executed before the second call to DockingManager_Loaded occurs. So the list is still empty and a second UIElement will be created for the same model. A better way would be to fill the List inside CreateUIElementForModel right after the element was created. That way the list will include the element when DockingManager_Loaded occurs again.
I'll create a PR for this ;)
Here is the full callstack by the way. I marked the important lines with '> '
I have a strange issue with a restored layout that contains a floating window.
It looks like
DockingManager.DockingManager_Loaded
is called twice and calls theCreateUIElementForModel
method twice for the same FloatingWindows.The callstack of the second time is long, but includes the first call of
CreateUIElementForModel
(see below).There is a comment above this code that suggests, that this was an issue before. But I don't think that it fixes the issue.
The
Add
is not executed before the second call toDockingManager_Loaded
occurs. So the list is still empty and a second UIElement will be created for the same model. A better way would be to fill the List insideCreateUIElementForModel
right after the element was created. That way the list will include the element whenDockingManager_Loaded
occurs again.I'll create a PR for this ;)
Here is the full callstack by the way. I marked the important lines with '> '
The text was updated successfully, but these errors were encountered: