FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    StyledElementBehavior

    struct · ferroui-xaml-interactivity · v0.5.0

    struct StyledElementBehavior
    

    A base class for behaviors, implementing the basic plumbing of IBehavior.

    The behavior is a styled element: while its host is in the logical tree, the behavior is a logical child of the host (one way: it is not in the logical children of the host), so it is styled, resolves resources, follows the data context of its host and binds with $parent and TemplateBinding.

    The class is abstract: deriving classes override the members of StyledElementBehaviorImpl. See Behavior for the names of the hooks of the logical tree.

    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<StyledElementBehavior>
    

    Returns a strong reference to this object.

    Source

    on_attached

    fn on_attached(self: &Self)
    

    Called after the behavior is attached to the associated object.

    Override this to hook up functionality to the associated object.

    Source

    on_detaching

    fn on_detaching(self: &Self)
    

    Called when the behavior is being detached from its associated object.

    Override this to unhook functionality from the associated object.

    Source

    on_attached_to_visual_tree

    fn on_attached_to_visual_tree(self: &Self)
    

    Called after the associated object is attached to the visual tree.

    Invoked only when the associated object is a visual.

    Source

    on_detached_from_visual_tree

    fn on_detached_from_visual_tree(self: &Self)
    

    Called when the associated object is being detached from the visual tree.

    Invoked only when the associated object is a visual.

    Source

    on_attached_to_logical_tree_event

    fn on_attached_to_logical_tree_event(self: &Self)
    

    Called after the associated object is attached to the logical tree (OnAttachedToLogicalTree).

    Invoked only when the associated object is a styled element.

    Source

    on_detached_from_logical_tree_event

    fn on_detached_from_logical_tree_event(self: &Self)
    

    Called when the associated object is being detached from the logical tree (OnDetachedFromLogicalTree).

    Invoked only when the associated object is a styled element.

    Source

    on_loaded

    fn on_loaded(self: &Self)
    

    Called after the associated object is loaded.

    Invoked only when the associated object is a control.

    Source

    on_unloaded

    fn on_unloaded(self: &Self)
    

    Called when the associated object is unloaded.

    Invoked only when the associated object is a control.

    Source

    on_initialized_event

    fn on_initialized_event(self: &Self)
    

    Called when the associated object is initialized.

    Invoked only when the associated object is a styled element.

    Source

    on_data_context_changed_event

    fn on_data_context_changed_event(self: &Self)
    

    Called when the data context of the associated object changed.

    Invoked only when the associated object is a styled element.

    Source

    on_resources_changed_event

    fn on_resources_changed_event(self: &Self)
    

    Called when the resources of the associated object changed.

    Invoked only when the associated object is a styled element.

    Source

    on_actual_theme_variant_changed_event

    fn on_actual_theme_variant_changed_event(self: &Self)
    

    Called when the actual theme variant of the associated object changed.

    Invoked only when the associated object is a styled element.

    Source

    is_enabled_property

    fn is_enabled_property() -> &'static StyledProperty<bool>
    

    Identifies the IsEnabled property.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see FerroObject::construct.

    Source

    associated_object

    fn associated_object(self: &Self) -> Option<Ref<FerroObject>>
    

    Gets the object to which the behavior is attached.

    Source

    associated_styled_element

    fn associated_styled_element(self: &Self) -> Option<Ref<StyledElement>>
    

    Gets the styled element to which this behavior is attached.

    Source

    is_enabled

    fn is_enabled(self: &Self) -> bool
    

    Gets or sets a value indicating whether this instance is enabled.

    Source

    set_is_enabled

    fn set_is_enabled(self: &Self, value: bool)
    

    Source

    attach

    fn attach(self: &Self, associated_object: impl Into<Nullable<FerroObject>>)
    

    Attaches the behavior to the specified object.

    Panics

    Panics if the behavior is attached to another object.

    Source

    detach

    fn detach(self: &Self)
    

    Detaches the behaviors from the associated_object.

    Source

    Trait implementations

    Availability

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