Filtration/Filtration.Common/Converters/BooleanInverterConverter.cs

30 lines
701 B
C#
Raw Permalink Normal View History

2015-06-04 13:15:54 -04:00
using System;
using System.Globalization;
using System.Windows.Data;
2015-07-06 08:41:46 -04:00
namespace Filtration.Common.Converters
2015-06-04 13:15:54 -04:00
{
public class BooleanInverterConverter : IValueConverter
2015-06-04 13:15:54 -04:00
{
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;
}
}
}