This repository has been archived on 2024-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
Sic06/SicUI/Models/RecipeEditors/Converters/IsHighlightedToBorderBrush.cs

28 lines
776 B
C#

using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;
using Color = System.Drawing.Color;
namespace SicUI.Models.RecipeEditors
{
public class IsHighlightedToBorderBrush : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool isHighlighted)
return isHighlighted
? new SolidColorBrush(Colors.Yellow)
: new SolidColorBrush(Colors.Transparent);
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}