示例#1
0
 private void BuildNavbarRightContent(NavBarTagHelperContext navbarContext, StringBuilder sb)
 {
     // this empty ul fixes
     sb.Append(@"<ul class=""navbar-nav ml-auto"">");
     sb.Append(@"<li class=""nav-item"">&nbsp;</li>");
     sb.Append(@"</ul>");
     sb.Append(navbarContext.NavbarRightHtml);
     sb.Append(BuildControlSidebarTogglerHtml());
 }
示例#2
0
        private string BuildHtmlContent(NavBarTagHelperContext navbarContext)
        {
            var sb = new StringBuilder();

            BuildNavbarLeftContent(navbarContext, sb);
            BuildNavbarRightContent(navbarContext, sb);

            return(sb.ToString());
        }
示例#3
0
        public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
        {
            var navbarContext = new NavBarTagHelperContext();

            context.Items.Add(typeof(NavBarTagHelperContext), navbarContext);

            await output.GetChildContentAsync();

            output.TagName = "nav";
            output.Attributes.Add("class", "main-header navbar navbar-expand navbar-white navbar-light");
            output.Content.SetHtmlContent(BuildHtmlContent(navbarContext));
        }
示例#4
0
 private void BuildNavbarLeftContent(NavBarTagHelperContext navbarContext, StringBuilder sb)
 {
     sb.Append(BuildMainSidebarTogglerHtml());
     sb.Append(navbarContext.NavbarLeftHtml);
 }