@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.ExpressApp.Layout
@using Xafari.Web.Utils

@model Xafari.Mvc.Layout.LayoutGroupContainer

@if (this.Model.ShowCaption && (!this.Model.IsOnTabPage || (this.Model.ParentGroupDirection == FlowDirection.Vertical)))
{
    <div class="GroupHeader" style="width: 100%">
        @if (this.Model.HasHeaderImage)
        {
            <span class="Image">
                @Html.DevExpress().Image(settings =>
                {
                    MVCxImageHelper.SetImageProperties(settings, this.Model.HeaderImageInfo, -1, -1);
                    settings.Properties.AlternateText = this.Model.Caption;

                    //SetImage
                    var imageClassName = ImageInfoHelper.GetCssClassName(this.Model.HeaderImageInfo);
                    if (!string.IsNullOrEmpty(imageClassName))
                    {
                        settings.ControlStyle.CssClass = settings.ControlStyle.CssClass + " " + imageClassName;
                    }
                    //

                }).GetHtml()
            </span>
        }
        @{
            var labelSettings = new LabelSettings();
            if (MvcApplicationStyleManager.IsNewStyle && MvcApplicationStyleManager.EnableGroupUpperCase)
            {
                labelSettings.Text = this.Model.Caption.ToUpper();
            }
            else
            {
                labelSettings.Text = this.Model.Caption;
            }
            
            labelSettings.ToolTip = this.Model.Model != null ? this.Model.Model.ToolTip : string.Empty;
            labelSettings.ControlStyle.CssClass = "Label";

        }

        @Html.DevExpress().Label(labelSettings).GetHtml()
    </div>
}