laatzen/Common/Ui/Common.UI/Infrastructure/BooleanToBorderConverter.cs
2024-12-03 17:03:33 +01:00

35 lines
959 B
C#

namespace Common.UI.Infrastructure
{
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
public class BooleanToBorderConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var converter = new BrushConverter();
if (value is bool success)
{
if (!success)
{
return converter.ConvertFrom("#BBFCBA03");
}
else
{
return converter.ConvertFrom("#BB90EE90");
}
}
else
{
return Brushes.LightGray;
}
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
=> throw new NotImplementedException();
}
}