English | 简体中文
An AOT-first tab workspace for Avalonia. Build a fixed IDE layout with ordinary Grid, DockRegion, and DockSplitter; keep every view and view model under application control.
- Simple XAML — no layout model, reflection, floating windows, or platform-specific host.
- Lookless controls —
DockRegion, tab items, headers, and chrome can be replaced with AvaloniaControlThemeresources. - Host-theme independent — Dock chrome supplies private themes for its own
TabStrip, buttons, content host, and splitter; Fluent, Semi, or another app theme is optional. - Built-in
TabStrip— selection is separate from content creation and view caching. - Useful drag only — reorder tabs or move them between fixed regions.
- Automatic gutters — put
DockSplitterin anAutorow or column; it infers the direction. - AOT and cross-platform — the library uses compiled AXAML and runs on Desktop, Browser, Android, and iOS.
- One tiny VM contract — implement
IdandHeader; closing and view reuse are optional defaults.
Include a host theme only if you need it for your own controls. Each DockShell loads DockShellStyles itself:
<Application.Styles>
<FluentTheme />
</Application.Styles>Create the workspace with ordinary Avalonia layout:
<DockShell>
<Grid ColumnDefinitions="*,Auto,2*">
<DockRegion Grid.Column="0"
ItemsSource="{Binding ToolTabs}"
SelectedItem="{Binding SelectedTool}" />
<DockSplitter Grid.Column="1" />
<DockRegion Grid.Column="2"
ItemsSource="{Binding Documents}"
SelectedItem="{Binding SelectedDocument}"
ShowAddButton="True"
AddTabCommand="{Binding AddDocumentCommand}" />
</Grid>
</DockShell>A minimal tab view model only needs two members:
public sealed record EditorTab(string Id, string Header) : IDockTabItem;Map the VM to a view with a normal Avalonia DataTemplate or your DI view locator. DockRegion selects the first item automatically.
Only apply path: assign DockShell.ColorTheme. Loaders return VsCodeColorTheme; they do not write resources. Guide (ZH): DOCK-THEMING.zh-CN.md.
dockShell.ColorTheme = DockColorThemeCatalog.Create(DockColorTheme.DarkModern);
// or: VsCodeThemeJson.LoadFromFile("themes/dark_modern.json");
Application.Current!.RequestedThemeVariant =
dockShell.ColorTheme!.IsDark ? ThemeVariant.Dark : ThemeVariant.Light;<Application.Styles>
<FluentTheme />
</Application.Styles>dotnet run --project samples/GOZA.Dock.Minimal.Desktop # tiny 3-region layout
dotnet run --project samples/GOZA.Dock.Demo.Desktop # full demoMinimal: left top/bottom + right, plain TextBlock views. Demo: Crystal DI, layout persistence, WebView, VS Code themes. Publishing: PUBLISHING.md.
MIT — see LICENSE.txt.
