Logo van Avalonia Pro Max/Layout Patterns

Avalonia Pro Max/Layout Patterns

Community
linuxdevel
avalonia-pro-max/layout-patterns

Use when designing the page-level layout of an Avalonia app — responsive breakpoints, sidebar vs top-nav vs bottom-nav, dashboard grids, master-detail, settings page, mobile vs desktop adaptive layouts. Covers Grid, DockPanel, SplitView, NavigationView, ItemsRepeater layout strategies.

Overzicht

Uitgeverlinuxdevel
RepositoryAvalonia-skills
Skillnaamavalonia-pro-max/layout-patterns
Sterren
50
Forks
4
Meegeleverde bestanden
Alleen instructies
LicentieMIT
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door linuxdevel op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Avalonia Pro Max/Layout Patterns in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-pro-max/layout-patterns
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/linuxdevel/Avalonia-skills.git /tmp/Avalonia-skills
mkdir -p .claude/skills
cp -r /tmp/Avalonia-skills/skills/avalonia/avalonia-pro-max/layout-patterns .claude/skills/linuxdevel-avalonia-pro-max-layout-patterns
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Avalonia Pro Max/Layout Patterns in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Avalonia Pro Max/Layout Patterns automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Avalonia Pro Max/Layout Patterns niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Layout Patterns

Breakpoints

Avalonia desktop windows have no fixed viewport, so define your own breakpoint conventions and react in code-behind or via OnSizeChanged. Recommended scale:

NameWidthTypical
Compact< 640 pxMobile, narrow sidebar collapsed window
Medium640 – 1024 pxTablet, small desktop window
Wide1024 – 1440 pxStandard desktop
XWide≥ 1440 pxLarge desktop, ultrawide
csharp
private void OnSizeChanged(object? sender, SizeChangedEventArgs e)
{
    var classes = (Window)this;
    classes.Classes.Set("compact", e.NewSize.Width <  640);
    classes.Classes.Set("medium",  e.NewSize.Width >= 640  && e.NewSize.Width < 1024);
    classes.Classes.Set("wide",    e.NewSize.Width >= 1024 && e.NewSize.Width < 1440);
    classes.Classes.Set("xwide",   e.NewSize.Width >= 1440);
}

Then style by class:

xml
<Style Selector="Window.compact StackPanel.sidebar"><Setter Property="IsVisible" Value="False"/></Style>

For more granular containers, use ContainerQuery (see avalonia-styling).


Layout Templates

App Shell — Sidebar + Content + Right Panel

xml
<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition Width="240"/>     <!-- Sidebar -->
    <ColumnDefinition Width="*"/>       <!-- Main -->
    <ColumnDefinition Width="320"/>     <!-- Right rail -->
  </Grid.ColumnDefinitions>

  <Border Grid.Column="0" Background="{DynamicResource SurfaceMutedBrush}">
    <!-- nav -->
  </Border>

  <ScrollViewer Grid.Column="1">
    <StackPanel Margin="32" Spacing="{StaticResource Space6}">
      <!-- main content -->
    </StackPanel>
  </ScrollViewer>

  <Border Grid.Column="2" Background="{DynamicResource SurfaceBrush}">
    <!-- detail / inspector -->
  </Border>
</Grid>

Hide the right rail on compact/medium:

xml
<Style Selector="Window.compact Grid > Border:nth-child(3)">
  <Setter Property="IsVisible" Value="False"/>
</Style>

Master-Detail with SplitView

xml
<SplitView IsPaneOpen="True"
           DisplayMode="Inline"
           OpenPaneLength="320">
  <SplitView.Pane>
    <ListBox ItemsSource="{Binding Conversations}"
             SelectedItem="{Binding SelectedConversation}"/>
  </SplitView.Pane>
  <ContentControl Content="{Binding SelectedConversation}"/>
</SplitView>

For mobile-style adaptive: bind DisplayMode to a converter on window width — Inline on wide, Overlay on compact.

Dashboard Grid (Cards)

xml
<ScrollViewer>
  <ItemsControl ItemsSource="{Binding Widgets}" Margin="24">
    <ItemsControl.ItemsPanel>
      <ItemsPanelTemplate>
        <UniformGrid Columns="3"/>
      </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
      <DataTemplate>
        <Border Classes="card" Margin="8">
          <ContentPresenter Content="{Binding}"/>
        </Border>
      </DataTemplate>
    </ItemsControl.ItemTemplate>
  </ItemsControl>
</ScrollViewer>

For responsive columns, swap to WrapPanel with min card widths:

xml
<WrapPanel Orientation="Horizontal"/>

…and set MinWidth="280" MaxWidth="360" on the card.

For powerful auto-grid behavior, use AvaloniaAutoGrid or custom Layout with ItemsRepeater.

Settings Page

