/// <summary> /// Shows the dialog. /// </summary> /// <param name="closeButtonText">Close button text; if <c>null</c> or empty, the default is used.</param> /// <returns>A nullable value; if <c>true</c> the OK or equivalent was clicked; if <c>false</c>, /// the dialog was cancelled.</returns> public bool?ShowDialog(string closeButtonText) { bool?result = null; OSDispatcher.Current.InvokeOnMainDispatcher(() => { if (!string.IsNullOrEmpty(closeButtonText)) { ViewModel.CloseDialogButtonText = closeButtonText; } result = VisualHelpers.ShowDialog(this); }); return(result); }
/// <summary> /// Shows a modal dialog. /// </summary> /// <param name="dialog">The dialog to show.</param> /// <returns>A value indicating whether the dialog was cancelled (<c>false</c>), aborted (<c>null</c>) or approved (<c>true</c>).</returns> /// <remarks>This function also handles the close button of the dialog, treating it as a 'cancel' operation.</remarks> public static bool?ShowDialog(this Gtk.Dialog dialog) { return(VisualHelpers.ShowDialog(dialog, true)); }
/// <summary> /// For compatibility with the Mac version of the dialog. /// </summary> /// <returns>Returns <c>true</c> if the "OK" button was clicked.</returns> public bool?ShowDialog() { return(VisualHelpers.ShowDialog(this)); }