FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    StyledElementImpl

    trait · ferroui-base · v0.5.0

    trait StyledElementImpl: FerroObjectImpl + $crate::Upcast<StyledElement>
    

    The overridable members introduced by the class.

    View source

    Members

    begin_init

    fn begin_init(this: &Self)
    

    Signals the beginning of a batch of initialization: styling is deferred until the matching end_init.

    Source

    try_end_init

    fn try_end_init(this: &Self) -> Result<(), InitializationError>
    

    Signals the end of a batch of initialization: the element is styled (if it is attached to a rooted logical tree) and initialized. A style or control theme that cannot be applied (two setters for the same property) is an error, the counterpart of the invalid operation EndInit raises in the managed original; what follows the failure is skipped. This is the overridable member; end_init is the form that panics on the error.

    Source

    logical_children_collection_changed

    fn logical_children_collection_changed(this: &Self, e: &NotifyCollectionChangedEventArgs<'_, Ref<StyledElement>>)
    

    Called when the logical children collection changes.

    Source

    on_attached_to_logical_tree

    fn on_attached_to_logical_tree(this: &Self, e: &LogicalTreeAttachmentEventArgs)
    

    Called when the styled element is added to a rooted logical tree.

    Source

    on_detached_from_logical_tree

    fn on_detached_from_logical_tree(this: &Self, e: &LogicalTreeAttachmentEventArgs)
    

    Called when the styled element is removed from a rooted logical tree.

    Source

    on_data_context_changed

    fn on_data_context_changed(this: &Self)
    

    Called when the data context changes.

    Source

    on_data_context_begin_update

    fn on_data_context_begin_update(this: &Self)
    

    Called when the data context begins updating.

    Source

    on_data_context_end_update

    fn on_data_context_end_update(this: &Self)
    

    Called when the data context finishes updating.

    Source

    on_initialized

    fn on_initialized(this: &Self)
    

    Called when the control finishes initialization.

    Source

    style_key_override

    fn style_key_override(this: &Self) -> &'static TypeInfo
    

    The type by which the element is styled. Defaults to the element's own type; override to be styled as a base class.

    Source

    on_control_theme_changed

    fn on_control_theme_changed(this: &Self)
    

    Called when the control theme changes.

    Source

    on_templated_parent_control_theme_changed

    fn on_templated_parent_control_theme_changed(this: &Self)
    

    Called when the templated parent's control theme changes.

    Source

    invalidate_styles

    fn invalidate_styles(this: &Self, recurse: bool)
    

    Detaches all styles from the element (and optionally from its inheritance children) so that they are re-applied.

    Source

    is_logical_root

    fn is_logical_root(this: &Self) -> bool
    

    Whether the element is the root of a logical tree.

    Source

    styling_parent

    fn styling_parent(this: &Self) -> Option<StyleHostRef>
    

    The parent style host of the element: by default the inheritance parent, when it is a styled element. The root of a tree overrides this to return the host of the global styles.

    Source

    notify_child_resources_changed

    fn notify_child_resources_changed(this: &Self, e: ResourcesChangedEventArgs)
    

    Notifies the children of the element that the resources visible to them have changed. The base method notifies the logical children.

    Source

    child_index_provider

    fn child_index_provider(this: &Self) -> Option<Rc<dyn IChildIndexProvider>>
    

    The child index provider implemented by the element, if any. Used to match the children of the element by their position.

    Source

    is_theme_variant_root

    fn is_theme_variant_root(this: &Self) -> bool
    

    Whether the element is a root of theme variant resolution: at a root the default theme variant resolves to the variant of the platform instead of being inherited.

    Source

    Trait implementations

    Availability

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