FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Behavior

    struct · ferroui-xaml-interactivity · v0.5.0

    struct Behavior
    

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

    The class is abstract: deriving classes override the members of BehaviorImpl.

    Deviation (DEVIATIONS.md, Behaviors): the reference names the hooks of the attachment of the host to the logical tree OnAttachedToLogicalTree / OnDetachedFromLogicalTree; the styled element behaviors would hide the members of the same name of the styled element, so both families name them on_attached_to_logical_tree_event and on_detached_from_logical_tree_event, as the reference names the other host hooks (OnInitializedEvent, OnDataContextChangedEvent).

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

    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

    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.