HashCalculator.GUI/Converters/BooleanInvertConverter.cs
2020-03-28 23:16:45 +01:00

22 lines
625 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[ValueConversion(typeof(bool), typeof(bool))]
internal class BooleanInvertConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool original = (bool)value;
return !original;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool original = (bool)value;
return !original;
}
}
}