Avalonia Pro Max/Components 标志

Avalonia Pro Max/Components

社区
linuxdevel
avalonia-pro-max/components

Use when building production-quality Avalonia screens — copy-paste XAML recipes for cards, primary/secondary/icon buttons, dialogs, sidebar nav, command bar, settings page, forms with validation, empty states, toasts, badges, skeletons. All recipes use semantic tokens from the design-system sub-skill.

概览

发布者linuxdevel
代码仓库Avalonia-skills
技能名称avalonia-pro-max/components
星标数
50
复刻数
4
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 linuxdevel 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Avalonia Pro Max/Components AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-pro-max/components
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

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/components .claude/skills/linuxdevel-avalonia-pro-max-components
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Avalonia Pro Max/Components,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Avalonia Pro Max/Components。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Avalonia Pro Max/Components 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Component Recipes

All recipes assume the design tokens from avalonia-pro-max/design-system are loaded (SurfaceBrush, AccentBrush, TextPrimaryBrush, RadiusLg, Space*, etc.).


Buttons

Reusable Button Styles

xml
<!-- Styles/Buttons.axaml -->
<Styles xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

  <!-- Base: applies to all Button -->
  <Style Selector="Button">
    <Setter Property="MinHeight" Value="36"/>
    <Setter Property="Padding" Value="14,8"/>
    <Setter Property="CornerRadius" Value="{StaticResource RadiusMd}"/>
    <Setter Property="FontWeight" Value="Medium"/>
    <Setter Property="Cursor" Value="Hand"/>
    <Setter Property="Transitions">
      <Transitions>
        <BrushTransition Property="Background" Duration="0:0:0.15"/>
        <BrushTransition Property="Foreground" Duration="0:0:0.15"/>
        <TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.10"/>
      </Transitions>
    </Setter>
    <Setter Property="RenderTransform" Value="none"/>
  </Style>

  <Style Selector="Button:pressed">
    <Setter Property="RenderTransform" Value="scale(0.98)"/>
  </Style>

  <!-- Primary -->
  <Style Selector="Button.primary">
    <Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
    <Setter Property="Foreground" Value="{DynamicResource TextOnAccentBrush}"/>
  </Style>
  <Style Selector="Button.primary:pointerover /template/ ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource AccentBrush}"/>
    <Setter Property="Opacity" Value="0.9"/>
  </Style>

  <!-- Secondary (outline) -->
  <Style Selector="Button.secondary">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
    <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
    <Setter Property="BorderThickness" Value="1"/>
  </Style>
  <Style Selector="Button.secondary:pointerover /template/ ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SurfaceMutedBrush}"/>
  </Style>

  <!-- Ghost -->
  <Style Selector="Button.ghost">
    <Setter Property="Background" Value="Transparent"/>
    <Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}"/>
  </Style>
  <Style Selector="Button.ghost:pointerover /template/ ContentPresenter">
    <Setter Property="Background" Value="{DynamicResource SurfaceMutedBrush}"/>
  </Style>

  <!-- Danger -->
  <Style Selector="Button.danger">
    <Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
    <Setter Property="Foreground" Value="White"/>
  </Style>

  <!-- Icon-only (square) -->
  <Style Selector="Button.icon">
    <Setter Property="Padding" Value="8"/>
    <Setter Property="MinHeight" Value="36"/>
    <Setter Property="MinWidth" Value="36"/>
  </Style>

  <!-- Sizes -->
  <Style Selector="Button.sm">
    <Setter Property="MinHeight" Value="28"/>
    <Setter Property="Padding" Value="10,4"/>
    <Setter Property="FontSize" Value="13"/>
  </Style>
  <Style Selector="Button.lg">
    <Setter Property="MinHeight" Value="44"/>
    <Setter Property="Padding" Value="20,12"/>
    <Setter Property="FontSize" Value="15"/>
  </Style>

  <!-- Disabled override -->
  <Style Selector="Button:disabled">
    <Setter Property="Opacity" Value="0.5"/>
    <Setter Property="Cursor" Value="Arrow"/>
  </Style>