xml
<ScrollViewer>
  <StackPanel MaxWidth="720" Margin="24" Spacing="{StaticResource Space6}">
    <TextBlock Classes="h1" Text="Settings"/>
    <ui:SettingsExpander Header="Account" .../>
    <ui:SettingsExpander Header="Appearance" .../>
    <ui:SettingsExpander Header="Notifications" .../>
    <ui:SettingsExpander Header="Privacy" .../>
  </StackPanel>
</ScrollViewer>

MaxWidth="720" keeps reading length sane on ultrawide.

Centered Single-Column (auth, onboarding)

xml
<ScrollViewer>
  <StackPanel HorizontalAlignment="Center"
              MaxWidth="380"
              Margin="32"
              Spacing="{StaticResource Space4}">
    <Image Source="avares://MyApp/Assets/logo.svg" Height="40"/>
    <TextBlock Classes="h2" Text="Welcome back"/>
    <!-- form -->
  </StackPanel>
</ScrollViewer>

Navigation Pattern Selection

PatternUse whenAvalonia mechanism
Sidebar nav (vertical)Desktop app, ≤8 top-level destinationsSplitView or FluentAvalonia NavigationView PaneDisplayMode="Left"
Top tab nav≤5 destinations, content-focusedTabControl
Bottom navMobile, ≤5 destinationsFluentAvalonia NavigationView PaneDisplayMode="LeftMinimal" (mobile-styled) or custom Grid with RadioButtons
Hamburger drawerMany destinations + secondary navSplitView DisplayMode="Overlay" with toggle
Hamburger drawer, built-in (12.0+)Mobile/adaptive apps without a third-party nav controlDrawerPage (page-based navigation system, see below)
Command palettePower users, search-drivenCustom modal with TextBox + filtered ListBox; bind Ctrl+K
BreadcrumbHierarchical content (file system, settings)Custom ItemsControl with separator template

Never mix sidebar + bottom nav at the same hierarchy level.

Page-based navigation (12.0+)

Avalonia 12.0 adds a built-in page navigation system: Page, ContentPage, DrawerPage, CarouselPage and NavigationPage/TabbedPage (automation peers exist for all three of DrawerPage, NavigationPage, TabbedPage; full docs pages for them were not reachable when verifying, so check the API docs before use). Not available in 11.3 — use SplitView/TabControl/FluentAvalonia there.

