ServiceProviderViewLocator class

Namespace Runic.Application.Views · Runic.Application 0.7.0-preview.5

public sealed class ServiceProviderViewLocator : IRunicViewLocator

Inherits or implements IRunicViewLocator.

Resolves each presented View from the window's service provider. Generated AddRunicViews() registrations make this the default locator and register every non-Window View as transient. A View contract is already a distinct View type, so the contract needs no separate lookup.

Constructors

ServiceProviderViewLocator

public ServiceProviderViewLocator(IServiceProvider services)

Resolves each presented View from the window's service provider. Generated AddRunicViews() registrations make this the default locator and register every non-Window View as transient. A View contract is already a distinct View type, so the contract needs no separate lookup.

Methods

Locate

public TView Locate<TView, TViewModel>() where TView : class, IRunicView where TViewModel : class

Resolves the default view for TViewModel.

Documentation from IRunicViewLocator.Locate.

Locate

public TView Locate<TView, TViewModel>(string? contract) where TView : class, IRunicView where TViewModel : class

Resolves the view registered for contract, or the default view when it is null.

Documentation from IRunicViewLocator.Locate.