public static Task <MessageDialogResult> ShowConfirmationDialog( string additionalMessage = null, MetroDialogSettings settings = null) { if (!LocalizationUtils.TryGetLocalized("ConfirmationTitle", out var title)) { title = "Confirmation"; } if (!LocalizationUtils.TryGetLocalized("ConfirmationMessage", out var message)) { message = "Are you sure?"; } if (!string.IsNullOrEmpty(additionalMessage)) { message += " " + additionalMessage; } return(ShowMessageDialog(title, message, true, settings)); }
public MultilineTextDialog(string title = "Enter", string message = "Enter", string inputValue = "", string defaultValue = null, bool isCancellable = true) { InitializeComponent(); DataContext = this; DialogTitle = title; DialogMessage = message; InputValue = inputValue; DefaultValue = defaultValue; IsCancellable = isCancellable; if (!LocalizationUtils.TryGetLocalized("OkTitle", out _)) { btnOk.Content = "Ok"; } if (!LocalizationUtils.TryGetLocalized("CancelTitle", out _)) { btnCancel.Content = "Cancel"; } }
public PasswordDialog(string title = "Enter", string message = "Enter", bool canGeneratePassword = false, string defaultValue = null, bool isCancellable = true) { InitializeComponent(); DataContext = this; DialogTitle = title; DialogMessage = message; DefaultValue = defaultValue; CanGeneratePassword = canGeneratePassword; IsCancellable = isCancellable; if (!LocalizationUtils.TryGetLocalized("OkTitle", out _)) { btnOk.Content = "Ok"; } if (!LocalizationUtils.TryGetLocalized("CancelTitle", out _)) { btnCancel.Content = "Cancel"; } }
public override bool TryGetLocalized( string key, out string value) { return(LocalizationUtils.TryGetLocalized( key, out value)); }