Save and restore workspaces
Layout Persistence
Let users return to the workspace they arranged.
Explore source ↗Capability
Serializer packages preserve Dock layouts through System.Text.Json, Newtonsoft.Json, XML, YAML, and Protobuf while keeping persistence outside the UI layer.
- 01
Five serializer choices
- 02
Model-only persistence boundary
- 03
User workspace restoration
- 04
Application-controlled rehydration
How it composes
From intent
to working system.
Capture
The current model tree supplies dockable identity and layout state.
Serialize
A selected package converts the graph to the chosen wire format.
Store
Applications own files, profiles, cloud state, and versioning.
Restore
The factory reconnects services, contexts, and runtime-only state.
Quick start
Adopt this
capability.
Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.
dotnet add package Dock.Serializer.SystemTextJson<PackageReference Include="Dock.Serializer.SystemTextJson" Version="VERSION" /><PackageVersion Include="Dock.Serializer.SystemTextJson" Version="VERSION" />var serializer = new DockSerializer();await using var stream = File.Create("layout.json");serializer.Save(stream, Layout);
// Restore and reinitialize with the application factory.Modules in this capability
Use one layer.
Compose the rest.
Source of truth
Read the module beside the complete system.
The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.