using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using System.Windows;

namespace GridViewApp
{
    public class StyleConverter : IValueConverter
    {
        public Style HasNotes { get; set; }
        public Style NoNotes { get; set; }

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value is Product)
            {
                Product row = value as Product;
                if (row.HasNotes)
                    return HasNotes;
                else return NoNotes;
            }
            return new Style();
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            return value;
        }

        #endregion
    }
}
