using System.Windows.Media;

namespace Ticket209422_CellStyleAccordingToValue
{
    using System;
    using System.Globalization;
    using System.Windows.Data;

    public class SizeToErrorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((int)value < 0)
            {
                // If the size is less than zero we have an error.
                return true;
            }

            // Otherwise it is OK.
            return false;
        }

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