ImageViewerVisualSettings.xaml.cs 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 ImageViewerVisualSettings.xaml
  9. /// </summary>
  10. public partial class ImageViewerVisualSettings : Window
  11. {
  12. /// <summary>
  13. /// Gets or sets the color of ImageViewer Background Color.
  14. /// </summary>
  15. public Color BackgroundColor
  16. {
  17. get { return ImageViewerStyle.BackgroundColor; }
  18. set { ImageViewerStyle.BackgroundColor = value; }
  19. }
  20. /// <summary>
  21. /// Gets or sets the color of ImageView headers and Scale Bars foreground.
  22. /// </summary>
  23. public Color ForegroundColor
  24. {
  25. get { return ImageViewerStyle.ForegroundColor; }
  26. set { ImageViewerStyle.ForegroundColor = value; }
  27. }
  28. /// <summary>
  29. /// Gets or sets the header font family of ImageViewer.
  30. /// </summary>
  31. public FontFamily HeaderFontFamily
  32. {
  33. get { return ImageViewerStyle.HeaderFontFamily; }
  34. set { ImageViewerStyle.HeaderFontFamily = value; }
  35. }
  36. /// <summary>
  37. /// Gets or sets the header font size of ImageViewer.
  38. /// </summary>
  39. public double HeaderFontSize
  40. {
  41. get { return ImageViewerStyle.HeaderFontSize; }
  42. set { ImageViewerStyle.HeaderFontSize = value; }
  43. }
  44. /// <summary>
  45. /// Gets or sets the scale bar font size of ImageViewer.
  46. /// </summary>
  47. public double ScaleBarFontSize
  48. {
  49. get { return ImageViewerStyle.ScaleBarFontSize; }
  50. set { ImageViewerStyle.ScaleBarFontSize = value; }
  51. }
  52. /// <summary>
  53. /// ImageViewerVisualSettings
  54. /// </summary>
  55. public ImageViewerVisualSettings()
  56. {
  57. this.InitializeComponent();
  58. this.DataContext = this;
  59. this.UpdateCombos();
  60. }
  61. /// <summary>
  62. /// Handles the Click event of the ResetStylesButton control.
  63. /// </summary>
  64. /// <param name="sender">The source of the event.</param>
  65. /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
  66. private void OnResetStyle(object sender, RoutedEventArgs e)
  67. {
  68. ImageViewerStyle.ResetStyles();
  69. this.UpdateCombos();
  70. }
  71. /// <summary>
  72. /// Sets the combo boxes to have the values from the dictionary
  73. /// </summary>
  74. private void UpdateCombos()
  75. {
  76. this.BackgroundColorCombo.SelectedColor = this.BackgroundColor;
  77. this.ForegroundColorCombo.SelectedColor = this.ForegroundColor;
  78. this.ScaleBarFontSizeCombo.SelectedValue = this.ScaleBarFontSize;
  79. this.HeaderFontFamilyCombo.SelectedValue = this.HeaderFontFamily;
  80. this.HeaderFontSizeCombo.SelectedValue = this.HeaderFontSize;
  81. }
  82. }
  83. }