using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using C1.Silverlight.FlexGrid;

namespace C1.Silverlight.FlexGridExcel
{
    /// <summary>
    /// Class used to display header information in the scrollable area of the grid
    /// (in Excel, header rows show only the column coordinates A, B, C, etc).
    /// </summary>
    public class HeaderRow : Row
    {
        /// <summary>
        /// Initializes a new instance of a <see cref="HeaderRow"/>.
        /// </summary>
        public HeaderRow()
        {
            this.FontWeight = FontWeights.Bold;
            this.Background = new SolidColorBrush(Color.FromArgb(0xff, 0xf0, 0xf0, 0xf0));
        }
        /// <summary>
        /// Gets the data for a specific column on this <see cref="HeaderRow"/>.
        /// </summary>
        /// <param name="col">Column to retrieve the data for.</param>
        protected override object GetData(Column col)
        {
            return col != null
                ? !string.IsNullOrEmpty(col.Header) ? col.Header : col.ColumnName
                : base.GetData(col);
        }
    }
}
