using System;
using Syncfusion.SfDataGrid.XForms;
using Xamarin.Forms;
using XF.Material.Forms.Resources.Typography;
using XF.Material.Forms.UI;

namespace InABox.Mobile
{
    public class MobileGridTextColumn<TEntity> : MobileGridColumn<TEntity, string>
    {
        
        public override GridColumn CreateColumn()
        {
            var column = CreateColumn<GridTemplateColumn>();
            column.CellTemplate = new DataTemplate(() =>
            {
                var label = new Label()
                {
                    Margin = new Thickness(2,0,0,0),
                    FontSize= Device.GetNamedSize(NamedSize.Micro, typeof(Label)),
                    VerticalTextAlignment = TextAlignment.Center,
                    HorizontalTextAlignment = Alignment,
                    TextColor = Color.Black
                };
                label.SetBinding(Label.TextProperty, ColumnName);
                return label;
            });    
            return column;
        }
    }
}