Class ViewModelViewHost
- Namespace
- ReactiveUI.Maui
- Assembly
- ReactiveUI.Maui.dll
This content view will automatically load and host the view for the given view model. The view model whose view is to be displayed should be assigned to the ViewModel property. Optionally, the chosen view can be customized by specifying a contract via ViewContractObservable or ViewContract.
public class ViewModelViewHost : ContentView, IViewFor, IActivatableView
- Inheritance
-
ViewModelViewHost
- Implements
- Extension Methods
Constructors
ViewModelViewHost()
Initializes a new instance of the ViewModelViewHost class.
public ViewModelViewHost()
Fields
ContractFallbackByPassProperty
The ContractFallbackByPass dependency property.
public static readonly BindableProperty ContractFallbackByPassProperty
Field Value
- BindableProperty
DefaultContentProperty
Identifies the DefaultContent property.
public static readonly BindableProperty DefaultContentProperty
Field Value
- BindableProperty
ViewContractObservableProperty
Identifies the ViewContractObservable property.
public static readonly BindableProperty ViewContractObservableProperty
Field Value
- BindableProperty
ViewModelProperty
Identifies the ViewModel property.
public static readonly BindableProperty ViewModelProperty
Field Value
- BindableProperty
Properties
ContractFallbackByPass
Gets or sets a value indicating whether should bypass the default contract fallback behavior.
public bool ContractFallbackByPass { get; set; }
Property Value
DefaultContent
public View DefaultContent { get; set; }
Property Value
- View
ViewContract
Gets or sets the fixed contract to use when resolving the view for the given view model.
public string? ViewContract { get; set; }
Property Value
Remarks
This property is a mere convenience so that a fixed contract can be assigned directly in XAML.
ViewContractObservable
Gets or sets the observable which signals when the contract to use when resolving the view for the given view model has changed.
public IObservable<string?> ViewContractObservable { get; set; }
Property Value
ViewLocator
Gets or sets the override for the view locator to use when resolving the view. If unspecified, Current will be used.
public IViewLocator? ViewLocator { get; set; }
Property Value
ViewModel
Gets or sets the view model whose associated view is to be displayed.
public object? ViewModel { get; set; }
Property Value
Methods
ResolveViewForViewModel(object?, string?)
resolve view for view model with respect to contract.
protected virtual void ResolveViewForViewModel(object? viewModel, string? contract)