diff --git a/Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs b/Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs
index 162916d..fd70174 100644
--- a/Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs
+++ b/Filtration.ObjectModel/BlockItemBaseTypes/StringBlockItem.cs
@@ -1,10 +1,13 @@
-using System.Windows.Media;
+using System;
+using System.Windows.Media;
+using Filtration.ObjectModel.ThemeEditor;
namespace Filtration.ObjectModel.BlockItemBaseTypes
{
- public abstract class StringBlockItem : BlockItemBase, IAudioVisualBlockItem
+ public abstract class StringBlockItem : BlockItemBase, IAudioVisualBlockItem, IBlockItemWithTheme
{
private string _value;
+ private ThemeComponent _themeComponent;
protected StringBlockItem()
{
@@ -15,12 +18,36 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
Value = value;
}
- public override string OutputText => PrefixText + " \"" + Value + "\"";
+ public override string OutputText => PrefixText + " \"" + Value + "\""
+ + (ThemeComponent != null ? " # " + ThemeComponent.ComponentName : string.Empty);
public override string SummaryText => string.Empty;
public override Color SummaryBackgroundColor => Colors.Transparent;
public override Color SummaryTextColor => Colors.Transparent;
+ public ThemeComponent ThemeComponent
+ {
+ get { return _themeComponent; }
+ set
+ {
+ if (_themeComponent == value) { return; }
+
+ if (_themeComponent != null)
+ {
+ _themeComponent.ThemeComponentUpdated -= OnThemeComponentUpdated;
+ _themeComponent.ThemeComponentDeleted -= OnThemeComponentDeleted;
+ }
+ if (value != null)
+ {
+ value.ThemeComponentUpdated += OnThemeComponentUpdated;
+ value.ThemeComponentDeleted += OnThemeComponentDeleted;
+ }
+
+ _themeComponent = value;
+ OnPropertyChanged();
+ }
+ }
+
public string Value
{
get { return _value; }
@@ -31,5 +58,15 @@ namespace Filtration.ObjectModel.BlockItemBaseTypes
OnPropertyChanged();
}
}
+
+ private void OnThemeComponentUpdated(object sender, EventArgs e)
+ {
+ Value = ((StringThemeComponent)sender).Value;
+ }
+
+ private void OnThemeComponentDeleted(object sender, EventArgs e)
+ {
+ ThemeComponent = null;
+ }
}
}
\ No newline at end of file
diff --git a/Filtration.ObjectModel/BlockItemTypes/CustomSoundBlockItem.cs b/Filtration.ObjectModel/BlockItemTypes/CustomSoundBlockItem.cs
index 9aafd01..93768a8 100644
--- a/Filtration.ObjectModel/BlockItemTypes/CustomSoundBlockItem.cs
+++ b/Filtration.ObjectModel/BlockItemTypes/CustomSoundBlockItem.cs
@@ -6,7 +6,7 @@ namespace Filtration.ObjectModel.BlockItemTypes
{
public CustomSoundBlockItem()
{
- Value = "";
+ Value = "placeholder.mp3";
}
public CustomSoundBlockItem(string value) : base(value)
diff --git a/Filtration.ObjectModel/Enums/ThemeComponentType.cs b/Filtration.ObjectModel/Enums/ThemeComponentType.cs
index ac3b70b..a48299c 100644
--- a/Filtration.ObjectModel/Enums/ThemeComponentType.cs
+++ b/Filtration.ObjectModel/Enums/ThemeComponentType.cs
@@ -13,6 +13,8 @@ namespace Filtration.ObjectModel.Enums
[Description("Font Size")]
FontSize,
[Description("Alert Sound")]
- AlertSound
+ AlertSound,
+ [Description("Custom Sound")]
+ CustomSound
}
}
diff --git a/Filtration.ObjectModel/Filtration.ObjectModel.csproj b/Filtration.ObjectModel/Filtration.ObjectModel.csproj
index 04edeca..8022791 100644
--- a/Filtration.ObjectModel/Filtration.ObjectModel.csproj
+++ b/Filtration.ObjectModel/Filtration.ObjectModel.csproj
@@ -37,10 +37,26 @@
..\packages\Castle.Windsor.3.4.0\lib\net45\Castle.Windsor.dll
+
+ ..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll
+
+
+ ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll
+
+
+ ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll
+
+
+ ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll
+
+
+
+ ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll
+
@@ -132,6 +148,7 @@
+
@@ -141,6 +158,9 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Filtration/App.xaml.cs b/Filtration/App.xaml.cs
index e5cb90a..a123909 100644
--- a/Filtration/App.xaml.cs
+++ b/Filtration/App.xaml.cs
@@ -49,6 +49,7 @@ namespace Filtration
cfg.CreateMap().ReverseMap();
cfg.CreateMap().ReverseMap();
cfg.CreateMap().ReverseMap();
+ cfg.CreateMap().ReverseMap();
cfg.CreateMap();
});
diff --git a/Filtration/Converters/AvailableThemeComponentsConverter.cs b/Filtration/Converters/AvailableThemeComponentsConverter.cs
index 537ba56..77a6803 100644
--- a/Filtration/Converters/AvailableThemeComponentsConverter.cs
+++ b/Filtration/Converters/AvailableThemeComponentsConverter.cs
@@ -41,6 +41,10 @@ namespace Filtration.Converters
{
themeComponentType = ThemeComponentType.AlertSound;
}
+ else if (blockItem.GetType() == typeof(CustomSoundBlockItem))
+ {
+ themeComponentType = ThemeComponentType.CustomSound;
+ }
else
{
return null;
diff --git a/Filtration/UserControls/BlockItemControl.xaml b/Filtration/UserControls/BlockItemControl.xaml
index 7a401b8..b8d42a4 100644
--- a/Filtration/UserControls/BlockItemControl.xaml
+++ b/Filtration/UserControls/BlockItemControl.xaml
@@ -185,15 +185,27 @@
-