CanvasControllerTransitionContext

public class CanvasControllerTransitionContext;

Description

When a transition between two canvas controllers occurs, a transition context is created to describe the transition. This context is passed to the transition’s animator to provide the animator with the necessary data in order to carry out the animation.

When implementing a custom transition animator, you use the context to access the canvas controllers involved in the transition in order to animate them. The sourceCanvasController is the canvas controller being transitioned from; the destinationCanvasController is the canvas controller being transition to. Note that you always transition from the source to the destination. This includes in an upstream transition - a dismissal - in which the source is the canvas controller being dismissed and the destination is the canvas controller being returned to.

In the event that the transition is presenting or dismissing an initial canvas controller, either the context's sourceCanvasController or destinationCanvasController will be null, depending on whether the transition is upstream - i.e. it is presenting/dismissing to 'nothing'.

You must call CompleteTransition on the context when your transition animator has completed its animation. This tells Canvas Flow that the custom animation has been performed and to complete the transition.

See also:

CanvasControllerTransitioningAnimator

CanvasController.transitioningAnimatorVendor

Properties
destinationCanvasController The canvas controller being transitioned to.
isUpstream Is the transition upstream?
sourceCanvasController The canvas controller being transitioned from.
Methods
CompleteTransition You must call CompleteTransition() on the context when your transition animator has completed its animation. This tells Canvas Flow that the custom animation has been performed and to complete the transition.
DestinationCanvasController<T> The canvas controller being transitioned to, if it is of type T.
SourceCanvasController<T> The canvas controller being transitioned from, if it is of type T.

destinationCanvasController

public readonly CanvasController destinationCanvasController;

Description

The canvas controller being transitioned to.

In a downstream transition - a presentation - this is the canvas controller being presented. In an upstream transition - a dismissal - this is the canvas controller whom is being dismissed to.


isUpstream

public readonly bool isUpstream;

Description

Is the transition upstream?

An upstream transition refers to a dismissal. If false the transition is downstream, which refers to a presentation. You might use this flag to distinguish between an upstream and a downstream transition (a dismissal or a presentation) in your transition animator.


sourceCanvasController

public readonly CanvasController sourceCanvasController;

Description

The canvas controller being transitioned from.

In a downstream transition - a presentation - this is the canvas controller whom is presenting - the presenter. In an upstream transition - a dismissal - this is the canvas controller being dismissed.


CompleteTransition

public void CompleteTransition();

Description

You must call CompleteTransition() on the context when your transition animator has completed its animation. This tells Canvas Flow that the custom animation has been performed and to complete the transition.


DestinationCanvasController<T>

public T DestinationCanvasController<T>() where T : CanvasController;

Description

The canvas controller being transitioned to, if it is of type T.

In a downstream transition - a presentation - this is the canvas controller being presented. In an upstream transition - a dismissal - this is the canvas controller whom is being dismissed to. If the destinationCanvasController is not of type T, returns null.


SourceCanvasController<T>

public T SourceCanvasController<T>() where T : CanvasController;

Description

The canvas controller being transitioned from, if it is of type T.

In a downstream transition - a presentation - this is the canvas controller whom is presenting - the presenter. In an upstream transition - a dismissal - this is the canvas controller being dismissed. If the sourceCanvasController is not of type T, returns null.