FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RoutedEventArgs

    struct · ferroui-base · v0.5.0

    struct RoutedEventArgs
    

    Provides state information and data specific to a routed event.

    The routing state (handled, route, source) is mutated while the event travels along its route, so it is interiorly mutable: handlers receive the args by shared reference.

    The args are a reference object: a copy shares the routing state with the args it was made from (marking a copy as handled marks the event as handled), and copies compare by identity. The same holds for the args types derived from this one, whose own mutable state is shared too.

    View source

    Members

    new

    fn new() -> Self
    

    Creates args with no routed event.

    Source

    with_event

    fn with_event<T: ?Sized>(routed_event: &RoutedEvent<T>) -> Self
    

    Creates args for a routed event.

    Source

    with_event_and_source

    fn with_event_and_source<T: ?Sized>(routed_event: &RoutedEvent<T>, source: impl Into<Nullable<FerroObject>>) -> Self
    

    Creates args for a routed event with a source.

    Source

    handled

    fn handled(self: &Self) -> bool
    

    Whether the routed event has already been handled.

    Once handled, the event keeps travelling along its route but is only delivered to handlers registered for handled events too.

    Source

    set_handled

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

    Marks the routed event as handled or unhandled.

    Source

    routed_event

    fn routed_event(self: &Self) -> Option<RoutedEvent>
    

    The routed event associated with these args.

    Source

    set_routed_event

    fn set_routed_event<T: ?Sized>(self: &Self, value: Option<&RoutedEvent<T>>)
    

    Sets the routed event associated with these args.

    Source

    route

    fn route(self: &Self) -> RoutingStrategies
    

    The routing strategy currently being applied to the event.

    Source

    set_route

    fn set_route(self: &Self, value: RoutingStrategies)
    

    Sets the routing strategy currently being applied to the event.

    Source

    source

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

    The object that raised the event.

    Source

    set_source

    fn set_source(self: &Self, value: impl Into<Nullable<FerroObject>>)
    

    Sets the object that raised the event.

    Source

    is_source

    fn is_source(self: &Self, object: &FerroObject) -> bool
    

    Whether object is the source of the event (C# e.Source == object).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Default
    • PartialEq
    • IRoutedEventArgs

    Availability

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