diff --git a/Filtration/Converters/DisabledDefaultSoundTooltipConverter.cs b/Filtration/Converters/DisabledDefaultSoundTooltipConverter.cs new file mode 100644 index 0000000..caf72a4 --- /dev/null +++ b/Filtration/Converters/DisabledDefaultSoundTooltipConverter.cs @@ -0,0 +1,38 @@ +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace Filtration.Converters +{ + class DisabledDefaultSoundTooltipConverter : IMultiValueConverter + { + private static readonly string appendage = "\nNote: the default drop sound is disabled for this block."; + + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values[0] == DependencyProperty.UnsetValue || + values[1] == DependencyProperty.UnsetValue) + { + return string.Empty; + } + + var baseText = (string)(values[0]); + var hasDisabledDefaultSound = (bool)(values[1]); + + if (hasDisabledDefaultSound) + { + return $"{baseText}{appendage}"; + } + else + { + return baseText; + } + } + + public object[] ConvertBack(object value, Type[] targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/Filtration/Filtration.csproj b/Filtration/Filtration.csproj index 8b329f4..3b30c9d 100644 --- a/Filtration/Filtration.csproj +++ b/Filtration/Filtration.csproj @@ -211,6 +211,7 @@ + diff --git a/Filtration/Views/ItemFilterBlockView.xaml b/Filtration/Views/ItemFilterBlockView.xaml index 6646e99..ab0bdb4 100644 --- a/Filtration/Views/ItemFilterBlockView.xaml +++ b/Filtration/Views/ItemFilterBlockView.xaml @@ -19,6 +19,7 @@ +