ViewModelViewHost class¶
Attributes: [WinRTRuntimeClassName] [WinRTExposedType]
Defined in
Namespace: ReactiveUI
Assembly: ReactiveUI.WinUI.dll
Full name: ReactiveUI.ViewModelViewHost<T>
Modifiers: public
Summary¶
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
Constructors¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [ViewModelViewHost](# class. |
Properties¶
| Name | Summary |
|---|---|
| ViewContractObservable | Gets or sets the view contract observable. |
| DefaultContent | Gets or sets the content displayed by default when no content is set. |
| ViewModel | Gets or sets the ViewModel to display. |
| ViewContract | Gets or sets the view contract. |
| ContractFallbackByPass | Gets or sets a value indicating whether should bypass the default contract fallback behavior. |
| ViewLocator | Gets or sets the view locator. |
Fields¶
| Name | Summary |
|---|---|
| static DefaultContentProperty | The default content dependency property. |
| static ViewModelProperty | The view model dependency property. |
| static ViewContractObservableProperty | The view contract observable dependency property. |
| static ContractFallbackByPassProperty | The ContractFallbackByPass dependency property. |
Methods¶
| Name | Summary |
|---|---|
| ResolveViewForViewModel | resolve view for view model with respect to contract. |