using System.Windows;
using System.Windows.Controls;

namespace _ScratchPad.Styles;

public class LogRowStyleSelector : StyleSelector
{
    public Style ErrorStyle { get; set; }
    public override Style SelectStyle(object item, DependencyObject container)
    {
        if (item is SasLogRecord)
        {
            var rec = item as SasLogRecord;
            if (rec.TotalErrors > 0)
            {
                return ErrorStyle;
            }
        }

        return base.SelectStyle(item, container);
    }
}