Add new filter fuatures

This commit is contained in:
azakhi
2018-08-29 20:12:02 +03:00
parent a09f0a5090
commit 78b4ddc862
78 changed files with 911 additions and 231 deletions

View File

@@ -109,6 +109,8 @@
<Compile Include="Services\ThemePersistenceService.cs" />
<Compile Include="Services\ThemeService.cs" />
<Compile Include="ViewModels\ColorThemeComponentViewModel.cs" />
<Compile Include="ViewModels\EffectColorThemeComponentViewModel.cs" />
<Compile Include="ViewModels\IconThemeComponentViewModel.cs" />
<Compile Include="ViewModels\StringThemeComponentViewModel.cs" />
<Compile Include="ViewModels\StrIntThemeComponentViewModel.cs" />
<Compile Include="ViewModels\IntegerThemeComponentViewModel.cs" />

View File

@@ -0,0 +1,10 @@
using Filtration.ObjectModel.Enums;
namespace Filtration.ThemeEditor.ViewModels
{
public class EffectColorThemeComponentViewModel : ThemeComponentViewModel
{
public EffectColor EffectColor { get; set; }
public bool Temporary { get; set; }
}
}

View File

@@ -0,0 +1,11 @@
using Filtration.ObjectModel.Enums;
namespace Filtration.ThemeEditor.ViewModels
{
public class IconThemeComponentViewModel : ThemeComponentViewModel
{
public IconSize IconSize { get; set; }
public IconColor IconColor { get; set; }
public IconShape IconShape { get; set; }
}
}

View File

@@ -211,6 +211,12 @@ namespace Filtration.ThemeEditor.ViewModels
case ThemeComponentType.CustomSound:
Components.Add(new StringThemeComponent(themeComponentType, "Untitled Component", "placeholder.mp3"));
break;
case ThemeComponentType.Icon:
Components.Add(new IconThemeComponent(themeComponentType, "Untitled Component", IconSize.Largest, IconColor.Red, IconShape.Circle));
break;
case ThemeComponentType.Effect:
Components.Add(new EffectColorThemeComponent(themeComponentType, "Untitled Component", EffectColor.Red, false));
break;
}
}

View File

@@ -7,7 +7,8 @@
xmlns:commonConverters="clr-namespace:Filtration.Common.Converters;assembly=Filtration.Common"
xmlns:themeEditor="clr-namespace:Filtration.ObjectModel.ThemeEditor;assembly=Filtration.ObjectModel"
xmlns:views="clr-namespace:Filtration.ThemeEditor.Views"
xmlns:viewModels="clr-namespace:Filtration.ThemeEditor.ViewModels"
xmlns:extensions="clr-namespace:Filtration.Common.Extensions;assembly=Filtration.Common"
xmlns:enums="clr-namespace:Filtration.ObjectModel.Enums;assembly=Filtration.ObjectModel"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance Type=themeEditor:ThemeComponent}"
d:DesignHeight="100" d:DesignWidth="200">
@@ -18,7 +19,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="25" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.Resources>
<DataTemplate x:Key="EditableComponentNameTemplate">
@@ -99,6 +100,38 @@
</Button>
</Grid>
</DataTemplate>
<!--Icon Theme Template-->
<DataTemplate DataType="{x:Type themeEditor:IconThemeComponent}">
<StackPanel Orientation="Vertical" Margin="5,5,5,5">
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconSize}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding IconSize}"
SelectedValuePath="Value" />
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconColor}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding IconColor}"
SelectedValuePath="Value" />
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:IconShape}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding IconShape}"
SelectedValuePath="Value" />
</StackPanel>
</DataTemplate>
<!--Effect Color Theme Template-->
<DataTemplate DataType="{x:Type themeEditor:EffectColorThemeComponent}">
<StackPanel>
<WrapPanel VerticalAlignment="Center" Margin="5,5,5,5">
<RadioButton IsChecked="{Binding Temporary, Converter={StaticResource BoolInverterConverter}}" Margin="0,0,10,0">Permanent</RadioButton>
<RadioButton IsChecked="{Binding Temporary}" >Temporary</RadioButton>
</WrapPanel>
<ComboBox ItemsSource="{Binding Source={extensions:Enumeration {x:Type enums:EffectColor}}}" Style="{StaticResource MetroComboBox}"
DisplayMemberPath="Description"
SelectedValue="{Binding EffectColor}"
SelectedValuePath="Value" />
</StackPanel>
</DataTemplate>
</ContentControl.Resources>
</ContentControl>
</Grid>