Empty Document Host Content + Template Support#1032
Merged
wieslawsoltes merged 4 commits intomasterfrom Feb 9, 2026
Merged
Conversation
This was referenced Feb 9, 2026
Closed
This was referenced Feb 18, 2026
Closed
This was referenced Feb 25, 2026
This was referenced Mar 2, 2026
This was referenced Mar 9, 2026
Closed
This was referenced Mar 18, 2026
This was referenced Apr 13, 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: Empty Document Host Content + Template Support
Branch
feature/empty-content-template-placeholdersCommit Breakdown
ec9385e62-feat(model): add document empty content placeholder APIa10f855a6-feat(avalonia): render empty content templates for document hostsb3a20bdb8-test(leaks): cover empty-content subscription detach paths6febd2130-docs: document empty-content support for tabbed and mdi hostsProblem
Document hosts had no first-class placeholder content experience when empty, and there was no control-level template override for rendering empty host content in tabbed and MDI views. This also required explicit subscription lifecycle validation to ensure no leaks when DataContext/collections change.
Solution Overview
Implemented end-to-end empty-host support across model, Avalonia controls, templates, tests, and docs:
EmptyContentTemplate) for:DocumentControl(tabbed documents)MdiDocumentControl(MDI documents)Detailed Changes
1) Model/API changes
object? EmptyContent { get; set; }toIDocumentDock.WithEmptyContent(this IDocumentDock dock, object? content)"No documents open") across document dock implementations:Dock.Model.Avalonia.Controls.DocumentDockDock.Model.CaliburMicro.Controls.DocumentDockDock.Model.Inpc.Controls.DocumentDockDock.Model.Mvvm.Controls.DocumentDockDock.Model.Prism.Controls.DocumentDockDock.Model.ReactiveProperty.Controls.DocumentDockDock.Model.ReactiveUI.Controls.DocumentDock2) Avalonia controls and templates
DocumentControlEmptyContentTemplate.HasVisibleDockables.PART_EmptyContentHost) bound to modelEmptyContentand controlEmptyContentTemplate.HasVisibleDockables.MdiDocumentControlEmptyContentTemplate.HasVisibleDocuments.PART_EmptyContentHost) bound to modelEmptyContentand controlEmptyContentTemplate.HasVisibleDocuments.3) Test coverage
Headless functional tests
DocumentEmptyContentTestsEmptyContentTemplateMdiEmptyContentTestsDocumentDockPropertiesTestsEmptyContentSubscription/leak-path tests
ControlSubscriptionLeakTests(headless)VisibleDockablescollection replacementEmptyContentSubscriptionLeakTests(release leak suite)Model/serializer test updates
Dock.Model.CaliburMicro.UnitTestsDock.Model.Mvvm.UnitTestsDock.Model.Prism.UnitTestsDock.Model.ReactiveProperty.UnitTestsDock.Model.ReactiveUI.UnitTestsDock.Model.UnitTests(fluent extension)Dock.Serializer.UnitTests(INPC default)4) Documentation updates
Updated docs to include new API/properties and behavior:
docfx/articles/dock-controls-reference.mddocfx/articles/dock-mdi.mddocfx/articles/dock-model-controls.mddocfx/articles/dock-reference.mdValidation Performed
Executed targeted tests on this branch:
dotnet test tests/Dock.Avalonia.HeadlessTests/Dock.Avalonia.HeadlessTests.csproj -c Release --filter "FullyQualifiedName~DocumentEmptyContentTests|FullyQualifiedName~MdiEmptyContentTests|FullyQualifiedName~DocumentDockPropertiesTests|FullyQualifiedName~ControlSubscriptionLeakTests"dotnet test tests/Dock.Avalonia.LeakTests/Dock.Avalonia.LeakTests.csproj -c Release --filter "FullyQualifiedName~EmptyContentSubscriptionLeakTests"dotnet test tests/Dock.Model.UnitTests/Dock.Model.UnitTests.csproj -c Release --filter "FullyQualifiedName~DocumentDockFluentExtensionsTests"dotnet test tests/Dock.Serializer.UnitTests/Dock.Serializer.UnitTests.csproj -c Release --filter "FullyQualifiedName~DocumentDockInpcTests"Behavioral Notes
EmptyContentTemplatewas implemented in Avalonia control layer (not model layer), matching existing template override patterns.DocumentControl)MdiDocumentControl)Risk Assessment
Low to medium:
Reviewer Checklist
EmptyContentTemplatevisuals in sample app or manual harness.