@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.ExpressApp
@using DevExpress.ExpressApp.Utils
@using DevExpress.ExpressApp.Web.Controls

@model DevExpress.ExpressApp.View

@{
    var firstPartCss = "XafVCap-First";
    var secondPartCss = "XafVCap-Second";
    
    var viewCaptionTruncate = MvcApplication.Instance != null ? ((DevExpress.ExpressApp.Web.SystemModule.IModelOptionsWeb) MvcApplication.Instance.Model.Options).ViewCaptionTruncate : true;
    if (MvcApplicationStyleManager.IsNewStyle && viewCaptionTruncate)
    {
        secondPartCss = secondPartCss + " MainMenuTruncateCaption";
    }

    var secondPartTitle = string.Empty;
    
    var firstPartText = string.Empty;
    var secondPartText = string.Empty;
    
    //UpdateControlText(View view)
    var captionSeparator = " - ";
    var detailViewCaptionMode = DetailViewCaptionMode.ViewAndObjectCaption;
    var showObjectCaptionFirst = false;
    
    if (this.Model != null)
    {
        string objectCaption = ((this.Model is DetailView) && (detailViewCaptionMode != DetailViewCaptionMode.ViewCaption)) ? this.Model.GetCurrentObjectCaption() : "";
        string viewCaption = ((this.Model is DetailView) && (detailViewCaptionMode == DetailViewCaptionMode.ObjectCaption)) ? "" : this.Model.Caption;
        //view = null;
        if (MvcApplicationStyleManager.IsNewStyle)
        {
            //UpdateControlText(objectCaption, viewCaption);
            string s = showObjectCaptionFirst ? objectCaption : viewCaption;
            string str2 = showObjectCaptionFirst ? viewCaption : objectCaption;
            if (string.IsNullOrEmpty(str2))
            {
                firstPartText = string.Empty;
                secondPartText = HttpUtility.HtmlEncode(s);
                if (MvcApplication.Instance != null)
                {
                    MvcApplication.Instance.ClientServerInfo.SetValue("SecondViewCaptionText", s);
                }
                secondPartTitle = s;
            }
            else
            {
                firstPartText = HttpUtility.HtmlEncode(s);
                secondPartText = HttpUtility.HtmlEncode(str2);
                if (MvcApplication.Instance != null)
                {
                    MvcApplication.Instance.ClientServerInfo.SetValue("SecondViewCaptionText", str2);
                }
                secondPartTitle = str2;
            }
        }
        else
        {
            //UpdateControlTextOld(objectCaption, viewCaption);
            SplitString str = new SplitString
            {
                Separator = captionSeparator
            };
            if (showObjectCaptionFirst)
            {
                str.FirstPart = objectCaption;
                str.SecondPart = viewCaption;
            }
            else
            {
                str.FirstPart = viewCaption;
                str.SecondPart = objectCaption;
            }
            secondPartText = HttpUtility.HtmlEncode(str.Text);

        }
        
        //SendStateToClient()
        ClientServerInfo clientServerInfo = MvcApplication.Instance.ClientServerInfo;
        if (clientServerInfo != null)
        {
            clientServerInfo.SetValue("ClientViewCaptionState", firstPartText + secondPartText);
        }
        //

    }

    
}
<span id="VSL">
    <span class="@(firstPartCss)">
        @{
            this.ViewContext.Writer.Write(firstPartText);
        }
    </span>
    <span class="@(secondPartCss)" title="@(secondPartTitle)">
        @{
            this.ViewContext.Writer.Write(secondPartText);
        }
    </span>
</span>
