2024-05-21 20:15:19 +01:00
|
|
|
|
using SPT.Launcher.Helpers;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
using ReactiveUI;
|
|
|
|
|
|
2024-05-21 20:15:19 +01:00
|
|
|
|
namespace SPT.Launcher.ViewModels.Dialogs
|
2023-03-03 19:25:33 +00:00
|
|
|
|
{
|
|
|
|
|
public class ConfirmationDialogViewModel : ViewModelBase
|
|
|
|
|
{
|
|
|
|
|
public string Question { get; set; }
|
|
|
|
|
public string ConfirmButtonText { get; set; }
|
|
|
|
|
public string DenyButtonText { get; set; }
|
2024-06-02 14:46:53 -04:00
|
|
|
|
public bool AllowConfirm { get; set; }
|
2023-03-03 19:25:33 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// A confirmation dialog
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="Host">Set to null when <see cref="ViewModelBase.ShowDialog(object)"/> is used, since the dialog host is handling routing</param>
|
|
|
|
|
/// <param name="Question"></param>
|
|
|
|
|
/// <param name="ConfirmButtonText"></param>
|
|
|
|
|
/// <param name="DenyButtonText"></param>
|
2024-06-02 14:46:53 -04:00
|
|
|
|
public ConfirmationDialogViewModel(IScreen Host, string Question, string? ConfirmButtonText = null, string? DenyButtonText = null, bool allowConfirm = true) : base(Host)
|
2023-03-03 19:25:33 +00:00
|
|
|
|
{
|
|
|
|
|
this.Question = Question;
|
|
|
|
|
this.ConfirmButtonText = ConfirmButtonText ?? LocalizationProvider.Instance.yes;
|
|
|
|
|
this.DenyButtonText = DenyButtonText ?? LocalizationProvider.Instance.no;
|
2024-06-02 14:46:53 -04:00
|
|
|
|
this.AllowConfirm = allowConfirm;
|
2023-03-03 19:25:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|