21 lines
559 B
C#
21 lines
559 B
C#
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Jugenddienst_Stunden.Models;
|
|
public sealed class ConfirmationEventArgs : System.EventArgs {
|
|
public string Title { get; }
|
|
public string Message { get; }
|
|
public string ConfirmText { get; }
|
|
|
|
private readonly TaskCompletionSource<bool> _tcs = new();
|
|
|
|
public ConfirmationEventArgs(string title, string message, string confirmText = "OK") {
|
|
Title = title;
|
|
Message = message;
|
|
ConfirmText = confirmText;
|
|
}
|
|
|
|
public Task<bool> Task => _tcs.Task;
|
|
|
|
public void SetResult(bool result) => _tcs.TrySetResult(result);
|
|
} |