FileSurfer 1.1.4
Modern Windows File Explorer
Loading...
Searching...
No Matches
FileSurfer.ViewLocator Class Reference

The ViewLocator class in Avalonia resolves and instantiates views for given view models by following a naming convention. More...

Inheritance diagram for FileSurfer.ViewLocator:
Collaboration diagram for FileSurfer.ViewLocator:

Public Member Functions

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.

Detailed Description

The ViewLocator class in Avalonia resolves and instantiates views for given view models by following a naming convention.

Member Function Documentation

◆ 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
dataThe 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

Determines if the provided data object is of type MainWindowViewModel.

Parameters
dataThe object to check.
Returns
true if the object is a MainWindowViewModel, otherwise returns false.

The documentation for this class was generated from the following file: