RichTextEditorViewModel.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System.Collections.Generic;
  2. using System.ComponentModel;
  3. using System.Windows.Media;
  4. using InABox.Core;
  5. namespace InABox.DynamicGrid
  6. {
  7. public class RichTextEditorViewModel
  8. {
  9. #region Constructor
  10. public RichTextEditorViewModel()
  11. {
  12. AddFontFamily();
  13. AddFontSize();
  14. VisibleButtons = RichTextEditorButtons.All;
  15. }
  16. #endregion
  17. #region Fields
  18. #endregion
  19. #region Properties
  20. public event PropertyChangedEventHandler PropertyChanged;
  21. /// <summary>
  22. /// Gets or Sets the font family source.
  23. /// </summary>
  24. public List<string> FontFamilySource { get; private set; }
  25. /// <summary>
  26. /// Gets or Sets the font size source.
  27. /// </summary>
  28. public double[] FontSizeSource { get; private set; }
  29. public RichTextEditorButtons VisibleButtons { get; set; }
  30. #endregion
  31. #region Implementation
  32. /// <summary>
  33. /// Adds the font family.
  34. /// </summary>
  35. private void AddFontFamily()
  36. {
  37. FontFamilySource = new List<string>();
  38. foreach (var fontfamily in Fonts.SystemFontFamilies) FontFamilySource.Add(fontfamily.Source);
  39. }
  40. /// <summary>
  41. /// Adds the font size.
  42. /// </summary>
  43. private void AddFontSize()
  44. {
  45. FontSizeSource = new double[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 26, 28, 36, 48, 72 };
  46. }
  47. #endregion
  48. }
  49. }