123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- namespace OINA.Extender.WPF.Testharness
- {
- using System.ComponentModel;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Media;
- using OINA.Extender.Controls.Styles;
- /// <summary>
- /// Interaction logic for DetailDialogVisualSettings.xaml
- /// </summary>
- public partial class DetailDialogVisualSettings : Window, INotifyPropertyChanged
- {
- /// <summary>
- /// Gets or sets the color of the dialog background.
- /// </summary>
- /// <value>
- /// The color of the dialog background.
- /// </value>
- public Color DialogBackgroundColor
- {
- get
- {
- return DetailsDialogStyle.DialogBackgroundColor;
- }
- set
- {
- if (DetailsDialogStyle.DialogBackgroundColor != value)
- {
- DetailsDialogStyle.DialogBackgroundColor = value;
- this.RaisePropertyChanged(nameof(this.DialogBackgroundColor));
- }
- }
- }
- /// <summary>
- /// Gets or sets the color of the header text.
- /// </summary>
- /// <value>
- /// The color of the header text.
- /// </value>
- public Color HeaderTextColor
- {
- get
- {
- return DetailsDialogStyle.HeaderTextColor;
- }
- set
- {
- if (DetailsDialogStyle.HeaderTextColor != value)
- {
- DetailsDialogStyle.HeaderTextColor = value;
- this.RaisePropertyChanged(nameof(this.HeaderTextColor));
- }
- }
- }
- /// <summary>
- /// Gets or sets the color of the details text.
- /// </summary>
- /// <value>
- /// The color of the details text.
- /// </value>
- public Color DetailsTextColor
- {
- get
- {
- return DetailsDialogStyle.DetailsTextColor;
- }
- set
- {
- if (DetailsDialogStyle.DetailsTextColor != value)
- {
- DetailsDialogStyle.DetailsTextColor = value;
- this.RaisePropertyChanged(nameof(this.DetailsTextColor));
- }
- }
- }
- /// <summary>
- /// Gets or sets the header text font family.
- /// </summary>
- /// <value>
- /// The header text font family.
- /// </value>
- public FontFamily HeaderTextFontFamily
- {
- get
- {
- return DetailsDialogStyle.HeaderTextFontFamily;
- }
- set
- {
- if (DetailsDialogStyle.HeaderTextFontFamily != value)
- {
- DetailsDialogStyle.HeaderTextFontFamily = value;
- this.RaisePropertyChanged(nameof(this.HeaderTextFontFamily));
- }
- }
- }
- /// <summary>
- /// Gets or sets the header text font style.
- /// </summary>
- /// <value>
- /// The header text font style.
- /// </value>
- public FontStyle HeaderTextFontStyle
- {
- get
- {
- return DetailsDialogStyle.HeaderTextFontStyle;
- }
- set
- {
- if (DetailsDialogStyle.HeaderTextFontStyle != value)
- {
- DetailsDialogStyle.HeaderTextFontStyle = value;
- this.RaisePropertyChanged(nameof(this.HeaderTextFontStyle));
- }
- }
- }
- /// <summary>
- /// Gets or sets the size of the header text.
- /// </summary>
- /// <value>
- /// The size of the header text.
- /// </value>
- public double HeaderTextSize
- {
- get
- {
- return DetailsDialogStyle.HeaderTextSize;
- }
- set
- {
- if (DetailsDialogStyle.HeaderTextSize != value)
- {
- DetailsDialogStyle.HeaderTextSize = value;
- this.RaisePropertyChanged(nameof(this.HeaderTextSize));
- }
- }
- }
- /// <summary>
- /// Gets or sets the details text font family.
- /// </summary>
- /// <value>
- /// The details text font family.
- /// </value>
- public FontFamily DetailsTextFontFamily
- {
- get
- {
- return DetailsDialogStyle.DetailsTextFontFamily;
- }
- set
- {
- if (DetailsDialogStyle.DetailsTextFontFamily != value)
- {
- DetailsDialogStyle.DetailsTextFontFamily = value;
- this.RaisePropertyChanged(nameof(this.DetailsTextFontFamily));
- }
- }
- }
- /// <summary>
- /// Gets or sets the details text font style.
- /// </summary>
- /// <value>
- /// The details text font style.
- /// </value>
- public FontStyle DetailsTextFontStyle
- {
- get
- {
- return DetailsDialogStyle.DetailsTextFontStyle;
- }
- set
- {
- if (DetailsDialogStyle.DetailsTextFontStyle != value)
- {
- DetailsDialogStyle.DetailsTextFontStyle = value;
- this.RaisePropertyChanged(nameof(this.DetailsTextFontStyle));
- }
- }
- }
- /// <summary>
- /// Gets or sets the size of the details text.
- /// </summary>
- /// <value>
- /// The size of the details text.
- /// </value>
- public double DetailsTextSize
- {
- get
- {
- return DetailsDialogStyle.DetailsTextSize;
- }
- set
- {
- if (DetailsDialogStyle.DetailsTextSize != value)
- {
- DetailsDialogStyle.DetailsTextSize = value;
- this.RaisePropertyChanged(nameof(this.DetailsTextSize));
- }
- }
- }
- /// <summary>
- /// Initializes a new instance of the <see cref="DetailDialogVisualSettings"/> class.
- /// </summary>
- public DetailDialogVisualSettings()
- {
- this.InitializeComponent();
- }
- /// <summary>
- /// Resets the specified sender.
- /// </summary>
- /// <param name="sender">The sender.</param>
- /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
- private void Reset(object sender, RoutedEventArgs e)
- {
- DetailsDialogStyle.ResetStyles();
- this.RaisePropertyChanged(nameof(this.DialogBackgroundColor));
- this.RaisePropertyChanged(nameof(this.HeaderTextColor));
- this.RaisePropertyChanged(nameof(this.DetailsTextColor));
- this.RaisePropertyChanged(nameof(this.HeaderTextFontFamily));
- this.RaisePropertyChanged(nameof(this.HeaderTextFontStyle));
- this.RaisePropertyChanged(nameof(this.HeaderTextSize));
- this.RaisePropertyChanged(nameof(this.DetailsTextFontFamily));
- this.RaisePropertyChanged(nameof(this.DetailsTextFontStyle));
- this.RaisePropertyChanged(nameof(this.DetailsTextSize));
- }
- /// <summary>
- /// Occurs when a property value changes.
- /// </summary>
- public event PropertyChangedEventHandler PropertyChanged;
- /// <summary>
- /// Raises the property changed event.
- /// </summary>
- /// <param name="propertyName">Name of the property.</param>
- private void RaisePropertyChanged(string propertyName)
- {
- var handler = this.PropertyChanged;
- if (handler != null)
- {
- handler(this, new PropertyChangedEventArgs(propertyName));
- }
- }
- }
- }
|