Implemented editable themes / master themes

This commit is contained in:
Ben
2015-07-05 22:43:17 +01:00
parent 511f503e88
commit bfa2341ab8
20 changed files with 354 additions and 89 deletions

View File

@@ -1,12 +1,17 @@
using System;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Media;
using Filtration.ObjectModel.Annotations;
using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.ThemeEditor
{
[Serializable]
public class ThemeComponent
public class ThemeComponent : INotifyPropertyChanged
{
private Color _color;
public ThemeComponent()
{
@@ -24,8 +29,41 @@ namespace Filtration.ObjectModel.ThemeEditor
ComponentName = componentName;
}
public event EventHandler ThemeComponentUpdated;
public event EventHandler ThemeComponentDeleted;
public string ComponentName { get; set; }
public ThemeComponentType ComponentType{ get; set; }
public Color Color { get; set; }
public ThemeComponentType ComponentType{ get; private set; }
public Color Color
{
get { return _color; }
set
{
_color = value;
OnPropertyChanged();
if (ThemeComponentUpdated != null)
{
ThemeComponentUpdated.Invoke(this, EventArgs.Empty);
}
}
}
public void TerminateComponent()
{
if (ThemeComponentDeleted != null)
{
ThemeComponentDeleted.Invoke(this, EventArgs.Empty);
}
}
public event PropertyChangedEventHandler PropertyChanged;
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
var handler = PropertyChanged;
if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}

View File

@@ -5,7 +5,7 @@ using Filtration.ObjectModel.Enums;
namespace Filtration.ObjectModel.ThemeEditor
{
public class ThemeComponentCollection : Collection<ThemeComponent>
public class ThemeComponentCollection : ObservableCollection<ThemeComponent>
{
public bool IsMasterCollection { get; set; }