RickTextEditorViewModel.cs 1.4 KB

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