private void UpdateMsgDialogType(MsgDialogType dialogType) { switch (dialogType) { case MsgDialogType.none: IsNotIconVisible = true; IconKind = PackIconKind.Information; break; case MsgDialogType.infor: IsNotIconVisible = false; IconKind = PackIconKind.Information; break; case MsgDialogType.warrning: IsNotIconVisible = false; IconKind = PackIconKind.Alert; break; case MsgDialogType.error: IsNotIconVisible = false; IconKind = PackIconKind.CloseCircle; break; case MsgDialogType.Confirmation: IsNotIconVisible = true; IconKind = PackIconKind.Information; Message += " ?"; break; } }
private bool ShowMessageDialg(string title, string message, MsgDialogType dialogType) { bool result = false; dialogService.ShowMsgDialog(title, message, dialogType, (r) => { if (r.Result == ButtonResult.OK) { result = true; } }); return(result); }
public static void ShowMsgDialog(this IDialogService dialogService, string title, string message, MsgDialogButtonType dialogButtonType, MsgDialogType dialogType, Action <IDialogResult> callBack) { DialogParameters param = new DialogParameters() { { DialogParameterKeys.Title, title }, { DialogParameterKeys.Message, message }, { DialogParameterKeys.ButtonType, dialogButtonType }, { DialogParameterKeys.DialogType, dialogType } }; dialogService.ShowDialog("WingcodeMsgDialog", param, callBack); }
public void OnDialogOpened(IDialogParameters parameters) { if (parameters == null) { return; } Title = parameters.GetValue <string>(DialogParameterKeys.Title); Message = parameters.GetValue <string>(DialogParameterKeys.Message); MsgDialogButtonType bType = parameters.GetValue <MsgDialogButtonType>(DialogParameterKeys.ButtonType); UpdateMsgBoxButtons(bType); MsgDialogType dialogType = parameters.GetValue <MsgDialogType>(DialogParameterKeys.DialogType); UpdateMsgDialogType(dialogType); }