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
{{ message }}
Repository navigation
LayoutSyncBridge: anchorable added at runtime ignores the side of its tool dock #670
With DockingManager.DockLayout bound, an anchorable added to a tool dock of the MVVM layout at runtime does not go to the side of its tool dock. It lands in the pane of the active content instead (or another fallback pane), e.g. at the bottom although its tool dock is aligned right.
LayoutSyncBridge.OnAnchorableCollectionChanged adds the item to the anchorables source first and records its side in the content-to-side map afterwards:
if(!_anchorableModels.Contains(item))_anchorableModels.Add(item);// the manager inserts the anchorable here and asks the strategyif(addSide.HasValue)_contentToSide[item]=addSide.Value;// the side is known only now
Adding to _anchorableModels makes the DockingManager insert the anchorable right away. DockAlignmentStrategy does not find the side in the map yet and returns false, so the manager's fallback places it (pane of the active content, then a pane on the right, ...). RebuildAnchorablesFromTree has the same order. Anchorables present when the layout is bound are not affected: Attach() builds the map before it sets the sources.
Steps to reproduce
Bind DockLayout of a plain DockingManager to a DockLayoutService layout with a right and a bottom toolbox.
Dock the bottom toolbox in a pane and make it the active content.
Add another toolbox to the right tool dock's VisibleDockables at runtime.
The new toolbox appears in the bottom pane.
Expected behavior
The new toolbox goes to the side of its tool dock (right), as it would had it been there when the layout was bound.
Activity
[Fix] #670 - [MVVM] LayoutSyncBridge records the side of an anchorabl…