AnnotToolContentViewModel.Properties.cs 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. using ComPDFKitViewer.AnnotEvent;
  2. using ComPDFKitViewer.PdfViewer;
  3. using PDF_Office.CustomControl;
  4. using Prism.Commands;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Media;
  11. namespace PDF_Office.ViewModels.Tools
  12. {
  13. /// <summary>
  14. /// 改变工具栏注释属性值,主要用来传参数:注释属性和同步工具栏对应图标的属性(颜色)
  15. /// </summary>
  16. public class AnnotPropertyPanel
  17. {
  18. public AnnotAttribEvent AnnotEvent { get; set; }
  19. public AnnotHandlerEventArgs annot;
  20. public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
  21. public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
  22. public event EventHandler<object> DefaultStored;
  23. public AnnotPropertyPanel(){ }
  24. /// <summary>
  25. /// 触发到工具栏注释工具,改变工具图标下的颜色值
  26. /// </summary>
  27. /// <param name="sender"></param>
  28. /// <param name="keyValues"></param>
  29. public void DataChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
  30. {
  31. DataChanged?.Invoke(sender, keyValues);
  32. }
  33. public void AnnotTypeChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
  34. {
  35. AnnotTypeChanged?.Invoke(sender, keyValues);
  36. }
  37. }
  38. public sealed partial class AnnotToolContentViewModel
  39. {
  40. #region 属性
  41. #region 注释工具
  42. //高亮
  43. private Brush highLightColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  44. public Brush HighLightColor { get { return highLightColor; } set { SetProperty(ref highLightColor, value); } }
  45. //
  46. private double highLightOpacity = 1;
  47. public double HighLightOpacity {get { return highLightOpacity; } set { SetProperty(ref highLightOpacity, value); } }
  48. //
  49. private Brush underLine = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  50. public Brush UnderLineColor {get { return underLine; } set { SetProperty(ref underLine, value); }}
  51. //
  52. private double underLineOpacity = 1;
  53. public double UnderLineOpacity { get { return underLineOpacity; } set { SetProperty(ref underLineOpacity, value); }}
  54. //
  55. private Brush squigglyColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  56. public Brush SquigglyColor{ get { return squigglyColor; } set { SetProperty(ref squigglyColor, value); } }
  57. //
  58. private double squigglyOpacity = 1;
  59. public double SquigglyOpacity {get { return squigglyOpacity; } set { SetProperty(ref squigglyOpacity, value); } }
  60. //
  61. private Brush strikeoutColor = new SolidColorBrush(Color.FromRgb(0xFF, 0xBB, 0x00));
  62. public Brush StrikeoutColor{ get { return strikeoutColor; } set { SetProperty(ref strikeoutColor, value); }}
  63. //
  64. private double strikeoutOpacity = 1;
  65. public double StrikeoutOpacity {get { return strikeoutOpacity; } set { SetProperty(ref strikeoutOpacity, value); } }
  66. #endregion
  67. #endregion
  68. private CPDFViewer PDFViewer;
  69. private ViewContentViewModel viewContentViewModel;
  70. public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
  71. AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
  72. }
  73. }