public static MessageBoxResult ShowAlertMessage(string alertMessage) { var messageWindow = new MessageWindow(MessageBoxType.AlertBox); const ResponseButton responseButton = ResponseButton.Ok; SetMessageButtons(messageWindow, responseButton); messageWindow.txtMessageString.Text = alertMessage; messageWindow.imgAlert.Visibility = Visibility.Visible; messageWindow.lblFormTitle.Content = "Alert"; messageWindow.ShowDialog(); return(messageWindow.MessageBoxResult); }
public static MessageBoxResult ShowNotifyMessage(string notifyMessage) { var messageWindow = new MessageWindow(MessageBoxType.InformBox); const ResponseButton responseButton = ResponseButton.Ok; SetMessageButtons(messageWindow, responseButton); messageWindow.txtMessageString.Text = notifyMessage; messageWindow.imgInfo.Visibility = Visibility.Visible; messageWindow.lblFormTitle.Content = "Notify"; messageWindow.ShowDialog(); return(messageWindow.MessageBoxResult); }
public static MessageBoxResult ShowWarningMessage(string warningMessage) { var messageWindow = new MessageWindow(MessageBoxType.WarningBox); const ResponseButton responseButton = ResponseButton.OkCancel; SetMessageButtons(messageWindow, responseButton); messageWindow.txtMessageString.Text = warningMessage; messageWindow.imgWarning.Visibility = Visibility.Visible; messageWindow.lblFormTitle.Content = "Warning"; messageWindow.ShowDialog(); return(messageWindow.MessageBoxResult); }
public static MessageBoxResult ShowConfirmMessage(string confirmMessage) { var messageWindow = new MessageWindow(MessageBoxType.ConfirmBox); const ResponseButton responseButton = ResponseButton.YesNo; SetMessageButtons(messageWindow, responseButton); messageWindow.txtMessageString.Text = confirmMessage; messageWindow.imgConfirm.Visibility = Visibility.Visible; messageWindow.lblFormTitle.Content = "Confirm"; messageWindow.ShowDialog(); return(messageWindow.MessageBoxResult); }
// ShowPromptAndResponses instantiates any buttons and sets up the UI private void ShowPromptAndResponses(DialogPromptNode prompt) { this.AssignControllers(); promptText.text = langCtrl.GetValue(prompt.GetKeyPhrase()); yPosition = 600f; Debug.Log("there are " + prompt.GetResponses().Count + " responses"); foreach (DialogResponse resp in prompt.GetResponses()) { ResponseButton button = Instantiate(respButton) as ResponseButton; button.Setup(this, resp, canvas, yPosition, langCtrl.GetValue(resp.GetKeyPhrase())); buttons.Add(button); yPosition -= 100f; } index++; }
static void SetMessageButtons(MessageWindow messageWindow, ResponseButton responseButton) { switch (responseButton) { case ResponseButton.Ok: messageWindow.btnOK.Visibility = Visibility.Visible; break; case ResponseButton.OkCancel: messageWindow.btnOK.Visibility = Visibility.Visible; messageWindow.btnCancel.Visibility = Visibility.Visible; break; case ResponseButton.Yes: messageWindow.btnYes.Visibility = Visibility.Visible; break; case ResponseButton.YesNo: messageWindow.btnYes.Visibility = Visibility.Visible; messageWindow.btnNo.Visibility = Visibility.Visible; break; } }