BCDialogVisualSettings.xaml.cs 5.6 KB

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