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

21 lines
641 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
namespace HashCalculator.GUI.Converters
{
[ValueConversion(typeof(InputEntry), typeof(bool))]
internal class ValidInputEntryTypeToBooleanConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var entry = value as InputEntry;
return entry?.IsValid == true;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}