增加系统预设渐变背景
This commit is contained in:
79
ViewModel/GradientBGParam.cs
Normal file
79
ViewModel/GradientBGParam.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
using GeekDesk.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace GeekDesk.ViewModel
|
||||
{
|
||||
[Serializable]
|
||||
public class GradientBGParam : INotifyPropertyChanged
|
||||
{
|
||||
private string color1;
|
||||
|
||||
private string color2;
|
||||
|
||||
private string name;
|
||||
|
||||
public GradientBGParam() { }
|
||||
|
||||
public GradientBGParam(string name, string color1, string color2) {
|
||||
this.name = name;
|
||||
this.color1 = color1;
|
||||
this.color2 = color2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public string Color1
|
||||
{
|
||||
get
|
||||
{
|
||||
return color1;
|
||||
}
|
||||
set
|
||||
{
|
||||
color1 = value;
|
||||
OnPropertyChanged("Color1");
|
||||
}
|
||||
}
|
||||
|
||||
public string Color2
|
||||
{
|
||||
get
|
||||
{
|
||||
return color2;
|
||||
}
|
||||
set
|
||||
{
|
||||
color2 = value;
|
||||
OnPropertyChanged("Color2");
|
||||
}
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return name;
|
||||
}
|
||||
set
|
||||
{
|
||||
name = value;
|
||||
OnPropertyChanged("Name");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[field: NonSerializedAttribute()]
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
CommonCode.SaveAppData(MainWindow.appData);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user