Project Structure
Asv.Avalonia projects use a consistent layout. The top level separates application features from their integration with the shell, while files inside each area are grouped by purpose and feature. The framework, the Asv.Avalonia.Example application, and the built-in modules follow the same convention.
Standard layout
The main Asv.Avalonia project has the following structure:
Core/contains application services, reusable controls, shared view models, converters, events, and dialogs.Core/Services/groups services by feature. A feature folder usually contains its interfaces, implementation, configuration, and registration file.Core/Controls/contains reusable controls together with their view models and related files.Shell/contains the application shell and the features displayed in it.Shell/Pages/groups pages by feature. A page folder contains its view, view model, extensions, and registration file.Shell/MainMenu/,Shell/Status/, andShell/Window/contain the corresponding parts of the shell.
Registration file placement
Registration files follow the folder structure. Common areas have an aggregate registration file, such as CoreRegistrations.cs, ServicesRegistrations.cs, or PagesRegistrations.cs. Feature-specific registration files are placed next to the feature they register, for example Core/Services/Theme/ThemeRegistrations.cs.
See Dependency Injection for details on registration builders and application composition.
Application example
An application can use the same structure for its own services and shell features:
Keeping the same layout makes framework, module, and application code easier to navigate. The Asv.Avalonia.Example project can be used as a reference when organizing a new application.
The Recipe Book App tutorial builds a complete application on Asv.Avalonia using this architecture step by step.