You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
634 B
21 lines
634 B
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace BBWYB.Client.Converters
|
|
{
|
|
public class EnumToBooleanConverter : IValueConverter
|
|
{
|
|
/// <inheritdoc/>
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value == null ? false : value.Equals(parameter);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value != null && value.Equals(true) ? parameter : Binding.DoNothing;
|
|
}
|
|
}
|
|
}
|
|
|