VM-Bound Docking Window State Mixin#1039
Merged
wieslawsoltes merged 3 commits intomasterfrom Feb 11, 2026
Merged
Conversation
This was referenced Feb 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary: VM-Bound Docking Window State Mixin
Branch
feature/docking-window-state-mixin-syncGoal
Implement optional VM-bound window state synchronization so dockables can bind and drive:
while keeping layout and view-model state synchronized both directions with loop protection.
Commits
804c8797aAdd docking window state mixin and factory synchronization74744c977Expand unit and headless coverage for window state sync39316f137Document docking window state mixin behaviorWhat Was Implemented
1) New core contracts
Added:
src/Dock.Model/Core/IDockingWindowState.cssrc/Dock.Model/Core/IDockingWindowStateSync.cssrc/Dock.Model/Core/DockingWindowStateProperty.csIDockingWindowStateexposes:IsOpenIsActiveIsSelectedDockingStateIDockingWindowStateSyncexposes the callback used by model objects to request layout updates from property changes.2) Factory synchronization engine
Added:
src/Dock.Model/FactoryBase.DockingWindowStateSync.csImplemented two-way synchronization with:
HashSet<IDockable>) for reentrancy protectionIsOpen-> hide/restoreIsSelected-> ownerActiveDockableIsActive-> root focus synchronizationDockingState-> docking transitions (DockAsDocument, pin/unpin, float, hide/restore)DockingStateIsOpenIsSelectedIsActive3) Lifecycle integration
Updated:
src/Dock.Model/FactoryBase.Init.cssrc/Dock.Model/FactoryBase.Events.cssrc/Dock.Model/FactoryBase.DockingState.csKey integration points:
dockable.Factory = thisnow applies to all dockables during init4) Dockable model support across all model variants
Updated
DockableBase+Document+Toolimplementations in:Changes include:
DockingStatesetter callback intoIDockingWindowStateSyncIsOpenIsActiveIsSelected[IgnoreDataMember],[JsonIgnore]where applicable)5) Additional correctness fix
Adjusted visibility/selection/active projection for hidden ancestor scenarios:
IsOpen,IsSelected, andIsActiveare forced falseThis prevents stale "open/selected/active" flags for descendants of hidden containers.
Tests Added / Updated
Updated:
tests/Dock.Model.Mvvm.UnitTests/FactoryTests.cstests/Dock.Model.ReactiveUI.UnitTests/FactoryTests.cstests/Dock.Model.Avalonia.UnitTests/FactoryTests.cstests/Dock.Avalonia.HeadlessTests/FactoryTests.cstests/Dock.Model.Avalonia.UnitTests/AvaloniaDockSerializerTests.csCoverage includes:
Documentation Updates
Updated:
docfx/articles/dock-dockable-properties.mddocfx/articles/dock-state.mdDocs now describe:
IDockingWindowStateValidation
Executed full solution validation:
dotnet test Dock.slnx -c Release --no-restoreResult: all tests passed.
Compatibility / Migration Notes
IDockingWindowStateare unaffected.IsOpen,IsActive,IsSelected) are intentionally non-serialized.Risk Notes