/// <inheritdoc/> public bool ShowConfirmationDialog(ConfirmationDialogType confirmType, params object[] data) { #if DEBUG switch (confirmType) { case ConfirmationDialogType.DeleteLabel: Debug.Assert(data.Length == 1, "Expected Data[0] to contain the label name"); break; case ConfirmationDialogType.DeleteProfile: Debug.Assert(data.Length == 1, "Expected data[0] to contain the profile name"); break; } #endif var dialog = new ConfirmationDialog(confirmType, data); var result = dialog.ShowDialog(); return(result.GetValueOrDefault(false)); }
public static bool Confirm(ConfirmationDialogType dialogType, Window parent) { string username = SquiggleContext.Current.ChatClient.Coalesce(c => c.CurrentUser.DisplayName, String.Empty); return(ConfirmationDialog.Show(username, dialogType, parent)); }
/// <summary> /// Initializes a new instance of the <see cref="ConfirmationDialog"/> class. /// </summary> /// <param name="confirmType">Type of confirmation.</param> /// <param name="data">Data for confirmation dialog.</param> public ConfirmationDialog(ConfirmationDialogType confirmType, object[] data) { DialogType = confirmType; DialogData = data; InitializeComponent(); }