CPDFDrawModeControl.xaml.cs 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using ComPDFKitViewer;
  2. using ComPDFKitViewer.PdfViewer;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace compdfkit_tools.PDFControl
  18. {
  19. /// <summary>
  20. /// PDFDrawModeControl.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class CPDFDrawModeControl : UserControl
  23. {
  24. public CPDFViewer pdfViewer;
  25. public Dictionary<string, DrawModes> GetDrawMode = new Dictionary<string, DrawModes>();
  26. public CPDFDrawModeControl()
  27. {
  28. InitializeComponent();
  29. CPDFDrawModeUI.Loaded += CPDFDrawModeUI_Loaded;
  30. }
  31. private void CPDFDrawModeUI_Loaded(object sender, RoutedEventArgs e)
  32. {
  33. GetDrawMode.Clear();
  34. GetDrawMode.Add("Normal", DrawModes.Draw_Mode_Normal);
  35. GetDrawMode.Add("Soft", DrawModes.Draw_Mode_Soft);
  36. GetDrawMode.Add("Dark", DrawModes.Draw_Mode_Dark);
  37. GetDrawMode.Add("Green", DrawModes.Draw_Mode_Green);
  38. GetDrawMode.Add("Custom", DrawModes.Draw_Mode_Custom);
  39. CPDFDrawModeUI.SetDrawModeEvent += CPDFDrawModeUI_SetDrawModeEvent;
  40. }
  41. private void CPDFDrawModeUI_SetDrawModeEvent(object sender, string e)
  42. {
  43. pdfViewer.SetDrawMode(GetDrawMode[(sender as RadioButton).Tag as string]);
  44. }
  45. public void InitWithPDFViewer(CPDFViewer pdfViewer)
  46. {
  47. this.pdfViewer = pdfViewer;
  48. }
  49. }
  50. }