ViewModelViewHost class¶
Attributes: [DebuggerDisplay("{ViewContractObservable}, {DefaultContent}")]
Defined in
Namespace: ReactiveUI.Reactive
Assembly: ReactiveUI.Wpf.Reactive.dll
Full name: ReactiveUI.Reactive.ViewModelViewHost
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.
Applies to
net11.0-windows7.0, net11.0-windows10.0.19041, net11.0-tvos27.2, net11.0-macos27.2, net11.0-maccatalyst27.2, net11.0-windows10.0.19041, net11.0-ios27.2, net10.0-macos26.0, net10.0-tvos26.0, net10.0-windows7.0, net10.0-windows10.0.19041, net10.0-maccatalyst26.0, net10.0-windows10.0.19041, net10.0-ios26.0, net47, net471, net472, net48, net481
Class hierarchy
classDiagram
class ViewModelViewHost
class TransitioningContentControl
TransitioningContentControl <|-- ViewModelViewHost
class IViewFor {
<>
}
IViewFor <|.. ViewModelViewHost
class IActivatableView {
<>
}
IActivatableView <|.. ViewModelViewHost
class IEnableLogger {
<>
}
IEnableLogger <|.. ViewModelViewHost
Inherits from: TransitioningContentControl
Implements: IViewFor, IActivatableView, IEnableLogger
Remarks¶
The host asks the view locator for the view by the view model's run-time type, without building any type at run
time. The default locator checks the view lookup the source generator writes, then the views the app added with
Map. A view registered only with the service locator needs ViewModelViewHostUnsafe from ReactiveUI.WPF.Unsafe, which also
asks the service locator for IViewFor closed over the view model's run-time type.
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. |
| ViewLocator | Gets or sets the view locator. |
| ContractFallbackByPass | Gets or sets a value indicating whether should bypass the default contract fallback behavior. |
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. |
Derived types¶
Inherited members
ReactiveUI.Reactive.TransitioningContentControl.TransitionPropertyReactiveUI.Reactive.TransitioningContentControl.TransitionDirectionPropertyReactiveUI.Reactive.TransitioningContentControl.TransitionDurationPropertyReactiveUI.Reactive.TransitioningContentControl.#ctorReactiveUI.Reactive.TransitioningContentControl.OnApplyTemplateReactiveUI.Reactive.TransitioningContentControl.OnContentChanged(System.Object,System.Object)ReactiveUI.Reactive.TransitioningContentControl.TransitionReactiveUI.Reactive.TransitioningContentControl.DirectionReactiveUI.Reactive.TransitioningContentControl.DurationReactiveUI.Reactive.TransitioningContentControl.TransitionCompletedReactiveUI.Reactive.TransitioningContentControl.TransitionStartedSystem.Object.Equals(System.Object)System.Object.Equals(System.Object,System.Object)System.Object.GetHashCodeSystem.Object.GetTypeSystem.Object.MemberwiseCloneSystem.Object.ReferenceEquals(System.Object,System.Object)System.Object.ToString