14 public class DisplayAlert(string Title, string Message, string? Accept, string? Cancel) :
UiTask
19 public string Title {
get; } = Title;
24 public string Message {
get; } = Message;
29 public string? Accept {
get; } = Accept;
34 public string? Cancel {
get; } = Cancel;
39 public TaskCompletionSource<bool> CompletionSource {
get; } =
new TaskCompletionSource<bool>();
44 public override async Task Execute()
50 if (!
string.IsNullOrWhiteSpace(this.Accept) && !
string.IsNullOrWhiteSpace(this.Cancel))
52 Result = await (displayedPage?.DisplayAlert(this.Title, this.Message, this.Accept, this.Cancel) ??
53 Task.FromResult(
false));
55 else if (!
string.IsNullOrWhiteSpace(this.Cancel))
57 await (displayedPage?.DisplayAlert(this.Title, this.Message, this.Cancel) ?? Task.CompletedTask);
60 else if (!
string.IsNullOrWhiteSpace(this.Accept))
62 await (displayedPage?.DisplayAlert(this.Title, this.Message, this.Accept) ?? Task.CompletedTask);
67 await (displayedPage?.DisplayAlert(this.Title, this.Message,
73 this.CompletionSource.TrySetResult(Result);
The Application class, representing an instance of the Neuro-Access app.
static new? App Current
Gets the current application, type casted to App.
Base class that references services in the app.
static IUiService UiService
Service serializing and managing UI-related tasks.
static IStringLocalizer Localizer
Localization service
Abstract base class for UI tasks.