ImageViewerVisualSettings.xaml.cs 3.0 KB

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