The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

ViewModelViewHost Class

Summary

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.
Namespace
ReactiveUI.XamForms
Interfaces
Base Types
  • ContentView
graph BT Type-->Base0["ContentView"] Type-.->Interface0["IViewFor"] click Interface0 "/api/ReactiveUI/IViewFor" Type-.->Interface1["IActivatableView"] click Interface1 "/api/ReactiveUI/IActivatableView" Type["ViewModelViewHost"] class Type type-node

Syntax

public class ViewModelViewHost : ContentView, IViewFor, IActivatableView

Constructors

Name Summary
ViewModelViewHost() Initializes a new instance of the ViewModelViewHost class.

Fields

Name Constant Value Summary
DefaultContentProperty
Identifies the DefaultContent property.
static
ViewContractObservableProperty
Identifies the ViewContractObservable property.
static
ViewModelProperty
Identifies the ViewModel property.
static

Properties

Name Value Summary
DefaultContent View
Gets or sets the content to display when ViewModel is .
ViewContract string?
Gets or sets the fixed contract to use when resolving the view for the given view model.
ViewContractObservable IObservable<string?>
Gets or sets the observable which signals when the contract to use when resolving the view for the given view model has changed.
ViewLocator IViewLocator?
Gets or sets the override for the view locator to use when resolving the view. If unspecified, Current will be used.
ViewModel object?
Gets or sets the view model whose associated view is to be displayed.

Extension Methods

Name Value Summary
Bind<TViewModel, ViewModelViewHost, TVMProp, TVProp, TDontCare>(TViewModel?, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<ViewModelViewHost, TVProp>>, IObservable<TDontCare>?, Func<TVMProp?, TVProp>, Func<TVProp, TVMProp?>, TriggerUpdate) IReactiveBinding<TView, (object? view, bool isViewModel)>
Binds the specified view model property to the given view property.
Bind<TViewModel, ViewModelViewHost, TVMProp, TVProp, TDontCare>(TViewModel?, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<ViewModelViewHost, TVProp>>, IObservable<TDontCare>?, object?, IBindingTypeConverter?, IBindingTypeConverter?, TriggerUpdate) IReactiveBinding<TView, (object? view, bool isViewModel)>
Binds the specified view model property to the given view property, and provide a custom view update signaler to signal when the view property has been updated.
Bind<TViewModel, ViewModelViewHost, TVMProp, TVProp>(TViewModel?, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<ViewModelViewHost, TVProp>>, Func<TVMProp?, TVProp>, Func<TVProp, TVMProp?>) IReactiveBinding<TView, (object? view, bool isViewModel)>
Binds the specified view model property to the given view property.
Bind<TViewModel, ViewModelViewHost, TVMProp, TVProp>(TViewModel?, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<ViewModelViewHost, TVProp>>, object?, IBindingTypeConverter?, IBindingTypeConverter?) IReactiveBinding<TView, (object? view, bool isViewModel)>
Binds the specified view model property to the given view property.
BindCommand<ViewModelViewHost, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ViewModelViewHost, TControl>>, Expression<Func<TViewModel, TParam?>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ViewModelViewHost, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ViewModelViewHost, TControl>>, IObservable<TParam?>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ViewModelViewHost, TViewModel, TProp, TControl>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ViewModelViewHost, TControl>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindInteraction<TViewModel, ViewModelViewHost, TInput, TOutput, TDontCare>(TViewModel?, Expression<Func<TViewModel, Interaction<TInput, TOutput>>>, Func<InteractionContext<TInput, TOutput>, IObservable<TDontCare>>) IDisposable
Binds the Interaction<TInput, TOutput> on a ViewModel to the specified handler.
BindInteraction<TViewModel, ViewModelViewHost, TInput, TOutput>(TViewModel?, Expression<Func<TViewModel, Interaction<TInput, TOutput>>>, Func<InteractionContext<TInput, TOutput>, Task>) IDisposable
Binds the Interaction<TInput, TOutput> on a ViewModel to the specified handler.
BindValidation<ViewModelViewHost, TViewModel, TViewModelProperty, TViewProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, Expression<Func<ViewModelViewHost, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the specified ViewModel property validation to the View property.
BindValidation<ViewModelViewHost, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ViewModelViewHost, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ViewModelViewHost, TViewModel, TViewProperty>(TViewModel?, Expression<Func<ViewModelViewHost, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the overall validation of a ViewModel to a specified View property.
BindValidation<ViewModelViewHost, TViewModel, TViewProperty>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, Expression<Func<ViewModelViewHost, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds a ValidationHelper from a ViewModel to a specified View property.
BindValidation<ViewModelViewHost, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ViewModelViewHost, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ViewModelViewHost, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ViewModelViewHost, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
InvokeViewModelAction<T>(Action<T>) object
This is a thing I lifted from Prism.
OneWayBind<TViewModel, ViewModelViewHost, TProp, TOut>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ViewModelViewHost, TOut>>, Func<TProp, TOut>) IReactiveBinding<TView, TOut>
Binds the specified view model property to the given view, in a one-way (view model to view) fashion, with the value of the view model property mapped through a selector function.
OneWayBind<TViewModel, ViewModelViewHost, TVMProp, TVProp>(TViewModel?, Expression<Func<TViewModel, TVMProp?>>, Expression<Func<ViewModelViewHost, TVProp>>, object?, IBindingTypeConverter?) IReactiveBinding<TView, TVProp>
Binds the given property on the view model to a given property on the view in a one-way (view model to view) fashion.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Expression<Func<ViewModelViewHost, IObservable<T8>?>>, Expression<Func<ViewModelViewHost, IObservable<T9>?>>, Expression<Func<ViewModelViewHost, IObservable<T10>?>>, Expression<Func<ViewModelViewHost, IObservable<T11>?>>, Expression<Func<ViewModelViewHost, IObservable<T12>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, T12?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Expression<Func<ViewModelViewHost, IObservable<T8>?>>, Expression<Func<ViewModelViewHost, IObservable<T9>?>>, Expression<Func<ViewModelViewHost, IObservable<T10>?>>, Expression<Func<ViewModelViewHost, IObservable<T11>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Expression<Func<ViewModelViewHost, IObservable<T8>?>>, Expression<Func<ViewModelViewHost, IObservable<T9>?>>, Expression<Func<ViewModelViewHost, IObservable<T10>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Expression<Func<ViewModelViewHost, IObservable<T8>?>>, Expression<Func<ViewModelViewHost, IObservable<T9>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Expression<Func<ViewModelViewHost, IObservable<T8>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6, T7>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Expression<Func<ViewModelViewHost, IObservable<T7>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5, T6>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Expression<Func<ViewModelViewHost, IObservable<T6>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4, T5>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Expression<Func<ViewModelViewHost, IObservable<T5>?>>, Func<T1?, T2?, T3?, T4?, T5?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3, T4>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Expression<Func<ViewModelViewHost, IObservable<T4>?>>, Func<T1?, T2?, T3?, T4?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2, T3>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Expression<Func<ViewModelViewHost, IObservable<T3>?>>, Func<T1?, T2?, T3?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet, T1, T2>(Expression<Func<ViewModelViewHost, IObservable<T1>?>>, Expression<Func<ViewModelViewHost, IObservable<T2>?>>, Func<T1?, T2?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Observe a observable which is set to a property, and automatically subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ViewModelViewHost, TRet>(Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>, Expression<Func<ViewModelViewHost, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
With<ViewModelViewHost, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.