123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- using Prism.Commands;
- using Prism.Mvvm;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- namespace PDF_Master.ViewModels.Dialog.ServiceDialog
- {
- public class IAPCompareDialogViewModel : BindableBase,IDialogAware
- {
-
-
- public string Title => "";
- public event Action<IDialogResult> RequestClose;
- #region 文案
- private string _Text_Signup = "";
- public string Text_Signup
- {
- get { return _Text_Signup; }
- set
- {
- SetProperty(ref _Text_Signup, value);
- }
- }
- private string _Text_Login = "";
- public string Text_Login
- {
- get { return _Text_Login; }
- set
- {
- SetProperty(ref _Text_Login, value);
- }
- }
- private void InitString()
- {
- Text_Signup = App.ServiceLoader.GetString("Text_Signup");
- Text_Login = App.ServiceLoader.GetString("Text_Login");
- }
- #endregion
- private string _IAPRegionName;
- public string IAPRegionName
- {
- get { return _IAPRegionName; }
- set { _IAPRegionName = value; }
- }
- private List<User> _Items= new List<User>();
- public List<User> Items
- {
- get { return _Items; }
- set { _Items = value; }
- }
- public bool CanCloseDialog()
- {
- return true;
- }
- public void OnDialogClosed()
- {
-
- }
- public void OnDialogOpened(IDialogParameters parameters)
- {
-
- }
- public enum UseType { CreatePDF, ConvertPDF , AdvancedEditTools, AnnotatePDF, Security};
- public class User
- {
-
- public string Use { get; set; }
- public bool Re { get; set; }
- public bool UnRe { get; set; }
-
- public UseType UseType { get; set; }
- }
- public DelegateCommand GoLoginCommand { get; set; }
- public DelegateCommand GoRegisterCommand { get; set; }
- public IAPCompareDialogViewModel(IRegionManager regionManager, IDialogService dialogService)
- {
-
- IAPRegionName = Guid.NewGuid().ToString();
- GoLoginCommand = new DelegateCommand(GoLogin);
- GoRegisterCommand = new DelegateCommand(GoRegisterd);
- InitString();
-
-
- Items.Add(new User() { Use = "Create PDF from Microsoft Word, PowerPoint, Excel, Text, and image", UnRe = true, Re=true, UseType = UseType.CreatePDF });
- Items.Add(new User() { Use = "Create PDF from scanner", UnRe = true, Re = true, UseType = UseType.CreatePDF });
- Items.Add(new User() { Use = "Convert PDF to Microsoft Word, Excel, PPT, Text, and image", UnRe = false, Re = true, UseType = UseType.ConvertPDF });
- Items.Add(new User() { Use = "Turn PDF to RTF, HTML, CSV", UnRe = false, Re = true, UseType = UseType.ConvertPDF });
- Items.Add(new User() { Use = "Save as flatten PDF", UnRe = false, Re = true, UseType = UseType.ConvertPDF });
- Items.Add(new User() { Use = "Merge multiple PDFs", UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
- Items.Add(new User() { Use = "Fill & sign forms", UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
- Items.Add(new User() { Use = "Crop pages", UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
- Items.Add(new User() { Use = "Rotate, delete, paste, copy pages", UnRe = false, Re = true, UseType = UseType.AdvancedEditTools });
- Items.Add(new User() { Use = "Basic markup tools", UnRe = true, Re = true, UseType = UseType.AnnotatePDF });
- Items.Add(new User() { Use = "Hyperlink", UnRe = false, Re = true, UseType = UseType.AnnotatePDF });
- Items.Add(new User() { Use = "Stamp", UnRe = false, Re = true, UseType = UseType.AnnotatePDF });
- Items.Add(new User() { Use = "Signature", UnRe = false, Re = true, UseType = UseType.AnnotatePDF });
- Items.Add(new User() { Use = "Add password and permission", UnRe = false, Re = true, UseType = UseType.Security });
- Items.Add(new User() { Use = "Remove password", UnRe = false, Re = true, UseType = UseType.Security });
- CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(Items);
- PropertyGroupDescription groupDescription = new PropertyGroupDescription("UseType");
- view.GroupDescriptions.Add(groupDescription);
- }
- private void GoRegisterd()
- {
- RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
- App.mainWindowViewModel.OpenRegister();
- }
- private void GoLogin()
- {
- RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
- App.mainWindowViewModel.OpenLogin();
- }
-
- }
- }
|