using InABox.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;

namespace InABox.DynamicGrid
{
    public class DFHeaderControl : DynamicFormControl<DFLayoutHeader>
    {
        public FormHeader Header = null!;

        protected override FrameworkElement Create()
        {
            Header = new FormHeader
            {
                Collapsed = Control.Collapsed,
                HeaderText = Control.Header
            };
            Header.CollapsedChanged += (o, c) =>
            {
                FormDesignGrid.CollapseRows(Header, c);
            };
            if (FormDesignGrid.IsDesigning)
            {
                Header.IsEnabled = false;
            }
            return Header;
        }
    }
}
