ViewModelViewHost
struct · ferroui-reactiveui-controls · v0.5.0
struct ViewModelViewHost
Loads and displays the view associated with the ViewModel property (ViewModelViewHost).
Assigning a view model resolves its view through the view locator (view_locator or the
current one) under the view_contract; the view gets the view model through its ViewModel
and DataContext. Without a view model, or without a view for it, the host shows its
default_content.
Members
TYPEto_refview_model_propertyview_contract_propertydefault_content_propertyconstructnewview_modelset_view_modelview_contractset_view_contractdefault_contentset_default_contentview_locatorset_view_locatorview_fornavigate_to_view_modeldispose_navigation_disposables
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<ViewModelViewHost>
Returns a strong reference to this object.
view_model_property
fn view_model_property() -> &'static StyledProperty<Option<BoxedValue>>
Identifies the ViewModel property (ViewModelProperty).
view_contract_property
fn view_contract_property() -> &'static StyledProperty<Option<String>>
Identifies the ViewContract property (ViewContractProperty).
default_content_property
fn default_content_property() -> &'static StyledProperty<Option<BoxedValue>>
Identifies the DefaultContent property (DefaultContentProperty).
construct
fn construct() -> Self
Field initialisation.
new
fn new() -> Ref<Self>
Creates the host.
view_model
fn view_model(self: &Self) -> Option<BoxedValue>
The view model whose view is shown (ViewModel).
set_view_model
fn set_view_model(self: &Self, value: Option<BoxedValue>)
Sets the view model whose view is shown.
view_contract
fn view_contract(self: &Self) -> Option<String>
The contract of the view to resolve (ViewContract).
set_view_contract
fn set_view_contract(self: &Self, value: Option<String>)
Sets the contract of the view to resolve.
default_content
fn default_content(self: &Self) -> Option<BoxedValue>
The content shown when there is no view model or no view for it (DefaultContent).
set_default_content
fn set_default_content(self: &Self, value: Option<BoxedValue>)
Sets the content shown when there is no view model or no view for it.
view_locator
fn view_locator(self: &Self) -> Option<Rc<dyn IViewLocator>>
The view locator used to resolve views (ViewLocator); None uses the current one.
set_view_locator
fn set_view_locator(self: &Self, value: Option<Rc<dyn IViewLocator>>)
Sets the view locator used to resolve views.
view_for
fn view_for(this: &Ref<Self>) -> Rc<dyn IViewFor>
The host as a view of ReactiveUI ((IViewFor)host), which keeps it alive.
navigate_to_view_model
fn navigate_to_view_model(self: &Self, view_model: Option<Rc<dyn Any>>, contract: Option<&str>)
Navigates to the view associated with view_model and contract (NavigateToViewModel):
a missing view model or view displays the default content; a resolved view receives the
view model through its ViewModel and DataContext.
Deviation (DEVIATIONS.md, ReactiveUI controls): internal upstream, public here so that the tests, in another module, reach it.
dispose_navigation_disposables
fn dispose_navigation_disposables(self: &Self)
Disposes the active navigation subscriptions when they exist
(DisposeNavigationDisposables).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherTemplatedControlImplExtContentControlImplExtControlImplExtDerefUpcast<T>Upcast<ViewModelViewHost>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplLayoutableImplInteractiveImplInputElementImplControlImplTemplatedControlImplContentControlImplIEnableLoggerStyledElementImplVisualImplIReactiveViewClass
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.