using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Media;

namespace SASDesktop.Converters
{
    /// <summary>
    /// true превращает в зелёный цвет, false в красный
    /// </summary>
    public class BooleanToFormColor : IValueConverter
    {
        private static SolidColorBrush _notFilled = new SolidColorBrush(Color.FromArgb(255, 255, 87, 51));
        private static SolidColorBrush _filled = new SolidColorBrush(Color.FromArgb(255, 34, 153, 84));

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((bool)value == true)
            {
                return _filled;
            }
            else
            {
                return _notFilled;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
