English | 简体中文
Lightweight docking layout for Avalonia — compose panels with Grid, DockRegion, and DockSplitter. Works on desktop and WebAssembly.
- Flexible layout — any grid topology; no fixed quadrants or slot enums.
- Tab drag & drop — reorder in the strip, move across regions, double-click to maximize a region.
- Parking lot — optional view surface reuse by tab
Id(WebView, heavy controls). - Closable tabs —
IDockTabItem.IsClosable; optional Add Doc button on a region. - Tab strip chrome — shell default placement, optional ⋮ placement menu, trailing toolbar slot.
- Auto tab selection — first tab selected when
SelectedItemis unset (bind when restoring layout). - Side tab strips — vertical stacked headers on left/right strips (toggle globally or per region).
- Theme-friendly — include
DockShellStyles.axaml; override drag/drop brushes viaDockThemeResources. - MIT — no dependency on Semi, Crystal, or other UI stacks (Avalonia only).
Run the minimal sample:
dotnet run --project samples/GOZA.Dock.Minimal.DesktopFull demo (Crystal DI, layout save/load, closable docs): samples/GOZA.Dock.Demo.Desktop
Install the package (Avalonia 12.0.0+ required in your app):
dotnet add package GOZA.Dock --version 1.0.5Minimal XAML:
<DockShell>
<Grid ColumnDefinitions="*,8,*">
<DockRegion Grid.Column="0"
ItemsSource="{Binding LeftTabs}" />
<DockSplitter Grid.Column="1" ShowsPreview="True" />
<DockRegion Grid.Column="2"
ItemsSource="{Binding RightTabs}" />
</Grid>
</DockShell>DockRegion auto-selects the first tab when SelectedItem is not bound. Bind SelectedItem for layout restore or explicit selection (Demo).
Include library styles in App.axaml:
<StyleInclude Source="avares://GOZA.Dock/Themes/DockShellStyles.axaml" />Tab items implement IDockTabItem (Id, Header, optional ReuseSurface, IsClosable). Map each tab ViewModel to a view with DataTemplate or your DI/view locator.
| Resource | URL |
|---|---|
| Online docs | https://0use.net/GOZA.Dock/ |
| Browser demo (WASM) | https://0use.net/GOZA.Dock/demo/ |
| Release notes | docs/1.0.5/release-notes.md |
| NuGet publish (maintainers) | PUBLISHING.md |
Build docs locally (requires DocFX):
docfx docfx.json && docfx serve _site --port 8080Pushing to master triggers GitHub Pages (DocFX site + WASM demo).
Issues and pull requests are welcome. Developer notes: DEVELOPMENT.md.
MIT — see LICENSE.txt.
