DefaultViewLocator.ResolveView() method¶
Defined in
Type: DefaultViewLocator
Namespace: ReactiveUI
Assembly: ReactiveUI.Core.dll
Applies to
net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471
Overloads¶
- 1.
public IViewFor<TViewModel>? ResolveView<TViewModel>() where TViewModel : class - 2.
public IViewFor<TViewModel>? ResolveView<TViewModel>(string? contract) where TViewModel : class - 3.
public IViewFor? ResolveView(object? instance) - 4.
public IViewFor? ResolveView(object? instance, string? contract)
1. Overload¶
public IViewFor<TViewModel>? ResolveView<TViewModel>() where TViewModel : class
Summary: Resolves a view for a view model type using the default contract. Fully AOT-compatible.
Type parameters
| Name | Description |
|---|---|
TViewModel | The view model type to resolve a view for. |
Returns: IViewFor
2. Overload¶
public IViewFor<TViewModel>? ResolveView<TViewModel>(string? contract) where TViewModel : class
Summary: Resolves a view for a view model type known at compile time. Fully AOT-compatible.
Type parameters
| Name | Description |
|---|---|
TViewModel | The view model type to resolve a view for. |
Parameters
| Name | Type | Description |
|---|---|---|
contract | string? | Optional contract to disambiguate between multiple views for the same view model. |
Returns: IViewFor
Remarks
Resolution strategy:
- 1. Check for explicit mapping registered via
Mapwith the specified contract. - 2. Query the service locator for
IViewFor<TViewModel>with the specified contract.
3. Overload¶
Attributes: [RequiresUnreferencedCode("This method uses reflection to determine the view model type at runtime, which may be incompatible with trimming.")] [RequiresDynamicCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public IViewFor? ResolveView(object? instance)
Summary: Resolves a view for a view model instance using runtime type information and the default contract.
Parameters
| Name | Type | Description |
|---|---|---|
instance | object? | The view model instance to resolve a view for. |
Returns: IViewFor? -- The resolved view or null when no registration is available.
4. Overload¶
Attributes: [RequiresUnreferencedCode("This method uses reflection to determine the view model type at runtime, which may be incompatible with trimming.")] [RequiresDynamicCode("If some of the generic arguments are annotated (either with DynamicallyAccessedMembersAttribute, or generic constraints), trimming can't validate that the requirements of those annotations are met.")]
public IViewFor? ResolveView(object? instance, string? contract)
Inherited documentation
These docs were inherited from IViewLocator. The member doesn't override them on this type.
Summary: Resolves a view for a view model instance using runtime type information.
Parameters
| Name | Type | Description |
|---|---|---|
instance | object? | The view model instance to resolve a view for. |
contract | string? | Optional contract allowing multiple view registrations per view model. |
Returns: IViewFor? -- The resolved view or null when no registration is available.