HomePageExtractDialog.xaml.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using PDF_Office.CustomControl;
  2. using PDF_Office.Helper;
  3. using PDF_Office.ViewModels.Dialog.ConverterDialogs;
  4. using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Diagnostics;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows;
  12. using System.Windows.Controls;
  13. using System.Windows.Data;
  14. using System.Windows.Documents;
  15. using System.Windows.Input;
  16. using System.Windows.Media;
  17. using System.Windows.Media.Imaging;
  18. using System.Windows.Navigation;
  19. using System.Windows.Shapes;
  20. namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
  21. {
  22. /// <summary>
  23. /// MainPageExtractDialog.xaml 的交互逻辑
  24. /// </summary>
  25. public partial class HomePageExtractDialog : UserControl
  26. {
  27. public HomePageExtractDialog()
  28. {
  29. InitializeComponent();
  30. }
  31. private void PageTurningPreview_Loaded(object sender, RoutedEventArgs e)
  32. {
  33. ExtractPreview.document = ((HomePageExtractDialogViewModel)this.DataContext).document;
  34. char[] enumerationSeparator = new char[] { ',' };
  35. char[] rangeSeparator = new char[] { '-' };
  36. if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, "1-" + ExtractPreview.document.PageCount.ToString(), ExtractPreview.document.PageCount, enumerationSeparator, rangeSeparator))
  37. { //TODO
  38. Trace.WriteLine("输入不对");
  39. MessageBoxEx.Show("输入不对");
  40. return;
  41. }
  42. ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
  43. ExtractPreview.PageIndex.Text = ExtractPreview.document.PageCount.ToString();
  44. }
  45. }
  46. }