</Styles>

Usage:

xml
<Button Classes="primary" Content="Save"/>
<Button Classes="secondary" Content="Cancel"/>
<Button Classes="ghost icon" ToolTip.Tip="Settings"
        AutomationProperties.Name="Settings">
  <PathIcon Data="{StaticResource SettingsIconGeometry}"/>
</Button>
<Button Classes="danger" Content="Delete account"/>
<Button Classes="primary lg" Content="Get started"/>

Card

xml
<Border Classes="card">
  <StackPanel Spacing="{StaticResource Space2}">
    <TextBlock Classes="h3" Text="Total revenue"/>
    <TextBlock FontSize="{StaticResource FontSize2xl}"
               FontWeight="SemiBold"
               Text="$48,294"/>
    <TextBlock Classes="muted" Text="+12.4% vs last month"/>
  </StackPanel>
</Border>
xml
<Style Selector="Border.card">
  <Setter Property="Background" Value="{DynamicResource SurfaceElevatedBrush}"/>
  <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
  <Setter Property="BorderThickness" Value="1"/>
  <Setter Property="CornerRadius" Value="{StaticResource RadiusLg}"/>
  <Setter Property="Padding" Value="{StaticResource PaddingCard}"/>
  <Setter Property="BoxShadow" Value="{StaticResource ShadowSm}"/>
</Style>

<Style Selector="Border.card.interactive">
  <Setter Property="Cursor" Value="Hand"/>
  <Setter Property="Transitions">
    <Transitions>
      <BoxShadowsTransition Property="BoxShadow" Duration="0:0:0.15"/>
    </Transitions>
  </Setter>
</Style>
<Style Selector="Border.card.interactive:pointerover">
  <Setter Property="BoxShadow" Value="{StaticResource ShadowMd}"/>
</Style>

Labeled section (GroupBox, 12.0+)

For a titled group of related controls (settings groups, filter panels) use the built-in GroupBox instead of a hand-built Border + header TextBlock. It is a HeaderedContentControl (Header, Content) that you can style via Border.card-style tokens:

xml
<GroupBox Header="Notifications">
  <StackPanel Spacing="{StaticResource Space2}">
    <CheckBox Content="Email"/>
    <CheckBox Content="Push"/>
  </StackPanel>
</GroupBox>

In 11.3 GroupBox does not exist — keep the Border.card + header TextBlock pattern above (or a FluentAvalonia/third-party equivalent).


Read-only Table (TableView, 12.1+)

