Class ViewModelViewHost
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.Wpf.dll
This content control will automatically load the View associated with the ViewModel property and display it. This control is very useful inside a DataTemplate to display the View associated with a ViewModel.
[RequiresDynamicCode("ViewModelViewHost uses ReactiveUI extension methods and RxApp which require dynamic code generation")]
[RequiresUnreferencedCode("ViewModelViewHost uses ReactiveUI extension methods and RxApp which may require unreferenced code")]
public class ViewModelViewHost : TransitioningContentControl, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient, IAddChild, IViewFor, IActivatableView, IEnableLogger
- Inheritance
-
ViewModelViewHost
- Implements
-
IEnableLogger
- Inherited Members
- Extension Methods
Constructors
ViewModelViewHost()
Initializes a new instance of the ViewModelViewHost class.
public ViewModelViewHost()
Fields
ContractFallbackByPassProperty
The ContractFallbackByPass dependency property.
public static readonly DependencyProperty ContractFallbackByPassProperty
Field Value
- DependencyProperty
DefaultContentProperty
The default content dependency property.
public static readonly DependencyProperty DefaultContentProperty
Field Value
- DependencyProperty
ViewContractObservableProperty
The view contract observable dependency property.
public static readonly DependencyProperty ViewContractObservableProperty
Field Value
- DependencyProperty
ViewModelProperty
The view model dependency property.
public static readonly DependencyProperty ViewModelProperty
Field Value
- DependencyProperty
Properties
ContractFallbackByPass
Gets or sets a value indicating whether should bypass the default contract fallback behavior.
public bool ContractFallbackByPass { get; set; }
Property Value
DefaultContent
Gets or sets the content displayed by default when no content is set.
public object DefaultContent { get; set; }
Property Value
ViewContract
Gets or sets the view contract.
public string? ViewContract { get; set; }
Property Value
ViewContractObservable
Gets or sets the view contract observable.
public IObservable<string?> ViewContractObservable { get; set; }
Property Value
ViewLocator
Gets or sets the view locator.
public IViewLocator? ViewLocator { get; set; }
Property Value
ViewModel
Gets or sets the ViewModel to display.
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)