using PDF_Master.Helper; using PDF_Master.Model; using PDF_Master.Properties; using Prism.Commands; using Prism.Mvvm; using Prism.Regions; using Prism.Services.Dialogs; using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Threading; namespace PDF_Master.ViewModels.Dialog.ServiceDialog { public class RegisterOKRegionViewModel : BindableBase, IDialogAware { public IDialogService dialogs; public event Action RequestClose; #region 文案 private string _Textregisuccess = ""; public string Textregisuccess { get { return _Textregisuccess; } set { SetProperty(ref _Textregisuccess, value); } } private string _TextWelcome; public string TextWelcome { get { return _TextWelcome; } set { _TextWelcome = value; } } private string _TextPDF; public string TextPDF { get { return _TextPDF; } set { _TextPDF = value; } } private string _TextEnjoy; public string TextEnjoy { get { return _TextEnjoy; } set { _TextEnjoy = value; } } private string _TextOrsubscribe; public string TextOrsubscribe { get { return _TextOrsubscribe; } set { _TextOrsubscribe = value; } } private string _TextAIrobot; public string TextAIrobot { get { return _TextAIrobot; } set { _TextAIrobot = value; } } private string _TextUnlimited; public string TextUnlimited { get { return _TextUnlimited; } set { _TextUnlimited = value; } } private string _TextSaveNoWatermark; public string TextSaveNoWatermark { get { return _TextSaveNoWatermark; } set { _TextSaveNoWatermark = value; } } private string _BtnTextSubscribe; public string BtnTextSubscribe { get { return _BtnTextSubscribe; } set { _BtnTextSubscribe = value; } } private void InitString() { Textregisuccess = App.ServiceLoader.GetString("Text_regisuccess"); TextWelcome = App.ServiceLoader.GetString("TextWelcome"); TextPDF = App.ServiceLoader.GetString("TextPDF"); TextEnjoy = App.ServiceLoader.GetString("TextEnjoy"); TextOrsubscribe = App.ServiceLoader.GetString("TextOrsubscribe"); TextAIrobot = App.ServiceLoader.GetString("TextAIrobot"); TextUnlimited = App.ServiceLoader.GetString("TextUnlimited"); TextSaveNoWatermark = App.ServiceLoader.GetString("TextSaveNoWatermark"); BtnTextSubscribe = App.ServiceLoader.GetString("BtnTextSubscribe"); } #endregion public DelegateCommand LinkstoreCommand { get; set; } public DelegateCommand OpenIAPCommand { get; set; } public string Title => throw new NotImplementedException(); public RegisterOKRegionViewModel(IRegionManager regionManager, IDialogService dialogService) { LinkstoreCommand = new DelegateCommand(Linkstore); OpenIAPCommand = new DelegateCommand(OpenIAP); dialogs = dialogService; InitString(); } private void OpenIAP() { Close(); dialogs.ShowDialog(DialogNames.IAPCompareDialog); } private void Linkstore() { Process.Start(new ProcessStartInfo(ServiceHelper.WebHost+"/windows/store/master?email=" + Settings.Default.UserDate.Email)); } public void Close() { RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel)); } public bool CanCloseDialog() { return true; } public void OnDialogClosed() { } public void OnDialogOpened(IDialogParameters parameters) { } } }