For read-only tabular data in 12.1+, prefer the built-in TableView (Avalonia.Controls, derives from ListBox, virtualized, Columns, CanUserResizeColumns, bound via ItemsSource) over DataGrid. DataGrid (Avalonia.Controls.DataGrid) is in maintenance mode in 12.x. Use DataGrid (or TreeDataGrid) when you need editing, sorting UI or hierarchy, and in 11.3/12.0 where TableView does not exist. Check the TableView docs (https://docs.avaloniaui.net) for current column element names before writing column XAML. Style it with the same tokens as lists: row height >= 36 px, Border header with TextMutedBrush, 1 px row separators, no zebra striping unless the data is wide.


Sidebar Navigation (FluentAvalonia NavigationView)

xml
<ui:NavigationView xmlns:ui="using:FluentAvalonia.UI.Controls"
                   PaneDisplayMode="Left"
                   IsPaneToggleButtonVisible="True"
                   OpenPaneLength="240"
                   IsBackButtonVisible="False"
                   AlwaysShowHeader="False">
  <ui:NavigationView.MenuItems>
    <ui:NavigationViewItem Content="Dashboard" Tag="dashboard">
      <ui:NavigationViewItem.IconSource>
        <ui:SymbolIconSource Symbol="Home"/>
      </ui:NavigationViewItem.IconSource>
    </ui:NavigationViewItem>
    <ui:NavigationViewItem Content="Projects" Tag="projects">
      <ui:NavigationViewItem.IconSource>
        <ui:SymbolIconSource Symbol="Folder"/>
      </ui:NavigationViewItem.IconSource>
    </ui:NavigationViewItem>
    <ui:NavigationViewItemSeparator/>
    <ui:NavigationViewItem Content="Team" Tag="team">
      <ui:NavigationViewItem.IconSource>
        <ui:SymbolIconSource Symbol="People"/>
      </ui:NavigationViewItem.IconSource>
    </ui:NavigationViewItem>
  </ui:NavigationView.MenuItems>

  <ui:NavigationView.FooterMenuItems>
    <ui:NavigationViewItem Content="Settings" Tag="settings">
      <ui:NavigationViewItem.IconSource>
        <ui:SymbolIconSource Symbol="Setting"/>
      </ui:NavigationViewItem.IconSource>
    </ui:NavigationViewItem>
  </ui:NavigationView.FooterMenuItems>

  <ui:Frame x:Name="ContentFrame"/>
</ui:NavigationView>

For non-FluentAvalonia apps, build a sidebar with SplitView:

xml
<SplitView IsPaneOpen="True"
           DisplayMode="CompactInline"
           OpenPaneLength="240"
           CompactPaneLength="56">
  <SplitView.Pane>
    <Border Background="{DynamicResource SurfaceMutedBrush}">
      <ListBox ItemsSource="{Binding NavItems}"
               SelectedItem="{Binding SelectedNav}"
               Background="Transparent">
        <ListBox.ItemTemplate>
          <DataTemplate>
            <StackPanel Orientation="Horizontal" Spacing="12">
              <PathIcon Data="{Binding IconGeometry}" Width="16" Height="16"/>
              <TextBlock Text="{Binding Label}" VerticalAlignment="Center"/>
            </StackPanel>
          </DataTemplate>
        </ListBox.ItemTemplate>
      </ListBox>
    </Border>
  </SplitView.Pane>
  <ContentControl Content="{Binding CurrentView}"/>
</SplitView>

App Shell (Title bar + sidebar + content)

Version notes: ExtendClientAreaToDecorationsHint / ExtendClientAreaTitleBarHeightHint below work in 11.x and 12.x (on Windows 12.0+ the old margin-when-maximized workarounds must be removed). ExtendClientAreaChromeHints is removed in 12 and SystemDecorations is replaced by WindowDecorations — see layout-patterns (Window Chrome).

xml
<Window xmlns="https://github.com/avaloniaui"
        ExtendClientAreaToDecorationsHint="True"
        ExtendClientAreaTitleBarHeightHint="40"
        TransparencyLevelHint="AcrylicBlur"
        Background="Transparent">
  <Panel>
    <ExperimentalAcrylicBorder IsHitTestVisible="False">
      <ExperimentalAcrylicBorder.Material>
        <ExperimentalAcrylicMaterial
          BackgroundSource="Digger"
          TintColor="{DynamicResource SurfaceBackgroundColor}"
          TintOpacity="1"
          MaterialOpacity="0.65"/>
      </ExperimentalAcrylicBorder.Material>
    </ExperimentalAcrylicBorder>

    <DockPanel>
      <!-- Custom title bar -->
      <Border DockPanel.Dock="Top" Height="40"
              IsHitTestVisible="False">
        <TextBlock Text="My App" Margin="16,0"
                   VerticalAlignment="Center"
                   Foreground="{DynamicResource TextSecondaryBrush}"/>
      </Border>

      <!-- Main content -->
      <ContentControl Content="{Binding CurrentView}"/>
    </DockPanel>
  </Panel>
</Window>

Dialog (FluentAvalonia ContentDialog)

csharp
var dialog = new ContentDialog
{
    Title = "Delete project?",
    Content = "This action cannot be undone. All files will be permanently deleted.",
    PrimaryButtonText = "Delete",
    CloseButtonText = "Cancel",
    DefaultButton = ContentDialogButton.Close
};
dialog.PrimaryButtonClick += (_, _) => viewModel.ConfirmDelete();
await dialog.ShowAsync();

For destructive actions, style the primary button with the danger class via PrimaryButtonStyle.


Form with Inline Validation

xml
<StackPanel Spacing="{StaticResource Space4}" MaxWidth="400">

  <StackPanel Spacing="{StaticResource Space1}">
    <TextBlock Text="Email" Classes="label"/>
    <TextBox Text="{Binding Email, Mode=TwoWay,
                            UpdateSourceTrigger=LostFocus}"
             PlaceholderText="you@example.com"/>  <!-- (12.0+); use Watermark="..." (11.x) in 11.3 projects -->
    <TextBlock Text="{Binding EmailError}"
               IsVisible="{Binding HasEmailError}"
               Classes="error"/>
  </StackPanel>

  <StackPanel Spacing="{StaticResource Space1}">
    <TextBlock Text="Password" Classes="label"/>
    <TextBox PasswordChar="•"
             Text="{Binding Password, Mode=TwoWay}"/>
    <TextBlock Text="At least 12 characters" Classes="helper"/>
  </StackPanel>

  <Button Classes="primary lg"
          Content="Create account"
          Command="{Binding CreateAccountCommand}"
          IsEnabled="{Binding !IsBusy}"
          HorizontalAlignment="Stretch"/>
