Refactor theme code to support different types

This commit is contained in:
azakhi
2018-08-24 22:07:24 +03:00
parent d0bc0b6864
commit 8ba3433dcf
17 changed files with 122 additions and 64 deletions

View File

@@ -46,6 +46,7 @@ namespace Filtration
cfg.ConstructServicesUsing(_container.Resolve);
cfg.CreateMap<Theme, IThemeEditorViewModel>().ConstructUsingServiceLocator();
cfg.CreateMap<ThemeComponent, ThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<ColorThemeComponent, ColorThemeComponentViewModel>().ReverseMap();
cfg.CreateMap<IThemeEditorViewModel, Theme>();
});

View File

@@ -6,6 +6,7 @@ using System.Windows;
using Filtration.Annotations;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
using Filtration.ObjectModel.ThemeEditor;
using Filtration.Views;
using GalaSoft.MvvmLight.CommandWpf;
using Xceed.Wpf.Toolkit;
@@ -97,7 +98,7 @@ namespace Filtration.UserControls
var blockItem = BlockItem as ColorBlockItem;
if (blockItem?.ThemeComponent == null) return;
blockItem.Color = blockItem.ThemeComponent.Color;
blockItem.Color = ((ColorThemeComponent)blockItem.ThemeComponent).Color;
}
public event PropertyChangedEventHandler PropertyChanged;