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;
///
/// Interaction logic for DetailDialogVisualSettings.xaml
///
public partial class DetailDialogVisualSettings : Window, INotifyPropertyChanged
{
///
/// Gets or sets the color of the dialog background.
///
///
/// The color of the dialog background.
///
public Color DialogBackgroundColor
{
get
{
return DetailsDialogStyle.DialogBackgroundColor;
}
set
{
if (DetailsDialogStyle.DialogBackgroundColor != value)
{
DetailsDialogStyle.DialogBackgroundColor = value;
this.RaisePropertyChanged(nameof(this.DialogBackgroundColor));
}
}
}
///
/// Gets or sets the color of the header text.
///
///
/// The color of the header text.
///
public Color HeaderTextColor
{
get
{
return DetailsDialogStyle.HeaderTextColor;
}
set
{
if (DetailsDialogStyle.HeaderTextColor != value)
{
DetailsDialogStyle.HeaderTextColor = value;
this.RaisePropertyChanged(nameof(this.HeaderTextColor));
}
}
}
///
/// Gets or sets the color of the details text.
///
///
/// The color of the details text.
///
public Color DetailsTextColor
{
get
{
return DetailsDialogStyle.DetailsTextColor;
}
set
{
if (DetailsDialogStyle.DetailsTextColor != value)
{
DetailsDialogStyle.DetailsTextColor = value;
this.RaisePropertyChanged(nameof(this.DetailsTextColor));
}
}
}
///
/// Gets or sets the header text font family.
///
///
/// The header text font family.
///
public FontFamily HeaderTextFontFamily
{
get
{
return DetailsDialogStyle.HeaderTextFontFamily;
}
set
{
if (DetailsDialogStyle.HeaderTextFontFamily != value)
{
DetailsDialogStyle.HeaderTextFontFamily = value;
this.RaisePropertyChanged(nameof(this.HeaderTextFontFamily));
}
}
}
///
/// Gets or sets the header text font style.
///
///
/// The header text font style.
///
public FontStyle HeaderTextFontStyle
{
get
{
return DetailsDialogStyle.HeaderTextFontStyle;
}
set
{
if (DetailsDialogStyle.HeaderTextFontStyle != value)
{
DetailsDialogStyle.HeaderTextFontStyle = value;
this.RaisePropertyChanged(nameof(this.HeaderTextFontStyle));
}
}
}
///
/// Gets or sets the size of the header text.
///
///
/// The size of the header text.
///
public double HeaderTextSize
{
get
{
return DetailsDialogStyle.HeaderTextSize;
}
set
{
if (DetailsDialogStyle.HeaderTextSize != value)
{
DetailsDialogStyle.HeaderTextSize = value;
this.RaisePropertyChanged(nameof(this.HeaderTextSize));
}
}
}
///
/// Gets or sets the details text font family.
///
///
/// The details text font family.
///
public FontFamily DetailsTextFontFamily
{
get
{
return DetailsDialogStyle.DetailsTextFontFamily;
}
set
{
if (DetailsDialogStyle.DetailsTextFontFamily != value)
{
DetailsDialogStyle.DetailsTextFontFamily = value;
this.RaisePropertyChanged(nameof(this.DetailsTextFontFamily));
}
}
}
///
/// Gets or sets the details text font style.
///
///
/// The details text font style.
///
public FontStyle DetailsTextFontStyle
{
get
{
return DetailsDialogStyle.DetailsTextFontStyle;
}
set
{
if (DetailsDialogStyle.DetailsTextFontStyle != value)
{
DetailsDialogStyle.DetailsTextFontStyle = value;
this.RaisePropertyChanged(nameof(this.DetailsTextFontStyle));
}
}
}
///
/// Gets or sets the size of the details text.
///
///
/// The size of the details text.
///
public double DetailsTextSize
{
get
{
return DetailsDialogStyle.DetailsTextSize;
}
set
{
if (DetailsDialogStyle.DetailsTextSize != value)
{
DetailsDialogStyle.DetailsTextSize = value;
this.RaisePropertyChanged(nameof(this.DetailsTextSize));
}
}
}
///
/// Initializes a new instance of the class.
///
public DetailDialogVisualSettings()
{
this.InitializeComponent();
}
///
/// Resets the specified sender.
///
/// The sender.
/// The instance containing the event data.
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));
}
///
/// Occurs when a property value changes.
///
public event PropertyChangedEventHandler PropertyChanged;
///
/// Raises the property changed event.
///
/// Name of the property.
private void RaisePropertyChanged(string propertyName)
{
var handler = this.PropertyChanged;
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
}