@*   Xafari Framework version : 17.2.3011.1336   *@

@using DevExpress.ExpressApp.Templates
@using DevExpress.ExpressApp.Templates.ActionContainers

@model Xafari.Mvc.MVCx.Templates.ActionContainer.MVCxNavigationActionContainer

@{
    this.Model.FrameTemplate.RegisterActionContainers(new IActionContainer[] { this.Model });
}

@{
    var settings = new PanelSettings();
    settings.Name = this.Model.Name;
    settings.Width = this.Model.Width;
    settings.Styles.Panel.CssClass = this.Model.CssClass;

    settings.SetContent(() =>
    {
        var controlStyle = this.Model.navigationStyle;
        switch (controlStyle)
        {
            case NavigationStyle.NavBar:
                Html.Xafari().RenderRelativePartial("_NavBar", this.Model);
                break;
            case NavigationStyle.TreeList:
                Html.Xafari().RenderRelativePartial("TreeView/_Main", this.Model);
                break;
        }
    });

    settings.PreRender += (s, e) =>
    {
        this.Model.SetClientNavigationControlId(this.Model.ClientServerInfo);
        this.Model.SendStateToClient(this.Model.ClientServerInfo, this.Model.GetNavigationStateKey(this.Model.singleChoiceAction));
    };
}

@Html.DevExpress().Panel(settings).GetHtml()

@{
    this.Model.FrameTemplate.UnregisterActionContainers(new IActionContainer[] { this.Model });
}
