/// <summary> /// Displays a PromptDialog window, waits for a response, then returns the response. /// </summary> /// <param name="instructions">The instructions to show to the user.</param> /// <param name="title">The text to set as the window's title.</param> /// <param name="defaultAnswer">An optional default response (ignored for password dialogs).</param> /// <param name="isPassword">If true, the dialog will mask the response field.</param> /// <returns>The text entered in the response field; null if the dialog was cancelled.</returns> public static string Prompt(string instructions, string title, bool isPassword = false, string defaultAnswer = "") { PromptDialog dialog = new PromptDialog(instructions, title, isPassword, defaultAnswer); if (dialog.ShowDialog() == true) return dialog.Answer; return null; }