BCDialogVisualSettings.xaml.cs 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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 BCDialogVisualSettings
  11. {
  12. /// <summary>
  13. /// Gets or sets the header font color
  14. /// </summary>
  15. public Color HeaderFontColor
  16. {
  17. get { return BrightnessContrastDialogStyle.HeaderFontColor; }
  18. set { BrightnessContrastDialogStyle.HeaderFontColor = value; }
  19. }
  20. /// <summary>
  21. /// Gets or sets the header font size
  22. /// </summary>
  23. public double HeaderFontSize
  24. {
  25. get { return BrightnessContrastDialogStyle.HeaderFontSize; }
  26. set { BrightnessContrastDialogStyle.HeaderFontSize = value; }
  27. }
  28. /// <summary>
  29. /// Gets or sets the header font family
  30. /// </summary>
  31. public FontFamily HeaderFontFamily
  32. {
  33. get { return BrightnessContrastDialogStyle.HeaderFontFamily; }
  34. set { BrightnessContrastDialogStyle.HeaderFontFamily = value; }
  35. }
  36. /// <summary>
  37. /// Gets or sets the header font style
  38. /// </summary>
  39. public FontStyle HeaderFontStyle
  40. {
  41. get { return BrightnessContrastDialogStyle.HeaderFontStyle; }
  42. set { BrightnessContrastDialogStyle.HeaderFontStyle = value; }
  43. }
  44. /// <summary>
  45. /// Gets or sets the color of the generic control background.
  46. /// </summary>
  47. public Color GenericControlBackgroundColor
  48. {
  49. get { return BrightnessContrastDialogStyle.GenericControlBackgroundColor; }
  50. set { BrightnessContrastDialogStyle.GenericControlBackgroundColor = value; }
  51. }
  52. /// <summary>
  53. /// Gets or sets the color of the dialog background.
  54. /// </summary>
  55. public Color BackgroundColor
  56. {
  57. get { return BrightnessContrastDialogStyle.BrightnessContrastDialogBackgroundColor; }
  58. set { BrightnessContrastDialogStyle.BrightnessContrastDialogBackgroundColor = value; }
  59. }
  60. /// <summary>
  61. /// Gets or sets the color of the lines in the BC Combo
  62. /// </summary>
  63. public Color AxisTicksColor
  64. {
  65. get { return BrightnessContrastDialogStyle.AxisTicksColor; }
  66. set { BrightnessContrastDialogStyle.AxisTicksColor = value; }
  67. }
  68. /// <summary>
  69. /// Gets or sets the color of the lines in the BC Combo
  70. /// </summary>
  71. public Color PlotterLineColor
  72. {
  73. get { return BrightnessContrastDialogStyle.PlotterLineColor; }
  74. set { BrightnessContrastDialogStyle.PlotterLineColor = value; }
  75. }
  76. /// <summary>
  77. /// Gets or sets the color of the plotter background.
  78. /// </summary>
  79. public Color PlotterBackgroundColor
  80. {
  81. get { return BrightnessContrastDialogStyle.PlotterBackgroundColor; }
  82. set { BrightnessContrastDialogStyle.PlotterBackgroundColor = value; }
  83. }
  84. /// <summary>
  85. /// Gets or sets the color of the lines in the BC Combo
  86. /// </summary>
  87. public Color ComboLineColor
  88. {
  89. get { return BrightnessContrastDialogStyle.ComboLineColor; }
  90. set { BrightnessContrastDialogStyle.ComboLineColor = value; }
  91. }
  92. /// <summary>
  93. /// Gets or sets the color of the axes of the plotter
  94. /// </summary>
  95. /// <value>
  96. /// The color of the axes of the plotter
  97. /// </value>
  98. public Color AxisMarkersColor
  99. {
  100. get { return BrightnessContrastDialogStyle.AxisMarkersColor; }
  101. set { BrightnessContrastDialogStyle.AxisMarkersColor = value; }
  102. }
  103. /// <summary>
  104. /// Initializes a new instance of the <see cref="BCDialogVisualSettings"/> class.
  105. /// </summary>
  106. public BCDialogVisualSettings()
  107. {
  108. this.InitializeComponent();
  109. this.DataContext = this;
  110. this.UpdateComboBoxes();
  111. }
  112. /// <summary>
  113. /// Handles the Click event of the ResetStylesButton control.
  114. /// </summary>
  115. /// <param name="sender">The source of the event.</param>
  116. /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
  117. private void ResetStyleButton_Click(object sender, RoutedEventArgs e)
  118. {
  119. BrightnessContrastDialogStyle.ResetStyles();
  120. this.UpdateComboBoxes();
  121. }
  122. /// <summary>
  123. /// Sets the combo boxes to have the values from the dictionary
  124. /// </summary>
  125. private void UpdateComboBoxes()
  126. {
  127. this.HeaderFontColorCombo.SelectedColor = this.HeaderFontColor;
  128. this.HeaderFontSizeCombo.SelectedValue = this.HeaderFontSize;
  129. this.HeaderFontFamilyCombo.SelectedValue = this.HeaderFontFamily;
  130. this.HeaderFontStyleCombo.SelectedValue = this.HeaderFontStyle;
  131. this.BackgroundColorCombo.SelectedColor = this.BackgroundColor;
  132. this.ControlBackgroundColorCombo.SelectedColor = this.GenericControlBackgroundColor;
  133. this.PlotterBackgroundColorCombo.SelectedColor = this.PlotterBackgroundColor;
  134. this.ComboLineColorCombo.SelectedColor = this.ComboLineColor;
  135. this.PlotterAxisColorCombo.SelectedColor = this.AxisMarkersColor;
  136. this.PlotterAxisTicksColorCombo.SelectedColor = this.AxisTicksColor;
  137. this.PlotterLineColorCombo.SelectedColor = this.PlotterLineColor;
  138. }
  139. }
  140. }