/// <summary> /// Prompts the user to select an option. /// </summary> /// <param name = "message">The message to present to the user.</param> /// <param name = "caption">The caption to present to the user.</param> /// <param name = "options">The options the user can pick from.</param> /// <returns> /// The option the user picked. /// </returns> public string Prompt(string message, string caption, params string[] options) { var window = new UserInteractionServicePromptWindow(); window.Title = caption; window.Message = message; // We want the option buttons pushed to the right, which requires // a flow direction of Right-to-Left, so we add the options // in reverse order to still get them ordered correctly. foreach (var option in options.Reverse()) { window.Options.Add(option); } window.ShowDialog(); return window.SelectedOption; }
/// <summary> /// Prompts the user to select an option. /// </summary> /// <param name = "message">The message to present to the user.</param> /// <param name = "caption">The caption to present to the user.</param> /// <param name = "options">The options the user can pick from.</param> /// <returns> /// The option the user picked. /// </returns> public string Prompt(string message, string caption, params string[] options) { var window = new UserInteractionServicePromptWindow(); window.Title = caption; window.Message = message; // We want the option buttons pushed to the right, which requires // a flow direction of Right-to-Left, so we add the options // in reverse order to still get them ordered correctly. foreach (var option in options.Reverse()) { window.Options.Add(option); } window.ShowDialog(); return(window.SelectedOption); }