ElementComboVisualSettings.xaml.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #pragma warning disable CA1822
  2. namespace OINA.Extender.WPF.Testharness
  3. {
  4. using System.Windows;
  5. using System.Windows.Media;
  6. using OINA.Extender.Controls.Styles;
  7. /// <summary>
  8. /// Interaction logic for ElementComboVisualSettings.xaml
  9. /// </summary>
  10. public partial class ElementComboVisualSettings
  11. {
  12. /// <summary>
  13. /// Gets or sets the color of the ComboBox background.
  14. /// </summary>
  15. public Color BackgroundColor
  16. {
  17. get { return ElementComboStyle.Background; }
  18. set { ElementComboStyle.Background = value; }
  19. }
  20. /// <summary>
  21. /// Gets or sets the color of the ComboBox foreground.
  22. /// </summary>
  23. public Color ForegroundColor
  24. {
  25. get { return ElementComboStyle.Foreground; }
  26. set { ElementComboStyle.Foreground = value; }
  27. }
  28. /// <summary>
  29. /// Gets or sets the font size of the element ComboBox.
  30. /// </summary>
  31. public double ComboFontSize
  32. {
  33. get { return ElementComboStyle.ComboFontSize; }
  34. set { ElementComboStyle.ComboFontSize = value; }
  35. }
  36. /// <summary>
  37. /// Initializes a new instance of the <see cref="ElementComboVisualSettings"/> class.
  38. /// </summary>
  39. public ElementComboVisualSettings()
  40. {
  41. this.InitializeComponent();
  42. this.DataContext = this;
  43. this.UpdateCombos();
  44. }
  45. /// <summary>
  46. /// Handles the Click event of the ResetStylesButton control.
  47. /// </summary>
  48. /// <param name="sender">The source of the event.</param>
  49. /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
  50. private void ResetStyleButton_Click(object sender, RoutedEventArgs e)
  51. {
  52. ElementComboStyle.ResetStyles();
  53. this.UpdateCombos();
  54. }
  55. /// <summary>
  56. /// Sets the combo boxes to have the values from the dictionary
  57. /// </summary>
  58. private void UpdateCombos()
  59. {
  60. this.BackgroundColorCombo.SelectedColor = this.BackgroundColor;
  61. this.ForegroundColorCombo.SelectedColor = this.ForegroundColor;
  62. this.FontSizeCombo.SelectedValue = this.ComboFontSize;
  63. }
  64. }
  65. }