DrawerPage (verified API members) wraps Drawer (pane content) and Content, with DrawerBehavior (Auto / Disabled / Flyout / Locked), DrawerLayoutBehavior, DrawerPlacement, DrawerLength, CompactDrawerLength, DisplayMode (SplitViewDisplayMode), DrawerBreakpointLength (size at which it switches to overlay; 0 disables), IsOpen, IsGestureEnabled (swipe), BackdropBrush, plus header/footer/icon slots (DrawerHeader, DrawerFooter, DrawerIcon, their *Templates and *Background/*Foreground):

xml
<DrawerPage DrawerLength="260" DrawerBreakpointLength="800" IsGestureEnabled="True">
  <DrawerPage.Drawer>
    <!-- nav list: same ListBox.nav recipe as the SplitView sidebar -->
  </DrawerPage.Drawer>
  <DrawerPage.Content>
    <ContentControl Content="{Binding CurrentView}"/>
  </DrawerPage.Content>
</DrawerPage>

Guidance: it replaces the hand-rolled "sidebar on desktop, overlay on compact" SplitView logic by using DrawerBreakpointLength instead of code-behind width switches. Page lifecycle events fire after transitions complete.

Adaptive nav (single source of truth)

csharp
NavigationView.PaneDisplayMode = window.Bounds.Width switch
{
    < 640  => NavigationViewPaneDisplayMode.LeftMinimal,
    < 1024 => NavigationViewPaneDisplayMode.LeftCompact,
    _      => NavigationViewPaneDisplayMode.Left
};

Spacing Rhythm in Layouts

  • Page padding: 24–32 px on desktop, 16 px on compact.
  • Section spacing: Space6 (24 px) between major sections, Space4 (16 px) within.
  • Card padding: PaddingCard (20 px).
  • StackPanel.Spacing instead of per-child Margin (cleaner, less drift).

Avoid Margin and Padding collision — pick one.


ScrollViewer Discipline

  • Wrap only the scrollable region, not the whole window — let headers/footers stay fixed.
  • One vertical scroll axis per view; nested scroll regions break wheel/trackpad UX.
  • Set HorizontalScrollBarVisibility="Disabled" on vertical lists to prevent accidental horizontal scroll.
  • For long lists, use a VirtualizingStackPanel (default in ListBox/ItemsRepeater) — never a regular StackPanel for 100+ items.
xml
<ListBox ItemsSource="{Binding Items}">
  <ListBox.ItemsPanel>
    <ItemsPanelTemplate>
      <VirtualizingStackPanel Orientation="Vertical"/>
    </ItemsPanelTemplate>
  </ListBox.ItemsPanel>
</ListBox>

For grid virtualization, use ItemsRepeater with StackLayout or UniformGridLayout.


Window Chrome

11.x:

xml
<Window ExtendClientAreaToDecorationsHint="True"
        ExtendClientAreaTitleBarHeightHint="-1"
        ExtendClientAreaChromeHints="PreferSystemChrome">

Hints ((11.x) only — ExtendClientAreaChromeHints is removed in 12):

  • PreferSystemChrome — keep OS controls (recommended).
  • NoChrome — fully custom (provide your own min/max/close buttons).
  • OSXThickTitleBar — macOS thicker bar with traffic lights inset.

12.0+:

xml
<Window ExtendClientAreaToDecorationsHint="True"
        ExtendClientAreaTitleBarHeightHint="-1"
        WindowDecorations="Full">
  • Window.WindowDecorations (enum WindowDecorations: Full = default, BorderOnly = border without title bar, None) replaces SystemDecorations and ExtendClientAreaChromeHints. SystemDecorations is obsolete in 12.
  • ExtendClientAreaToDecorationsHint stays; on Windows it now works in all scenarios, so remove old maximized-margin workarounds.
  • Themeable client-side decorations (12.0+): WindowDrawnDecorations (namespace Avalonia.Controls.Chrome) is a logical element (derives from Animatable, not Control) that manages app-drawn decorations: Template (IWindowDrawnDecorationsTemplate), HasTitleBar/HasBorder/HasShadow, TitleBarHeight/FrameThickness/ShadowThickness (effective values; theme sets the Default* ones), Title. It is supplied by the theme, not placed in window XAML; it replaces Chrome.TitleBar, CaptionButtons and ChromeOverlayLayer (removed). Restyle it through the theme instead of overlaying your own buttons. Member-level docs: WindowDecorationProperties, IWindowDrawnDecorationsTemplate in the same namespace; read them before writing a custom template.
  • Windows 11 corner rounding (12.1+): attached property Win32Properties.WindowCornerPreference (nested enum Win32Properties.WindowCornerPreference, namespace Avalonia.Controls: Default, DoNotRound, Round, RoundSmall; maps to DWM DWM_WINDOW_CORNER_PREFERENCE). XAML: <Window Win32Properties.WindowCornerPreference="RoundSmall">; code: Win32Properties.SetWindowCornerPreference(window, Win32Properties.WindowCornerPreference.DoNotRound). Works only on Windows 11 (build 22000+), ignored elsewhere.

Reserve 40 px top safe area for the drag region. Add a DragRegion element with IsHitTestVisible="True" and listen for pointer drag if going chromeless.


Mobile-Specific (Avalonia.Mobile)

  • Use SafeAreaPadding from TopLevel.InsetsManager:
    csharp
    var insets = TopLevel.GetTopLevel(this)!.InsetsManager;
    insets.DisplayEdgeToEdge = true;
  • Bottom nav must respect home-indicator inset.
  • Touch targets ≥44×44 dp.
  • One vertical scroll axis only.

Common Mistakes

  • Fixed pixel widths on the whole layout — breaks at small windows. Use * Grid columns.
  • StackPanel for a 500-item list — laggy; use ListBox/ItemsRepeater (virtualized).
  • Two vertical scroll regions stacked — wheel doesn't know which to scroll.
  • No MaxWidth on long-form text — line length exceeds 90 chars and hurts readability.
  • Sidebar always visible at 800px window — content gets cramped; collapse to overlay.
  • Putting nav in a Window and content in a Window separately — single-window app should use SplitView/NavigationView.
  • Hardcoded margins like 12,8,15,4 — break the spacing scale; use tokens.
  • Forgetting RowDefinitions="Auto,*" — content expands wrongly.
  • Mixing DockPanel and Grid semantics in the same panel — confusing layout. Pick one root layout per scope.

Veelgestelde vragen

Wat doet de AI-skill Avalonia Pro Max/Layout Patterns?

Use when designing the page-level layout of an Avalonia app — responsive breakpoints, sidebar vs top-nav vs bottom-nav, dashboard grids, master-detail, settings page, mobile vs desktop adaptive layouts. Covers Grid, DockPanel, SplitView, NavigationView, ItemsRepeater layout strategies.

Waarom Avalonia Pro Max/Layout Patterns gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Avalonia Pro Max/Layout Patterns bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Avalonia Pro Max/Layout Patterns in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-pro-max/layout-patterns. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Avalonia Pro Max/Layout Patterns gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Avalonia Pro Max/Layout Patterns gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Avalonia Pro Max/Layout Patterns ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Avalonia Pro Max/Layout Patterns gratis?

Ja. Deze skill is door linuxdevel op GitHub gepubliceerd onder de licentie MIT. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