public async void ButtonClick(string param) { await Dispatcher.UIThread.InvokeAsync(() => { _window.Result = new DialogResult(param); _window.Close(); }); }
/// <summary> /// Show confirmation popup /// </summary> /// <param name="title"></param> /// <param name="message"></param> /// <param name="onClosedCallback"></param> public void Confirm(string title, string message, Action <DialogResult> onClosedCallback) { _alertDialog.Close(); _confirmationDialog.Title = title; _confirmationDialog.Message = message; _confirmationDialog.Closed += (s, e) => { if (onClosedCallback != null) { DialogResult result = new DialogResult(); result.Result = _confirmationDialog.DialogResult; onClosedCallback(result); } }; _confirmationDialog.Width = Width; _confirmationDialog.Height = Height; _confirmationDialog.Show(); }