Filtration/Filtration/Converters/BooleanInverterConverter.cs
2015-06-04 18:15:54 +01:00

30 lines
693 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace Filtration.Converters
{
internal class BoolInverterConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,
CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter,
CultureInfo culture)
{
if (value is bool)
{
return !(bool)value;
}
return value;
}
}
}