</StackPanel>
xml
<Style Selector="TextBlock.label">
  <Setter Property="FontSize" Value="13"/>
  <Setter Property="FontWeight" Value="Medium"/>
  <Setter Property="Foreground" Value="{DynamicResource TextSecondaryBrush}"/>
</Style>
<Style Selector="TextBlock.helper">
  <Setter Property="FontSize" Value="12"/>
  <Setter Property="Foreground" Value="{DynamicResource TextMutedBrush}"/>
</Style>
<Style Selector="TextBlock.error">
  <Setter Property="FontSize" Value="12"/>
  <Setter Property="Foreground" Value="{DynamicResource DangerBrush}"/>
</Style>
<Style Selector="TextBox:error /template/ Border#PART_BorderElement">
  <Setter Property="BorderBrush" Value="{DynamicResource DangerBrush}"/>
</Style>

Use INotifyDataErrorInfo on the ViewModel; the :error pseudoclass auto-applies.


Empty State

xml
<Border Classes="card">
  <StackPanel Spacing="{StaticResource Space4}"
              HorizontalAlignment="Center"
              Margin="0,48">
    <PathIcon Data="{StaticResource InboxIconGeometry}"
              Width="48" Height="48"
              Foreground="{DynamicResource TextMutedBrush}"/>
    <TextBlock Classes="h3" Text="No projects yet"
               HorizontalAlignment="Center"/>
    <TextBlock Classes="muted"
               Text="Create your first project to get started"
               HorizontalAlignment="Center"
               TextAlignment="Center"
               MaxWidth="280"/>
    <Button Classes="primary"
            Content="New project"
            HorizontalAlignment="Center"
            Command="{Binding CreateProjectCommand}"/>
  </StackPanel>
</Border>

Toast / Notification (Avalonia built-in)

csharp
// In Window/UserControl
private WindowNotificationManager _notif;

protected override void OnLoaded(RoutedEventArgs e)
{
    base.OnLoaded(e);
    _notif = new WindowNotificationManager(TopLevel.GetTopLevel(this))
    {
        Position = NotificationPosition.BottomRight,
        MaxItems = 3
    };
}

_notif.Show(new Notification(
    "Project created",
    "‘Acme website redesign’ is ready.",
    NotificationType.Success));

Badge

xml
<Border CornerRadius="{StaticResource RadiusFull}"
        Background="{DynamicResource AccentBrush}"
        Padding="8,2"
        VerticalAlignment="Center">
  <TextBlock Text="{Binding Count}"
             FontSize="11"
             FontWeight="SemiBold"
             Foreground="White"/>
