FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<ViewModelViewHost>
    

    Returns a strong reference to this object.

    Source

    view_model_property

    fn view_model_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the ViewModel property (ViewModelProperty).

    Source

    view_contract_property

    fn view_contract_property() -> &'static StyledProperty<Option<String>>
    

    Identifies the ViewContract property (ViewContractProperty).

    Source

    default_content_property

    fn default_content_property() -> &'static StyledProperty<Option<BoxedValue>>
    

    Identifies the DefaultContent property (DefaultContentProperty).

    Source

    construct

    fn construct() -> Self
    

    Field initialisation.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates the host.

    Source

    view_model

    fn view_model(self: &Self) -> Option<BoxedValue>
    

    The view model whose view is shown (ViewModel).

    Source

    set_view_model

    fn set_view_model(self: &Self, value: Option<BoxedValue>)
    

    Sets the view model whose view is shown.

    Source

    view_contract

    fn view_contract(self: &Self) -> Option<String>
    

    The contract of the view to resolve (ViewContract).

    Source

    set_view_contract

    fn set_view_contract(self: &Self, value: Option<String>)
    

    Sets the contract of the view to resolve.

    Source

    default_content

    fn default_content(self: &Self) -> Option<BoxedValue>
    

    The content shown when there is no view model or no view for it (DefaultContent).

    Source

    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.

    Source

    view_locator

    fn view_locator(self: &Self) -> Option<Rc<dyn IViewLocator>>
    

    The view locator used to resolve views (ViewLocator); None uses the current one.

    Source

    set_view_locator

    fn set_view_locator(self: &Self, value: Option<Rc<dyn IViewLocator>>)
    

    Sets the view locator used to resolve views.

    Source

    view_for

    fn view_for(this: &Ref<Self>) -> Rc<dyn IViewFor>
    

    The host as a view of ReactiveUI ((IViewFor)host), which keeps it alive.

    Source

    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.

    Source

    dispose_navigation_disposables

    fn dispose_navigation_disposables(self: &Self)
    

    Disposes the active navigation subscriptions when they exist (DisposeNavigationDisposables).

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.