Architecture
Use MVVM with CommunityToolkit.Mvvm — source-generated ObservableObject, RelayCommand, and messaging.
- NavigationView + Frame SHOULD be used for page-level navigation
- Navigation service abstraction in the ViewModel layer — code-behind MUST NOT manipulate Frame directly
- Use Template Studio for project scaffolding with MVVM, navigation, and theming pre-wired
// ViewModel with CommunityToolkit.Mvvm source generators
[ObservableObject]
public partial class MainViewModel
{
[ObservableProperty]
private string _title = "Home";
[RelayCommand]
private async Task LoadDataAsync()
{
var data = await _dataService.FetchAsync();
Title = data.Name;
}
}