Refactor theme code to support different types
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
using System.Windows.Media;
|
||||
using Filtration.ObjectModel.Enums;
|
||||
|
||||
namespace Filtration.ThemeEditor.ViewModels
|
||||
{
|
||||
public class ColorThemeComponentViewModel : ThemeComponentViewModel
|
||||
{
|
||||
public Color Color { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,13 +7,11 @@ namespace Filtration.ThemeEditor.ViewModels
|
||||
{
|
||||
string ComponentName { get; set; }
|
||||
ThemeComponentType ComponentType { get; set; }
|
||||
Color Color { get; set; }
|
||||
}
|
||||
|
||||
public class ThemeComponentViewModel : IThemeComponentViewModel
|
||||
{
|
||||
public string ComponentName { get; set; }
|
||||
public ThemeComponentType ComponentType { get; set; }
|
||||
public Color Color { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,8 +194,15 @@ namespace Filtration.ThemeEditor.ViewModels
|
||||
|
||||
private void OnAddThemeComponentCommand(ThemeComponentType themeComponentType)
|
||||
{
|
||||
Components.Add(new ThemeComponent(themeComponentType, "Untitled Component",
|
||||
new Color {A = 255, R = 255, G = 255, B = 255}));
|
||||
switch (themeComponentType)
|
||||
{
|
||||
case ThemeComponentType.BackgroundColor:
|
||||
case ThemeComponentType.BorderColor:
|
||||
case ThemeComponentType.TextColor:
|
||||
Components.Add(new ColorThemeComponent(themeComponentType, "Untitled Component",
|
||||
new Color { A = 255, R = 255, G = 255, B = 255 }));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDeleteThemeComponentCommand(ThemeComponent themeComponent)
|
||||
|
||||
Reference in New Issue
Block a user