The ViewLocator class in Avalonia resolves and instantiates views for given view models by following a naming convention.
More...
|
Control? | Build (object? data) |
| Resolves and creates the appropriate view for a given view model based on naming conventions.
|
bool | Match (object? data) |
| Determines if the provided data object is of type MainWindowViewModel.
|
The ViewLocator class in Avalonia resolves and instantiates views for given view models by following a naming convention.
◆ Build()
Control? FileSurfer.ViewLocator.Build |
( |
object? | data | ) |
|
|
inline |
Resolves and creates the appropriate view for a given view model based on naming conventions.
If the corresponding view is found, it sets its Avalonia.StyledElement.DataContext to the provided view model, otherwise it returns a fallback view with a "Not Found"
message.
- Parameters
-
data | The view model instance for which to locate and build a corresponding view. |
- Returns
- The constructed view with the view model set as its Avalonia.StyledElement.DataContext, or a TextBlock indicating the view was not found.
◆ Match()
bool FileSurfer.ViewLocator.Match |
( |
object? | data | ) |
|
|
inline |
The documentation for this class was generated from the following file: