FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

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

    Returns a strong reference to this object.

    Source

    construct

    fn construct() -> Self
    

    Source

    new

    fn new() -> Ref<Self>
    

    Source

    with_name

    fn with_name(name: impl Into<String>) -> Ref<Self>
    

    Creates a group with a name.

    Source

    name

    fn name(self: &Self) -> String
    

    The name of the group.

    Source

    set_name

    fn set_name(self: &Self, value: impl Into<String>)
    

    Sets the name (WinUI's x:Name).

    Source

    states

    fn states(self: &Self) -> FerroList<Ref<VisualState>>
    

    The states of the group.

    Source

    current_state

    fn current_state(self: &Self) -> Option<Ref<VisualState>>
    

    The current state of the group: None until a state is entered.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    Availability

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