-
Notifications
You must be signed in to change notification settings - Fork 0
Create ViewModels and navigation
Jeppe Roi Kristensen edited this page Mar 11, 2025
·
1 revision
The following platforms are allowed to create a view model
- WPF
- Avalonia
- MAUI
- WINUI
With the exception of WinUI when creating a view model for a view a type attribute will be added to the xaml view to "link" the two.
For instance for WPF it will be through a d:DataContext attribute and in Avalonia and Maui it will be through the x:DataType attribute.
For WinUI where the view model is typically not declared in the xaml view, it will be set directly in the code behind instead.
public SomeViewModel ViewModel {get;set;}
I