Skip to content

ViewModelViewHost class

Attributes: [WinRTRuntimeClassName] [WinRTExposedType]

Defined in

Namespace: ReactiveUI Assembly: ReactiveUI.WinUI.dll Full name: ReactiveUI.ViewModelViewHost<T> Modifiers: public

Summary

View source

        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.
        This generic version provides AOT-compatibility by using compile-time type information.
        

Applies to

net10.0-windows10.0.19041, net9.0-windows10.0.19041

Class hierarchy
classDiagram
class ViewModelViewHost~T~
class TransitioningContentControl
TransitioningContentControl <|-- ViewModelViewHost~T~
class IViewFor~TViewModel~ {
    <>
}
IViewFor~TViewModel~ <|.. ViewModelViewHost~T~
class IViewFor {
    <>
}
IViewFor <|.. ViewModelViewHost~T~
class IActivatableView {
    <>
}
IActivatableView <|.. ViewModelViewHost~T~
class IEnableLogger {
    <>
}
IEnableLogger <|.. ViewModelViewHost~T~

Inherits from: TransitioningContentControl

Implements: IViewFor, IViewFor, IActivatableView, IEnableLogger

Constructors

NameSummary
.ctorInitializes a new instance of the [ViewModelViewHost](# class.

Properties

NameSummary
ViewContractObservableGets or sets the view contract observable.
DefaultContentGets or sets the content displayed by default when no content is set.
ViewModelGets or sets the ViewModel to display.
ViewContractGets or sets the view contract.
ContractFallbackByPassGets or sets a value indicating whether should bypass the default contract fallback behavior.
ViewLocatorGets or sets the view locator.

Fields

NameSummary
static DefaultContentPropertyThe default content dependency property.
static ViewModelPropertyThe view model dependency property.
static ViewContractObservablePropertyThe view contract observable dependency property.
static ContractFallbackByPassPropertyThe ContractFallbackByPass dependency property.

Methods

NameSummary
ResolveViewForViewModelresolve view for view model with respect to contract.
Inherited members