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.
Members
TYPEto_refon_attachedon_detachingon_attached_to_visual_treeon_detached_from_visual_treeon_attached_to_logical_tree_eventon_detached_from_logical_tree_eventon_loadedon_unloadedon_initialized_eventon_data_context_changed_eventon_resources_changed_eventon_actual_theme_variant_changed_eventis_enabled_propertyconstructassociated_objectassociated_styled_elementis_enabledset_is_enabledattachdetach
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<StyledElementBehavior>
Returns a strong reference to this object.
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.
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.
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.
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.
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.
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.
on_loaded
fn on_loaded(self: &Self)
Called after the associated object is loaded.
Invoked only when the associated object is a control.
on_unloaded
fn on_unloaded(self: &Self)
Called when the associated object is unloaded.
Invoked only when the associated object is a control.
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.
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.
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.
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.
is_enabled_property
fn is_enabled_property() -> &'static StyledProperty<bool>
Identifies the IsEnabled property.
construct
fn construct() -> Self
Creates the class data; see FerroObject::construct.
associated_object
fn associated_object(self: &Self) -> Option<Ref<FerroObject>>
Gets the object to which the behavior is attached.
associated_styled_element
fn associated_styled_element(self: &Self) -> Option<Ref<StyledElement>>
Gets the styled element to which this behavior is attached.
is_enabled
fn is_enabled(self: &Self) -> bool
Gets or sets a value indicating whether this instance is enabled.
set_is_enabled
fn set_is_enabled(self: &Self, value: bool)
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.
detach
fn detach(self: &Self)
Detaches the behaviors from the associated_object.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeStyledElementBehaviorImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtStyledElementImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<StyledElementBehavior>StaticTypeObjectTypeSubclassable<T>FerroObjectImplStyledElementImplStyledElementBehaviorImplIBehaviorIBehaviorEventsHandler
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.