Skip to content

DefaultViewLocator.ResolveView(TViewModel, string?) method

Defined in

Type: DefaultViewLocator Namespace: ReactiveUI.Binding.Reactive Assembly: ReactiveUI.Binding.Reactive.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-ios18.0, net9.0-macos15.0, net9.0-desktop1.0, net8.0, net8.0-macos14.5, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, netstandard2.1, net481, net462, net471

Overloads

  • 1. public IViewFor? ResolveView<TViewModel>(TViewModel viewModel, string? contract) where TViewModel : class
  • 2. public IViewFor? ResolveView(object? viewModel, string? contract)

1. Overload

public IViewFor? ResolveView<TViewModel>(TViewModel viewModel, string? contract) where TViewModel : class

View source

Inherited documentation

These docs were inherited from IViewLocator. The member doesn't override them on this type.

Summary: Resolves a view for the specified view model type. This overload is AOT-safe when registered mappings are available.

Type parameters

NameDescription
TViewModelThe type of the view model.

Parameters

NameTypeDescription
viewModelTViewModelThe view model instance to resolve a view for.
contractstring?An optional contract string for named registrations.

Returns: IViewFor? -- The resolved view, or null if no view is found.

2. Overload

Attributes: [RequiresDynamicCode("Resolving a view from an object closes IViewFor<> over its runtime type. Use the generic overload, or register the view, to stay ahead-of-time safe.")]

public IViewFor? ResolveView(object? viewModel, string? contract)

View source

Inherited documentation

These docs were inherited from IViewLocator. The member doesn't override them on this type.

Summary: Resolves a view for the specified view model instance using runtime type dispatch. Uses source-generated dispatch when available, followed by explicit mappings, then falls back to service locator lookup.

Parameters

NameTypeDescription
viewModelobject?The view model instance to resolve a view for.
contractstring?An optional contract string for named registrations.

Returns: IViewFor? -- The resolved view, or null if no view is found.