Skip to content

)} ,System.String)}

DefaultViewLocator.Map() method

Defined in

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

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481

Overloads

  • 1. public void Map<TViewModel, TView>() where TViewModel : class where TView : IViewFor, new()
  • 2. public void Map<TViewModel, TView>(string? contract) where TViewModel : class where TView : IViewFor, new()
  • 3. public void Map<TViewModel>(Func<IViewFor> factory) where TViewModel : class
  • 4. public void Map<TViewModel>(Func<IViewFor> factory, string? contract) where TViewModel : class

1. Overload

public void Map<TViewModel, TView>() where TViewModel : class where TView : IViewFor, new()

View source

Summary: Registers an explicit view mapping for a view model type.

Type parameters

NameDescription
TViewModelThe view model type.
TViewThe view type. Must implement [IViewFor](#

2. Overload

public void Map<TViewModel, TView>(string? contract) where TViewModel : class where TView : IViewFor, new()

View source

Summary: Registers an explicit view mapping for a view model type.

Type parameters

NameDescription
TViewModelThe view model type.
TViewThe view type. Must implement [IViewFor](#

Parameters

NameTypeDescription
contractstring?A contract string for named registrations.

3. Overload

public void Map<TViewModel>(Func<IViewFor> factory) where TViewModel : class

View source

Summary: Registers an explicit view mapping with a custom factory for a view model type.

Type parameters

NameDescription
TViewModelThe view model type.

Parameters

NameTypeDescription
factoryFuncA factory function that creates the view.

4. Overload

public void Map<TViewModel>(Func<IViewFor> factory, string? contract) where TViewModel : class

View source

Summary: Registers an explicit view mapping with a custom factory for a view model type.

Type parameters

NameDescription
TViewModelThe view model type.

Parameters

NameTypeDescription
factoryFuncA factory function that creates the view.
contractstring?A contract string for named registrations.