SplitDialogViewModel.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using Prism.Commands;
  2. using Prism.Mvvm;
  3. using Prism.Services.Dialogs;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. namespace PDF_Office.ViewModels.Dialog.PageEditDialogs
  10. {
  11. public class SplitDialogViewModel : BindableBase, IDialogAware
  12. {
  13. public string Title => "";
  14. public event Action<IDialogResult> RequestClose;
  15. public DelegateCommand CancelCommand { get; set; }
  16. public DelegateCommand SplitCommnad { get; set; }
  17. public SplitDialogViewModel()
  18. {
  19. CancelCommand = new DelegateCommand(cancel);
  20. SplitCommnad = new DelegateCommand(split);
  21. }
  22. private void cancel()
  23. {
  24. RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
  25. }
  26. private void split()
  27. {
  28. DialogParameters valuePairs = new DialogParameters();
  29. RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
  30. }
  31. public bool CanCloseDialog()
  32. {
  33. return true;
  34. }
  35. public void OnDialogClosed()
  36. {
  37. }
  38. public void OnDialogOpened(IDialogParameters parameters)
  39. {
  40. }
  41. }
  42. }