Added theme component tag selection control

This commit is contained in:
Ben
2015-07-05 11:09:59 +01:00
parent f5dcdf0af9
commit 544b931477
12 changed files with 686 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows;
using System.Windows.Media;
using Filtration.Annotations;
using Filtration.ObjectModel;
using Filtration.ObjectModel.BlockItemBaseTypes;
@@ -19,8 +20,12 @@ namespace Filtration.UserControls
InitializeComponent();
// ReSharper disable once PossibleNullReferenceException
(Content as FrameworkElement).DataContext = this;
SetBlockColorCommand = new RelayCommand(OnSetBlockColorCommmand);
}
public RelayCommand SetBlockColorCommand { get; private set; }
public static readonly DependencyProperty BlockItemProperty = DependencyProperty.Register(
"BlockItem",
typeof(IItemFilterBlockItem),
@@ -93,6 +98,14 @@ namespace Filtration.UserControls
return new List<int> { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
}
}
private void OnSetBlockColorCommmand()
{
var blockItem = BlockItem as ColorBlockItem;
if (blockItem == null || blockItem.ThemeComponent == null) return;
blockItem.Color = blockItem.ThemeComponent.Color;
}
public event PropertyChangedEventHandler PropertyChanged;