How kaic-eder/avaloniaestudos works
1. This repository is a .NET/Avalonia desktop solution containing four separate sample applications: AvaloniaEstudos, MVVMPattern, MusicStore, and ToDoApp. They are not one monolith; each project has its own Program.cs, App.axaml, views, and viewmodels.
2. The common architectural baseline across all projects is Avalonia UI with XAML views and the MVVM pattern. The typical data flow is: user interaction in a View binds to a ViewModel, which updates Model state or calls a small service, then the UI refreshes through binding.
3. Each app follows the standard Avalonia bootstrap path: Program.cs starts the app, App.axaml defines application-level resources and startup behavior, and ViewLocator.cs supports mapping viewmodels to views for navigation/presentation.
4. AvaloniaEstudos is the simplest starter app. It contains a single main window (Views/MainWindow.axaml) backed by ViewModels/MainWindowViewModel.cs, plus the usual ViewModelBase. This looks like a minimal shell for learning Avalonia mechanics.
5. MVVMPattern is a focused pattern demo. It adds SimpleViewModel alongside MainWindowViewModel, suggesting it is meant to show how multiple viewmodels can be structured and swapped into the same window/view infrastructure.
6. ToDoApp is a small domain-oriented sample. Its architecture is model-driven: Models/ToDoItem.cs represents the data entity, ViewModels/ToDoItemViewModel.cs adapts it for the UI, and MainWindowViewModel likely coordinates the list and user actions. This is a straightforward model-to-viewmodel-to-view pipeline.
7. MusicStore is the richest subsystem and has clearer layering. It separates Models (Album), Services (AlbumService), ViewModels (AlbumViewModel, MusicStoreViewModel, MainWindowViewModel), and Views (AlbumView, MusicStoreView, MusicStoreWindow). This creates a distinct domain/service layer beneath the UI layer.
8. MusicStore also includes a Messages folder with several message types such as PurchaseAlbumMessage, NotificationMessage, CheckAlbumAlreadyExistsMessage, and MusicStoreClosedMessage. That strongly suggests in-process decoupled communication between viewmodels or components, rather than direct tight coupling.
9. The most likely MusicStore flow is: user actions in a view trigger a viewmodel, the viewmodel calls AlbumService or publishes/consumes messages, and other viewmodels or UI surfaces react to those messages. This is the main architectural boundary in the repo: UI interaction, domain logic, and cross-component coordination are separated.
10. Assets and Assets/Resources hold application resources such as Icons.axaml in MusicStore. These are UI-supporting assets rather than core logic, but they matter for understanding that visual resources are centralized at the app level.
11. The app.manifest files indicate each desktop app is packaged as its own Windows application. There is no sign of backend APIs, databases, or external services in the file tree; the architecture is entirely client-side desktop UI with local in-memory/domain services.
12. For an architecture diagram, the key boundaries are: solution-level separation between apps, per-app Avalonia bootstrap, MVVM UI boundary, optional service layer (MusicStore), and message-based coordination inside the richer sample. The repo is primarily a teaching/experimentation workspace for Avalonia desktop patterns rather than a single integrated product.
Main entry points: MusicStoreViewModel.cs Store VM · AvaloniaEstudos/App.axaml App · MVVMPattern/App.axaml App · MainWindowViewModel.cs Main VM
Components 31
Workspace
Solution-level desktop samples built with Avalonia and MVVM.
- Workspace · Repository contains four independent Avalonia desktop apps.
AvaloniaEstudos
Minimal Avalonia starter app.
- Program · App entry point.
AvaloniaEstudos/Program.cs - App · Application resources and startup wiring.
AvaloniaEstudos/App.axaml - View locator · Maps viewmodels to views for presentation.
AvaloniaEstudos/ViewLocator.cs - Main VM · Main window state and interaction logic.
AvaloniaEstudos/ViewModels/MainWindowViewModel.cs - Main window · Primary UI surface for the starter app.
AvaloniaEstudos/Views/MainWindow.axaml
MVVMPattern
Pattern-focused MVVM demo app.
- Program · App entry point.
MVVMPattern/Program.cs - App · Application resources and startup wiring.
MVVMPattern/App.axaml - View locator · Maps viewmodels to views for presentation.
MVVMPattern/ViewLocator.cs - Main VM · Primary window state.
MVVMPattern/ViewModels/MainWindowViewModel.cs - Simple VM · Secondary viewmodel used to demonstrate swapping and composition.
MVVMPattern/ViewModels/SimpleViewModel.cs - Main window · Primary UI surface for the pattern demo.
MVVMPattern/Views/MainWindow.axaml
MusicStore
Richest sample with model, service, viewmodel, and message layers.
- Program · App entry point.
MusicStore/Program.cs - App · Application resources and startup wiring.
MusicStore/App.axaml - View locator · Maps viewmodels to views for presentation.
MusicStore/ViewLocator.cs - Album · Domain entity for album data.
MusicStore/Models/Album.cs - Album service · Business/data operations for albums.
MusicStore/Services/AlbumService.cs - Album VM · Adapts album data for the UI.
MusicStore/ViewModels/AlbumViewModel.cs - Store VM · Coordinates store behavior and messaging.
MusicStore/ViewModels/MusicStoreViewModel.cs - Main VM · Top-level window state for the music store.
MusicStore/ViewModels/MainWindowViewModel.cs - Store view · Main store interaction surface.
MusicStore/Views/MusicStoreView.axaml - Store window · Outer music store window shell.
MusicStore/Views/MusicStoreWindow.axaml - Messages · In-process coordination messages between components.
- Resources · Centralized icons and UI resource dictionaries.
MusicStore/Assets/Resources/Icons.axaml
ToDoApp
Small model-driven task sample.
- Program · App entry point.
ToDoApp/Program.cs - App · Application resources and startup wiring.
ToDoApp/App.axaml - View locator · Maps viewmodels to views for presentation.
ToDoApp/ViewLocator.cs - To-do item · Task data entity.
ToDoApp/Models/ToDoItem.cs - Item VM · UI adapter for a to-do item.
ToDoApp/ViewModels/ToDoItemViewModel.cs - Main VM · Coordinates list and user actions.
ToDoApp/ViewModels/MainWindowViewModel.cs - Main window · Primary task list UI.
ToDoApp/Views/MainWindow.axaml
Connections 36
- Workspace → Program: contains · Workspace includes the AvaloniaEstudos app.
- Workspace → Program: contains · Workspace includes the MVVMPattern app.
- Workspace → Program: contains · Workspace includes the MusicStore app.
- Workspace → Program: contains · Workspace includes the ToDoApp app.
- Program → App: starts · Bootstrap loads application shell.
- App → View locator: uses · App resolves views from viewmodels.
- App → Main VM: hosts · Main window is driven by the main viewmodel.
- View locator → Main window: maps to · View locator binds the main viewmodel to the main view.
- Main VM → Main window: binds · View interactions flow through bindings.
- Program → App: starts · Bootstrap loads application shell.
- App → View locator: uses · App resolves views from viewmodels.
- App → Main VM: hosts · Main window is driven by the main viewmodel.
- Main VM → Simple VM: swaps · Demo demonstrates alternative viewmodel composition.
- View locator → Main window: maps to · View locator binds the viewmodels to the main view.
- Main VM → Main window: binds · UI is updated through MVVM bindings.
- Program → App: starts · Bootstrap loads application shell.
- App → View locator: uses · App resolves views from viewmodels.
- App → Main VM: hosts · Top-level store window state is attached here.
- Main VM → Store VM: orchestrates · Main VM delegates store behavior to the store VM.
- Store VM → Album service: calls · Business operations are handled by the album service.
- Album service → Album: manages · Service operates on album domain objects.
- Album VM → Album: adapts · Album viewmodel wraps domain model data for the UI.
- Store VM → Messages: publishes/consumes · Store coordination is message-driven.
- Messages → Album VM: notifies · Messages decouple album-related interactions.
- Messages → Store view: signals · Views and viewmodels react to shared messages.
- View locator → Store window: maps to · View locator connects window and view surfaces.
- View locator → Store view: maps to · View locator connects store content views.
- Store view → Store VM: binds · Store UI binds to the store viewmodel.
- Main VM → Resources: uses · UI resources support the store shell.
- Program → App: starts · Bootstrap loads application shell.
- App → View locator: uses · App resolves views from viewmodels.
- App → Main VM: hosts · Main window is driven by the main viewmodel.
- Main VM → Item VM: contains · List coordination uses item viewmodels.
- Item VM → To-do item: adapts · Item viewmodel wraps the domain model.
- View locator → Main window: maps to · View locator binds the main viewmodel to the main view.
- Main VM → Main window: binds · Task UI is updated through MVVM bindings.