FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ConnectedAnimation

    struct · ferroui-controls · v0.5.0

    struct ConnectedAnimation
    

    Animates an element seamlessly between two views during navigation by flying a proxy over the OverlayLayer.

    Obtain an instance via ConnectedAnimationService::prepare_to_animate, then start it with try_start after navigation.

    The animation auto-disposes after three seconds if not consumed (matching UWP behaviour).

    View source

    Members

    key

    fn key(self: &Self) -> &str
    

    Gets the key that identifies this animation.

    Source

    is_consumed

    fn is_consumed(self: &Self) -> bool
    

    Gets a value indicating whether try_start has been called.

    Source

    configuration

    fn configuration(self: &Self) -> Option<Rc<dyn ConnectedAnimationConfiguration>>
    

    Gets the configuration that controls timing and visual style.

    Source

    set_configuration

    fn set_configuration(self: &Self, value: Option<Rc<dyn ConnectedAnimationConfiguration>>)
    

    Sets the configuration that controls timing and visual style. Set this before calling try_start.

    Source

    completed

    fn completed(self: &Self, handler: impl Fn(&ConnectedAnimationCompletedEventArgs) -> () + 'static) -> Subscription
    

    Raised when the animation finishes or is cancelled. Check ConnectedAnimationCompletedEventArgs::cancelled to distinguish the cases.

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the animation.

    Source

    try_start

    fn try_start(self: &Self, destination: &Visual) -> bool
    

    Starts the animation towards destination. Returns false if the animation has already been consumed or disposed.

    Source

    try_start_with_coordinated_elements

    fn try_start_with_coordinated_elements(self: &Self, destination: &Visual, coordinated_elements: &[Ref<Visual>]) -> bool
    

    Starts the animation towards destination with coordinated_elements that fade in during the last 40 % of the animation. Returns false if the animation has already been consumed or disposed.

    Source

    cancel

    fn cancel(self: &Self)
    

    Cancel: stops the animation and shows the source and destination elements in their places. As in WinUI no Completed is raised; the animation cannot be started any more.

    Source

    is_scale_animation_enabled

    fn is_scale_animation_enabled(self: &Self) -> bool
    

    IsScaleAnimationEnabled: whether the animation scales the image from the size of the source to that of the destination (true, the default), or keeps the sizes and shows the parts of the elements their clips leave visible.

    Source

    set_is_scale_animation_enabled

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

    Source

    set_animation_component

    fn set_animation_component(self: &Self, component: ConnectedAnimationComponent, animation: Option<Rc<dyn ICompositionAnimation>>)
    

    SetAnimationComponent: replaces the animation of one part of the flight. The animation receives the scalar parameters StartingValue and FinalValue, and is started on the component (for OffsetX, Offset.X of the flight). None restores the default.

    Source

    dispose

    fn dispose(self: &Self)
    

    Releases all resources and cancels the animation if it is in flight. The completed event is raised with cancelled set only when the animation was actively running at dispose time.

    Source

    Trait implementations

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

    Availability

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