Conversation
Ensure new document docks attach before moving documents and\npropagate DocumentFactory across dock splits and window creation.
Cover DocumentFactory propagation and layout attachment on split.
Document IDocumentDockFactory usage and split behavior updates.
This was referenced Feb 2, 2026
This was referenced Feb 9, 2026
This was referenced Feb 18, 2026
This was referenced Feb 25, 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: Document Dock Split Fixes (Issues #938, #940)
This summary captures the findings, implementation details, and usage guidance
for the fixes addressing:
DocumentFactory, so the+button did nothing.Findings
but moved the document into that dock before inserting the dock into the layout.
This left the new dock unattached (and the document "disappearing").
DocumentFactory, so create-documentactions in the new dock did not work.
Implementation Details
1) Ensure the new document dock is inserted before moving documents
The split flow now inserts the new dock into the layout first and only then
moves the document into it. This mirrors normal docking behavior and keeps the
new dock attached in the layout tree.
Changes:
FactoryBase.Dockable.NewHorizontalDocumentDockFactoryBase.Dockable.NewVerticalDocumentDockBehavioral result:
2) Preserve
DocumentFactorywhen splitting documentsDocument-dock creation now copies
DocumentFactoryin addition to the existingproperties (
Id,CanCreateDocument,EnableWindowDrag,LayoutMode,DocumentTemplate).Changes:
IDocumentDockFactoryinterface to formalizeDocumentFactory.IDocumentDockFactory.DockService.SplitDocumentDockableFactoryBase.Dockable.NewHorizontalDocumentDockFactoryBase.Dockable.NewVerticalDocumentDockFactoryBase.CreateWindowFrom(document windows now preserve factory as well)Behavioral result:
+button (orCreateDocument) works as expected after splitting.3) Tests updated
DocumentFactoryis preserved on split.Tests:
tests/Dock.Avalonia.HeadlessTests/DocumentDockNewDockTests.csUsage Guide
Using
DocumentFactorywith document docksAssign a factory delegate so new documents can be created from the
+buttonor the
CreateDocumentcommand:Splitting a document dock
When you invoke the split commands (context menu or factory methods), the new
dock now:
DocumentFactory.DocumentTemplate(Avalonia model).Example:
Behavior after splitting
+button andCreateDocumentcommand work becauseDocumentFactorywas preserved on the new dock.
Files Changed (Key)
src/Dock.Model/Controls/IDocumentDockFactory.cssrc/Dock.Model/FactoryBase.Dockable.cssrc/Dock.Model/DockService.cssrc/Dock.Model/FactoryBase.cssrc/Dock.Model.*/*/DocumentDock.cs(implementsIDocumentDockFactory)tests/Dock.Avalonia.HeadlessTests/DocumentDockNewDockTests.csNotes
IDocumentDockFactoryinterface is intentionally small and focusedto avoid changing
IDocumentDockitself.avoids temporary "orphaned" dock states.
Fixes #938
Fixes #940