/// <summary> /// Method to be called when the dialog intends to close /// and ready to pass a value back to the caller. /// </summary> /// <param name="result">The return value of the dialog</param> protected void Close(DialogResultKind kind = DialogResultKind.Normal, TResult result = default) { if (_currentTaskCompletionSource.Task.IsCompleted) { return; } _currentTaskCompletionSource.SetResult(new DialogResult <TResult>(result, kind)); _disposable.Dispose(); IsDialogOpen = false; OnDialogClosed(); }
public DialogResult(TResult?result, DialogResultKind kind) { Result = result; Kind = kind; }