structuring-avalonia-projects
6.2 AvaloniaUI Solution and Project Structure
6.2.1 Project Naming Conventions
SolutionName/
├── SolutionName.Abstractions // .NET Class Library (Interface, abstract class, and other abstract types)
├── SolutionName.Core // .NET Class Library (Business logic, pure C#)
├── SolutionName.Core.Tests // xUnit Test Project
├── SolutionName.ViewModels // .NET Class Library (MVVM ViewModel)
├── SolutionName.AvaloniaServices // Avalonia Class Library (Avalonia-related services)
├── SolutionName.AvaloniaLib // Avalonia Class Library (Reusable components)
├── SolutionName.AvaloniaApp // Avalonia Application Project (Entry point)
├── SolutionName.UI // Avalonia Custom Control Library (Custom controls)
└── [Solution Folders]
├── SolutionName/ // Main project group
└── Common/ // Common project group
Naming by Project Type:
.Abstractions: .NET Class Library - Defines abstract types like Interface, abstract class (Inversion of Control).Core: .NET Class Library - Business logic, data models, services (UI framework independent).Core.Tests: xUnit/NUnit/MSTest Test Project.ViewModels: .NET Class Library - MVVM ViewModel (UI framework independent).AvaloniaServices: Avalonia Class Library - Avalonia-related services (DialogService, NavigationService, etc.).AvaloniaLib: Avalonia Class Library - Reusable UserControl, Window, Converter, Behavior, AttachedProperty.AvaloniaApp: Avalonia Application Project - Entry point, App.axaml.UI: Avalonia Custom Control Library - ControlTheme-based custom controls
Project Dependency Hierarchy:
SolutionName.AvaloniaApp
↓ references
SolutionName.Abstractions (Top layer - does not depend on other projects)
↓ references
SolutionName.Core
Role of the Abstractions Layer:
- Houses all Interfaces and abstract classes
- Dependency inversion through abstract types instead of direct references to concrete types (Dependency Inversion Principle)
- Actual implementations injected via DI container at runtime
- Can be replaced with Mock objects during testing
More from christian289/dotnet-with-claudecode
converting-html-css-to-wpf-xaml
Converts HTML/CSS to WPF CustomControl XAML with correct patterns and common pitfall solutions. Use when transforming web designs to WPF, converting CSS animations to Storyboards, implementing CSS border-radius clipping, CSS pseudo-elements (::before/::after), or CSS transforms in XAML.
56publishing-wpf-apps
Guides WPF application publishing and installer options. Use when user mentions publish, deploy, release, packaging, or installer to help choose deployment method and installer technology.
14using-avalonia-collectionview
Provides CollectionView alternatives for AvaloniaUI using DataGridCollectionView and ReactiveUI. Use when filtering, sorting, or grouping collections in AvaloniaUI applications.
9designing-avalonia-customcontrol-architecture
Defines the basic solution structure for AvaloniaUI Desktop Applications using CustomControl. Use when creating new AvaloniaUI projects or designing stand-alone control styles with ControlTheme.
9using-xaml-property-element-syntax
Converts long inline XAML bindings to Property Element Syntax for better readability. Use when XAML binding expressions become too long or complex.
8managing-styles-resourcedictionary
Manages WPF Style definitions and ResourceDictionary patterns including BasedOn inheritance and resource merging. Use when building theme systems, organizing resources, or choosing between StaticResource and DynamicResource.
8