using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using Telerik.Windows.Controls;
using MarketData.MarketDataModel;

namespace TradeBlotter.UIUtils
{
  public class EquityPriceShockTransactionGLStyle : StyleSelector
  {
    public override Style SelectStyle(object item, DependencyObject container)
    {
      if (item is EquityPriceShock)
      {
        EquityPriceShock equityPriceShock = item as EquityPriceShock;
        if (equityPriceShock.TransactionGL<0)
        {
          return NegativeStyle;
        }
        else
        {
          return PositiveStyle;
        }
      }
      return null;
    }
    public Style NegativeStyle { get; set; }
    public Style PositiveStyle { get; set; }
  }
  public class EquityPriceShockPositionGLStyle : StyleSelector
  {
    public override Style SelectStyle(object item, DependencyObject container)
    {
      if (item is EquityPriceShock)
      {
        EquityPriceShock equityPriceShock = item as EquityPriceShock;
        if (equityPriceShock.PositionGL < 0)
        {
          return NegativeStyle;
        }
        else
        {
          return PositiveStyle;
        }
      }
      return null;
    }
    public Style NegativeStyle { get; set; }
    public Style PositiveStyle { get; set; }
  }
}
