/// <summary> /// Displays the <see cref="PromptBox" /> window to the user and returns the <see cref="MessageResult" /> from the /// button clicked. /// </summary> /// <param name="messageText">The prompt message text.</param> /// <param name="windowTitle">The prompt window title.</param> /// <returns>MessageResult.</returns> public static MessageResult ShowPrompt(string messageText, string windowTitle) { var prompt = new PromptBox(); if (!string.IsNullOrEmpty(messageText)) { var grid = new Grid { Margin = new Thickness(15) }; var text = new TextBlock { Text = messageText }; grid.Children.Add(text); prompt.Content = grid; } prompt.Title = windowTitle ?? string.Empty; return(PromptBox.ShowPrompt(prompt)); }
/// <summary> /// Displays the <see cref="PromptBox" /> window to the user and returns the <see cref="MessageResult" /> from the /// button clicked. /// </summary> /// <param name="prompt">The prompt.</param> /// <returns>MessageResult.</returns> public static MessageResult ShowPrompt(PromptBox prompt) { prompt.ShowDialog(); return(prompt.result); }
/// <summary> /// Displays the <see cref="PromptBox" /> window to the user and returns the <see cref="MessageResult" /> from the /// button clicked. /// </summary> /// <param name="prompt">The prompt.</param> /// <returns>MessageResult.</returns> public static MessageResult ShowPrompt(PromptBox prompt) { prompt.ShowDialog(); return prompt.result; }
/// <summary> /// Displays the <see cref="PromptBox" /> window to the user and returns the <see cref="MessageResult" /> from the /// button clicked. /// </summary> /// <param name="messageText">The prompt message text.</param> /// <param name="windowTitle">The prompt window title.</param> /// <returns>MessageResult.</returns> public static MessageResult ShowPrompt(string messageText, string windowTitle) { var prompt = new PromptBox(); if (!string.IsNullOrEmpty(messageText)) { var grid = new Grid {Margin = new Thickness(15)}; var text = new TextBlock {Text = messageText}; grid.Children.Add(text); prompt.Content = grid; } prompt.Title = windowTitle ?? string.Empty; return PromptBox.ShowPrompt(prompt); }