/// <summary> /// Gets a yes or no input from the user. /// </summary> /// <param name="title">The title of the window</param> /// <param name="instructionText">The text to instruct the user about what they're choosing.</param> /// <param name="extraButtonText">Text for the extra button.</param> /// <returns>A string with either "yes", "no" or "extraButtonClicked".</returns> public static string GetYesOrNo(string title, string headline, string instructionBoxText, string extraButtonText) { YesOrNoWindow window = new YesOrNoWindow(); window.Title = title; if (extraButtonText.Length < 1) { window.ExtraButton.Opacity = 0; } window.instructionTextBlock.Text = headline; window.InfoBox.Text = instructionBoxText; window.ExtraButton.Content = extraButtonText; window.ShowDialog(); return(window.instructionTextBlock.Text); }
/// <summary> /// Gets a yes or no input from the user. /// </summary> /// <param name="title">The title of the window</param> /// <param name="instructionText">The text to instruct the user about what they're choosing.</param> /// <param name="extraButtonText">Text for the extra button.</param> /// <returns>A string with either "yes", "no" or "extraButtonClicked".</returns> public static string GetYesOrNo(string title, string headline, string instructionBoxText, string extraButtonText, bool hasOwner) { YesOrNoWindow window = new YesOrNoWindow(); window.Title = title; if (extraButtonText.Length < 1) { window.ExtraButton.Opacity = 0; } window.instructionTextBlock.Text = headline; window.InfoBox.Text = instructionBoxText; window.ExtraButton.Content = extraButtonText; if (hasOwner == true) { window.Owner = Application.Current.MainWindow; } window.WindowStartupLocation = WindowStartupLocation.CenterOwner; window.ShowDialog(); return(window.instructionTextBlock.Text); }