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).
Members
keyis_consumedconfigurationset_configurationcompletedtry_starttry_start_with_coordinated_elementscancelis_scale_animation_enabledset_is_scale_animation_enabledset_animation_componentdispose
key
fn key(self: &Self) -> &str
Gets the key that identifies this animation.
is_consumed
fn is_consumed(self: &Self) -> bool
Gets a value indicating whether try_start has
been called.
configuration
fn configuration(self: &Self) -> Option<Rc<dyn ConnectedAnimationConfiguration>>
Gets the configuration that controls timing and visual style.
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.
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.
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.
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.
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.
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.
set_is_scale_animation_enabled
fn set_is_scale_animation_enabled(self: &Self, value: bool)
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyAnyValueClassDefaultsErasedDestructorIntoEitherPartialEq
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.