VPet/VPet.Solution/Converters/EqualsConverter.cs
2023-12-18 22:53:56 +08:00

29 lines
663 B
C#

using System.Windows.Data;
namespace VPet.House.Converters;
public class EqualsConverter : IMultiValueConverter
{
public object Convert(
object[] values,
Type targetType,
object parameter,
System.Globalization.CultureInfo culture
)
{
if (values.Length != 2)
throw new NotImplementedException("Values length must be 2");
return values[0].Equals(values[1]);
}
public object[] ConvertBack(
object value,
Type[] targetTypes,
object parameter,
System.Globalization.CultureInfo culture
)
{
throw new NotImplementedException();
}
}