Skip to content

0use-TE/GOZA.Dock

Repository files navigation

English | 简体中文

GOZA.Dock

GOZA.Dock

Lightweight docking layout for Avalonia — compose panels with Grid, DockRegion, and DockSplitter. Works on desktop and WebAssembly.

Features

  • 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 tabsIDockTabItem.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 SelectedItem is 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 via DockThemeResources.
  • MIT — no dependency on Semi, Crystal, or other UI stacks (Avalonia only).

Quick start

Run the minimal sample:

dotnet run --project samples/GOZA.Dock.Minimal.Desktop

Full 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.5

Minimal 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.

Documentation & demos

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 8080

Pushing to master triggers GitHub Pages (DocFX site + WASM demo).

Contributing

Issues and pull requests are welcome. Developer notes: DEVELOPMENT.md.

License

MIT — see LICENSE.txt.

About

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors