HashCalculator.GUI/Converters/BooleanInvertConverter.cs

24 lines
721 B
C#

using System;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[SuppressMessage("Microsoft.Performance", "CA1812")]
[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;
}
}
}