avalonia-layout-zafiro
Original:🇺🇸 English
Not Translated
Guidelines for modern Avalonia UI layout using Zafiro.Avalonia, emphasizing shared styles, generic components, and avoiding XAML redundancy.
1installs
Added on
NPX Install
npx skill4agent add sebas-aikon-intelligence/antigravity-awesome-skills avalonia-layout-zafiroSKILL.md Content
Avalonia Layout with Zafiro.Avalonia
Master modern, clean, and maintainable Avalonia UI layouts. Focus on semantic containers, shared styles, and minimal XAML.
🎯 Selective Reading Rule
Read ONLY files relevant to the layout challenge!
📑 Content Map
| File | Description | When to Read |
|---|---|---|
| Theme organization and shared styles | Setting up or refining app themes |
| Semantic containers ( | Structuring views and layouts |
| Icon usage with | Adding and customizing icons |
| | Implementing complex interactions |
| Generic components and avoiding nesting | Creating reusable UI elements |
🔗 Related Project (Exemplary Implementation)
For a real-world example, refer to the Angor project:
/mnt/fast/Repos/angor/src/Angor/Avalonia/Angor.Avalonia.sln✅ Checklist for Clean Layouts
- Used semantic containers? (e.g., instead of
HeaderedContainerwith manual header)Border - Avoided redundant properties? Use shared styles in files.
axaml - Minimized nesting? Flatten layouts using or generic components.
EdgePanel - Icons via extension? Use and
{Icon fa-name}for styling.IconOptions - Behaviors over code-behind? Use for UI-logic.
Interaction.Behaviors - Avoided Converters? Prefer ViewModel properties or Behaviors unless necessary.
❌ Anti-Patterns
DON'T:
- Use hardcoded colors or sizes (literals) in views.
- Create deep nesting of and
Grid.StackPanel - Repeat visual properties across multiple elements (use Styles).
- Use for simple logic that belongs in the ViewModel.
IValueConverter
DO:
- Use for colors and brushes.
DynamicResource - Extract repeated layouts into generic components.
- Leverage specific panels like
Zafiro.Avaloniafor common UI patterns.EdgePanel