CPDFFontControl.xaml.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using compdfkit_tools.Data;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Navigation;
  15. using System.Windows.Shapes;
  16. namespace compdfkit_tools.Common
  17. {
  18. /// <summary>
  19. /// CPDFFontControl.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class CPDFFontControl : UserControl
  22. {
  23. public CPDFFontData CPDFFontData
  24. {
  25. get;
  26. private set;
  27. } = new CPDFFontData();
  28. public event EventHandler FontChanged;
  29. public CPDFFontControl()
  30. {
  31. InitializeComponent();
  32. CPDFFontUI.FontChanged += CPDFFontUI_FontChanged;
  33. }
  34. private void CPDFFontUI_FontChanged(object sender, EventArgs e)
  35. {
  36. FontChanged?.Invoke(this, EventArgs.Empty);
  37. CPDFFontData = new CPDFFontData()
  38. {
  39. FontFamily = CPDFFontUI.FontFamilyValue,
  40. FontSize = CPDFFontUI.FontSizeValue,
  41. IsBold = CPDFFontUI.IsBold,
  42. IsItalic = CPDFFontUI.IsItalic,
  43. TextAlignment = CPDFFontUI.TextAlignment
  44. };
  45. }
  46. }
  47. }