Class NavigationTransition
- Namespace
- MackySoft.Navigathena
- Assembly
- MackySoft.Navigathena.dll
Describes how an operation obtains its whole-transition effect.
public sealed class NavigationTransition
- Inheritance
-
NavigationTransition
- Inherited Members
Remarks
The runtime checks cancellation before invoking the effect factory and before using its result. The factory forwards the token to ongoing work without duplicating the entry check. Registered resources and a returned effect are cleaned up even after cancellation.
Constructors
NavigationTransition(NavigationTransitionScope, Func<NavigationTransitionPreparationContext, CancellationToken, ValueTask<INavigationTransitionEffect>>, bool, TransitionEndTiming)
Defines an operation-owned effect and when it must settle relative to retired screen resources.
public NavigationTransition(NavigationTransitionScope scope, Func<NavigationTransitionPreparationContext, CancellationToken, ValueTask<INavigationTransitionEffect>> createEffectAsync, bool requiresSimultaneousScreens = false, TransitionEndTiming endTiming = TransitionEndTiming.AfterPresentation)
Parameters
scopeNavigationTransitionScopeThe region or host whose presentation and input the effect covers.
createEffectAsyncFunc<NavigationTransitionPreparationContext, CancellationToken, ValueTask<INavigationTransitionEffect>>Creates or borrows the effect and registers its dependencies with the supplied lifetime. With AfterResourceRelease, their external owners must outlive settlement and must not end from a retiring screen's cleanup.
requiresSimultaneousScreensboolRequires outgoing and incoming screen instances to coexist during the effect.
endTimingTransitionEndTimingAfterResourceRelease keeps the effect alive and subscribed to progress until retired screen cleanup completes. Activation always follows settlement.
Properties
EndTiming
Determines whether the effect settles before or after retired screen resources finish releasing. Activation always follows settlement.
public TransitionEndTiming EndTiming { get; }
Property Value
None
public static NavigationTransition None { get; }
Property Value
RequiresSimultaneousScreens
public bool RequiresSimultaneousScreens { get; }
Property Value
Scope
public NavigationTransitionScope Scope { get; }
Property Value
Methods
Create<TState>(NavigationTransitionScope, ProgressDefinition<TState>, Func<NavigationTransitionPreparationContext, ProgressSource<TState>, CancellationToken, ValueTask<INavigationTransitionEffect>>, bool, TransitionEndTiming)
Connects an operation-local typed state before constructing the loading effect or acquiring destination screens.
public static NavigationTransition Create<TState>(NavigationTransitionScope scope, ProgressDefinition<TState> progress, Func<NavigationTransitionPreparationContext, ProgressSource<TState>, CancellationToken, ValueTask<INavigationTransitionEffect>> prepare, bool requiresSimultaneousScreens = false, TransitionEndTiming endTiming = TransitionEndTiming.AfterPresentation)
Parameters
scopeNavigationTransitionScopeThe region or host covered by the effect.
progressProgressDefinition<TState>The application's immutable state definition. Each execution receives a fresh state.
prepareFunc<NavigationTransitionPreparationContext, ProgressSource<TState>, CancellationToken, ValueTask<INavigationTransitionEffect>>Acquires or borrows the display and binds the supplied source with ObserveProgress. It does not perform destination initialization.
requiresSimultaneousScreensboolWhether outgoing and incoming screen instances must coexist.
endTimingTransitionEndTimingWhether settlement also waits for retired screen resources to be released.
Returns
Type Parameters
TState
FromDestinationScreen(NavigationTransitionScope, TransitionEndTiming)
Uses the prepared destination's effect. It cannot observe acquisition or initialization preceding its creation and settles before releasing its owner on rollback.
public static NavigationTransition FromDestinationScreen(NavigationTransitionScope scope, TransitionEndTiming endTiming = TransitionEndTiming.AfterPresentation)
Parameters
scopeNavigationTransitionScopeendTimingTransitionEndTiming
Returns
FromSourceScreen(NavigationTransitionScope, TransitionEndTiming)
Uses the source screen's effect. AfterResourceRelease requires that screen to remain alive; a transition retiring its owner is rejected before activity stops.
public static NavigationTransition FromSourceScreen(NavigationTransitionScope scope, TransitionEndTiming endTiming = TransitionEndTiming.AfterPresentation)
Parameters
scopeNavigationTransitionScopeendTimingTransitionEndTiming