2025-05-28 23:19:00 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Workbench.Converters
|
|
|
|
|
|
{
|
2025-07-30 21:15:07 +08:00
|
|
|
|
internal class EnumToBooleanConverter : IValueConverter
|
2025-05-28 23:19:00 +08:00
|
|
|
|
{
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (value == null || parameter == null)
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
2025-07-30 21:15:07 +08:00
|
|
|
|
var leftValue = value?.ToString();
|
|
|
|
|
|
var rightValue = value?.ToString();
|
|
|
|
|
|
|
|
|
|
|
|
return string.Equals(leftValue, rightValue, StringComparison.InvariantCultureIgnoreCase);
|
2025-05-28 23:19:00 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|