-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathMixchOptionsViewModel.cs
67 lines (65 loc) · 2.27 KB
/
MixchOptionsViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
using GalaSoft.MvvmLight.CommandWpf;
using System;
using System.ComponentModel;
using System.Windows.Input;
using System.Windows.Media;
namespace MixchSitePlugin
{
public class MixchOptionsViewModel : INotifyPropertyChanged
{
public Color ItemBackColor
{
get { return ChangedOptions.ItemBackColor; }
set { ChangedOptions.ItemBackColor = value; }
}
public Color ItemForeColor
{
get { return ChangedOptions.ItemForeColor; }
set { ChangedOptions.ItemForeColor = value; }
}
public Color SystemBackColor
{
get { return ChangedOptions.SystemBackColor; }
set { ChangedOptions.SystemBackColor = value; }
}
public Color SystemForeColor
{
get { return ChangedOptions.SystemForeColor; }
set { ChangedOptions.SystemForeColor = value; }
}
public int PoipoiKeepSeconds
{
get { return ChangedOptions.PoipoiKeepSeconds; }
set { ChangedOptions.PoipoiKeepSeconds = value; }
}
private readonly MixchSiteOptions _origin;
private readonly MixchSiteOptions _changed;
internal MixchSiteOptions OriginOptions { get { return _origin; } }
internal MixchSiteOptions ChangedOptions { get { return _changed; } }
internal MixchOptionsViewModel(MixchSiteOptions siteOptions)
{
_origin = siteOptions;
_changed = siteOptions.Clone();
}
#region INotifyPropertyChanged
[NonSerialized]
private System.ComponentModel.PropertyChangedEventHandler _propertyChanged;
/// <summary>
///
/// </summary>
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged
{
add { _propertyChanged += value; }
remove { _propertyChanged -= value; }
}
/// <summary>
///
/// </summary>
/// <param name="propertyName"></param>
protected void RaisePropertyChanged([System.Runtime.CompilerServices.CallerMemberName] string propertyName = "")
{
_propertyChanged?.Invoke(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
}
#endregion
}
}