mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
19 lines
545 B
C#
19 lines
545 B
C#
using System;
|
|
using System.Globalization;
|
|
using System.Windows.Data;
|
|
|
|
namespace Artemis.UI.Converters
|
|
{
|
|
public class ComparisonConverter : IValueConverter
|
|
{
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value?.Equals(parameter);
|
|
}
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
{
|
|
return value?.Equals(true) == true ? parameter : Binding.DoNothing;
|
|
}
|
|
}
|
|
} |