12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #pragma warning disable CA1822
- namespace OINA.Extender.WPF.Testharness
- {
- using System.Windows;
- using System.Windows.Media;
- using OINA.Extender.Controls.Styles;
- /// <summary>
- /// Interaction logic for ImageViewerVisualSettings.xaml
- /// </summary>
- public partial class ImageViewerVisualSettings : Window
- {
- /// <summary>
- /// Gets or sets the color of ImageViewer Background Color.
- /// </summary>
- public Color BackgroundColor
- {
- get { return ImageViewerStyle.BackgroundColor; }
- set { ImageViewerStyle.BackgroundColor = value; }
- }
- /// <summary>
- /// Gets or sets the color of ImageView headers and Scale Bars foreground.
- /// </summary>
- public Color ForegroundColor
- {
- get { return ImageViewerStyle.ForegroundColor; }
- set { ImageViewerStyle.ForegroundColor = value; }
- }
- /// <summary>
- /// Gets or sets the header font family of ImageViewer.
- /// </summary>
- public FontFamily HeaderFontFamily
- {
- get { return ImageViewerStyle.HeaderFontFamily; }
- set { ImageViewerStyle.HeaderFontFamily = value; }
- }
- /// <summary>
- /// Gets or sets the header font size of ImageViewer.
- /// </summary>
- public double HeaderFontSize
- {
- get { return ImageViewerStyle.HeaderFontSize; }
- set { ImageViewerStyle.HeaderFontSize = value; }
- }
- /// <summary>
- /// Gets or sets the scale bar font size of ImageViewer.
- /// </summary>
- public double ScaleBarFontSize
- {
- get { return ImageViewerStyle.ScaleBarFontSize; }
- set { ImageViewerStyle.ScaleBarFontSize = value; }
- }
- /// <summary>
- /// ImageViewerVisualSettings
- /// </summary>
- public ImageViewerVisualSettings()
- {
- this.InitializeComponent();
- this.DataContext = this;
- this.UpdateCombos();
- }
- /// <summary>
- /// Handles the Click event of the ResetStylesButton control.
- /// </summary>
- /// <param name="sender">The source of the event.</param>
- /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
- private void OnResetStyle(object sender, RoutedEventArgs e)
- {
- ImageViewerStyle.ResetStyles();
- this.UpdateCombos();
- }
- /// <summary>
- /// Sets the combo boxes to have the values from the dictionary
- /// </summary>
- private void UpdateCombos()
- {
- this.BackgroundColorCombo.SelectedColor = this.BackgroundColor;
- this.ForegroundColorCombo.SelectedColor = this.ForegroundColor;
- this.ScaleBarFontSizeCombo.SelectedValue = this.ScaleBarFontSize;
- this.HeaderFontFamilyCombo.SelectedValue = this.HeaderFontFamily;
- this.HeaderFontSizeCombo.SelectedValue = this.HeaderFontSize;
- }
- }
- }
|