HomeGuidContentViewModel.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using ComPDFKitViewer.PdfViewer;
  2. using PDF_Office.Model;
  3. using PDF_Office.Model.PDFTool;
  4. using PDF_Office.Views.HomePanel.PDFTools;
  5. using Prism.Commands;
  6. using Prism.Mvvm;
  7. using Prism.Services.Dialogs;
  8. using System;
  9. using System.Collections.Generic;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. namespace PDF_Office.ViewModels.HomePanel
  14. {
  15. public class HomeGuidContentViewModel:BindableBase
  16. {
  17. public IDialogService dialogs;
  18. public DelegateCommand<ToolItem> QuickToolsCommand { get; set; }
  19. public HomeGuidContentViewModel(IDialogService dialogService)
  20. {
  21. QuickToolsCommand = new DelegateCommand<ToolItem>(QuickTools_Click);
  22. dialogs = dialogService;
  23. }
  24. public void QuickTools_Click(ToolItem toolItem)
  25. {
  26. switch (toolItem.Tag)
  27. {
  28. case PDFToolType.Split:
  29. Split_Click();
  30. DialogParameters splitvalue = new DialogParameters();
  31. dialogs.ShowDialog(DialogNames.MainPageSplitDialog, splitvalue, e => { });
  32. break;
  33. case PDFToolType.Extract:
  34. DialogParameters extractvalue = new DialogParameters();
  35. dialogs.ShowDialog(DialogNames.MainPageExtractDialog, extractvalue, e => { });
  36. break;
  37. case PDFToolType.Insert:
  38. DialogParameters insertvalue = new DialogParameters();
  39. dialogs.ShowDialog(DialogNames.MainPageInsertDialog, insertvalue, e => { });
  40. break;
  41. case PDFToolType.Compress:
  42. break;
  43. case PDFToolType.Merge:
  44. break;
  45. case PDFToolType.Print:
  46. DialogParameters printvalue = new DialogParameters();
  47. dialogs.ShowDialog(DialogNames.MainPagePrinterDialog, printvalue, e => { });
  48. break;
  49. case PDFToolType.Security:
  50. break;
  51. }
  52. }
  53. private void Split_Click()
  54. {
  55. }
  56. }
  57. }