Add CacheDocumentTabContent option to Browser/Fluent/Simple themes and document usage#1058
Merged
wieslawsoltes merged 1 commit intowieslawsoltes:masterfrom Feb 19, 2026
Conversation
This was referenced Feb 23, 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.
Summary
This PR adds an opt-in
CacheDocumentTabContenttheme option to Dock themes so document tab content can stay alive across tab switches (instead of being recreated each time).Supported themes:
BrowserTabThemeDockFluentThemeDockSimpleThemeWhat changed
CacheDocumentTabContentdirect property to:/Volumes/SSD/repos/StackWich/Dock/src/Dock.Avalonia.Themes.Browser/Styles/BrowserTabTheme.axaml.cs/Volumes/SSD/repos/StackWich/Dock/src/Dock.Avalonia.Themes.Fluent/DockFluentTheme.axaml.cs/Volumes/SSD/repos/StackWich/Dock/src/Dock.Avalonia.Themes.Simple/DockSimpleTheme.axaml.csDocumentControltemplates into:DockDocumentControlSingleContentTemplate(default behavior, recycling template path)DockDocumentControlCachedContentTemplate(cached content host for tabs, noControlRecyclingDataTemplate)/Volumes/SSD/repos/StackWich/Dock/src/Dock.Avalonia.Themes.Fluent/Controls/DocumentControl.axamlReferenceEqualsMultiConverterfor active-tab visibility checks in cached mode:/Volumes/SSD/repos/StackWich/Dock/src/Dock.Avalonia/Converters/ReferenceEqualsMultiConverter.cs/Volumes/SSD/repos/StackWich/Dock/README.md/Volumes/SSD/repos/StackWich/Dock/docfx/articles/dock-theme-browser.md/Volumes/SSD/repos/StackWich/Dock/docfx/articles/dock-theme-fluent.md/Volumes/SSD/repos/StackWich/Dock/docfx/articles/dock-theme-simple.mdWhy
Tab switching performance regressed when content was recreated on each activation. This adds an explicit startup-time option to keep document views alive and restore fast tab switching behavior.
Usage
Notes
CacheDocumentTabContentis intended as a configuration-time choice (not a runtime toggle).ControlRecyclingDataTemplatefor document tab content to prevent recycling-related behavior when content is intentionally kept alive.Validation
dotnet build /Volumes/SSD/repos/StackWich/Startups/Sandwich.Desktop/Sandwich.Desktop.csproj