VisualStateGroup
struct · ferroui-controls · v0.5.0
struct VisualStateGroup
A group of mutually exclusive VisualStates: at most one of them is the
current_state of the group, null at first.
The groups of an element are the attached
VisualStateManager::visual_state_groups_property;
VisualStateManager::go_to_state changes the state of the group that has the state of the
name it is given.
Members
TYPEto_refconstructnewwith_namenameset_namestatescurrent_statecurrent_state_changingcurrent_state_changed
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<VisualStateGroup>
Returns a strong reference to this object.
construct
fn construct() -> Self
new
fn new() -> Ref<Self>
with_name
fn with_name(name: impl Into<String>) -> Ref<Self>
Creates a group with a name.
name
fn name(self: &Self) -> String
The name of the group.
set_name
fn set_name(self: &Self, value: impl Into<String>)
Sets the name (WinUI's x:Name).
states
fn states(self: &Self) -> FerroList<Ref<VisualState>>
The states of the group.
current_state
fn current_state(self: &Self) -> Option<Ref<VisualState>>
The current state of the group: None until a state is entered.
current_state_changing
fn current_state_changing(self: &Self, handler: impl Fn(&Ref<VisualStateGroup>, &VisualStateChangedEventArgs) -> () + 'static) -> Subscription
Adds a handler of CurrentStateChanging, raised when a change of state begins.
Dropping the returned guard removes the handler; Subscription::detach keeps it for
the life of the group.
current_state_changed
fn current_state_changed(self: &Self, handler: impl Fn(&Ref<VisualStateGroup>, &VisualStateChangedEventArgs) -> () + 'static) -> Subscription
Adds a handler of CurrentStateChanged, raised when a change of state has completed.
Dropping the returned guard removes the handler; Subscription::detach keeps it
for the life of the group.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyFerroObjectImplExtClassDefaultsErasedDestructorIntoEitherDerefUpcast<T>Upcast<VisualStateGroup>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImplDrop
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.