Skip to content

Allow Shell.Current.DisplayPromptAsync to be cancelled with a CancellationTokenSource #14631

@AndreasReitberger

Description

@AndreasReitberger

Description

I have a usecase, where a prompt is displayed and an input is required. If the input doesn't happen in a specified time, the prompt should close and return null.

Public API Changes

await Shell.Current.DisplayPromptAsync(
"Input Unit",
"Waiting for robo to input the Unit.", x,x,x,
new CancellationTokenSource(TimeSpan.FromSeconds(30))
)

Intended Use-Case

When a CancellationTokenSource is passed, and it's cancled (by timeout or whatever), the prompt should be closed and return null or an empty string.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions