13 public class DisplayAlert(string Title, string Message, string? Accept, string? Cancel) :
UiTask
18 public string Title {
get; } = Title;
23 public string Message {
get; } = Message;
28 public string? Accept {
get; } = Accept;
33 public string? Cancel {
get; } = Cancel;
38 public TaskCompletionSource<bool> CompletionSource {
get; } =
new TaskCompletionSource<bool>();
43 public override async Task Execute()
49 if (!
string.IsNullOrWhiteSpace(this.Accept) && !
string.IsNullOrWhiteSpace(this.Cancel))
51 Result = await (DisplayedPage?.DisplayAlert(this.Title, this.Message, this.Accept, this.Cancel) ??
52 Task.FromResult(
false));
54 else if (!
string.IsNullOrWhiteSpace(this.Cancel))
56 await (DisplayedPage?.DisplayAlert(this.Title, this.Message, this.Cancel) ?? Task.CompletedTask);
59 else if (!
string.IsNullOrWhiteSpace(this.Accept))
61 await (DisplayedPage?.DisplayAlert(this.Title, this.Message, this.Accept) ?? Task.CompletedTask);
66 await (DisplayedPage?.DisplayAlert(this.Title, this.Message,
72 this.CompletionSource.TrySetResult(Result);
Represents an instance of the Neuro-Access app.
static new? App Current
Gets the current application instance.
A strongly-typed resource class, for looking up localized strings, etc.
static string Ok
Looks up a localized string similar to OK.
Base class that references services in the app.
static IReportingStringLocalizer Localizer
Localization service
Abstract base class for UI tasks.