Table of Contents

Class ScreenActivityContext

Namespace
MackySoft.Navigathena
Assembly
MackySoft.Navigathena.dll

Provides navigation and cancellation for one foreground activation period.

public class ScreenActivityContext
Inheritance
ScreenActivityContext
Derived
Inherited Members

Remarks

The period ends on departure or modal cover. A retained return receives a new context. Rendering, game simulation and binding-owned work are not owned by this period.

Properties

CancellationToken

Signals the end of this activation period. Use a separate lifetime for work that must survive modal cover.

public CancellationToken CancellationToken { get; }

Property Value

CancellationToken

EntryId

public NavigationEntryId EntryId { get; }

Property Value

NavigationEntryId

ForegroundToken

The valid operation qualification for this activation. Native input and focus admission are ready when activation starts.

public ScreenForegroundToken ForegroundToken { get; }

Property Value

ScreenForegroundToken

Remarks

Retain this value when accepting an operation. Departure invalidates it before native focus-loss callbacks; a later activation supplies a different token.

IsFirstActivation

True until this history entry has successfully completed its first activation transition.

public bool IsFirstActivation { get; }

Property Value

bool

Navigation

public IScreenNavigation Navigation { get; }

Property Value

IScreenNavigation

PreparationReason

public ScreenPreparationReason? PreparationReason { get; }

Property Value

ScreenPreparationReason?

Reason

public ScreenActivationReason Reason { get; }

Property Value

ScreenActivationReason

RegionId

public RegionInstanceId RegionId { get; }

Property Value

RegionInstanceId

Methods

StartWork(Func<ScreenWorkContext, ValueTask>)

Schedules owned work after the current navigation settles. Do not await its completion inside a lifecycle callback.

public ScreenWork StartWork(Func<ScreenWorkContext, ValueTask> work)

Parameters

work Func<ScreenWorkContext, ValueTask>

The complete asynchronous operation, including any cleanup that uses screen resources.

Returns

ScreenWork

A handle for observing completion or requesting execution cancellation.

Remarks

Work registered during activation starts only after activation succeeds; a failed activation cancels its pending work. Once started, work survives deactivation until it finishes, is canceled, or its screen binding ends.

Exceptions

ArgumentNullException

work is null.

InvalidOperationException

This activity or its screen binding has ended.