</Border>

Status variants: swap Background to SuccessBrush, WarningBrush, DangerBrush, or muted (SurfaceMutedBrush + TextSecondaryBrush).


Skeleton (loading placeholder)

xml
<Border Background="{DynamicResource SurfaceMutedBrush}"
        CornerRadius="{StaticResource RadiusSm}"
        Height="14" Width="180">
  <Border.Styles>
    <Style Selector="Border">
      <Style.Animations>
        <Animation Duration="0:0:1.4" IterationCount="Infinite">
          <KeyFrame Cue="0%"><Setter Property="Opacity" Value="0.4"/></KeyFrame>
          <KeyFrame Cue="50%"><Setter Property="Opacity" Value="0.8"/></KeyFrame>
          <KeyFrame Cue="100%"><Setter Property="Opacity" Value="0.4"/></KeyFrame>
        </Animation>
      </Style.Animations>
    </Style>
  </Border.Styles>
</Border>

Use Ursa.Avalonia's Skeleton control if you depend on Ursa.


Settings Row (FluentAvalonia SettingsExpander pattern)

xml
<StackPanel Spacing="{StaticResource Space3}">
  <ui:SettingsExpander Header="Appearance"
                       Description="Choose how the app looks">
    <ui:SettingsExpander.IconSource>
      <ui:SymbolIconSource Symbol="Color"/>
    </ui:SettingsExpander.IconSource>
    <ui:SettingsExpanderItem Content="Theme">
      <ui:SettingsExpanderItem.Footer>
        <ComboBox SelectedItem="{Binding SelectedTheme}"
                  ItemsSource="{Binding ThemeOptions}"
                  MinWidth="160"/>
      </ui:SettingsExpanderItem.Footer>
    </ui:SettingsExpanderItem>
    <ui:SettingsExpanderItem Content="Accent color">
      <ui:SettingsExpanderItem.Footer>
        <ColorPicker Color="{Binding AccentColor}"/>
      </ui:SettingsExpanderItem.Footer>
    </ui:SettingsExpanderItem>
  </ui:SettingsExpander>
</StackPanel>

Common Mistakes

  • Hand-rolling button styles per view — define once in Styles/Buttons.axaml, use Classes="..." everywhere.
  • Padding="10" on an icon-only button — total target shrinks below 36px, fails 44pt accessibility on touch.
  • Forgetting AutomationProperties.Name on icon-only buttons — screen readers announce nothing.
  • Validating with red-only feedback — combine :error border with helper text.
  • Using Watermark in a 12.x project — obsolete; use PlaceholderText (12.0+) and PlaceholderForeground (12.0+, TextBox/AutoCompleteBox/CalendarDatePicker/NumericUpDown) to tint it from tokens.
  • Cards stacked at the same elevation — use ShadowSm or 1px border, not ShadowLg, for in-page cards.
  • Using ContentDialog for non-blocking info — use a toast/notification instead.

常见问题

Avalonia Pro Max/Components AI 技能有什么作用?

Use when building production-quality Avalonia screens — copy-paste XAML recipes for cards, primary/secondary/icon buttons, dialogs, sidebar nav, command bar, settings page, forms with validation, empty states, toasts, badges, skeletons. All recipes use semantic tokens from the design-system sub-skill.

为什么在 TypingMind 中使用 Avalonia Pro Max/Components?

因为您只需安装一次,就能搭配任何模型使用。Avalonia Pro Max/Components 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Avalonia Pro Max/Components?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/linuxdevel/Avalonia-skills/tree/main/skills/avalonia/avalonia-pro-max/components。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Avalonia Pro Max/Components?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Avalonia Pro Max/Components 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Avalonia Pro Max/Components 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Avalonia Pro Max/Components AI 技能免费吗?

是的。linuxdevel 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