ElementComboVisualSettings.xaml.cs 2.3 KB

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