示例#1
0
        protected virtual IHtmlNode CreateItem(MobileTabStripItem item)
        {
            var dom = new HtmlElement("a")
                        .Attributes(item.HtmlAttributes)
                        .Text(item.Text);

            var url = item.Url.HasValue() ?
                item.Url :
                item.NavigatableSettings.GenerateUrl(component.ViewContext, component.UrlGenerator);

            if (url.HasValue())
            {
                dom.Attribute("href", url);
            }

            foreach (var keyValuePair in item.ToJson())
            {
                dom.Attribute("data-" + keyValuePair.Key, keyValuePair.Value.ToString());
            }

            return dom;
        }
示例#2
0
        protected virtual IHtmlNode CreateItem(MobileTabStripItem item)
        {
            var dom = new HtmlElement("a")
                      .Attributes(item.HtmlAttributes)
                      .Text(item.Text);

            var url = item.Url.HasValue() ?
                      item.Url :
                      item.NavigatableSettings.GenerateUrl(component.ViewContext, component.UrlGenerator);

            if (url.HasValue())
            {
                dom.Attribute("href", url);
            }

            foreach (var keyValuePair in item.ToJson())
            {
                dom.Attribute("data-" + keyValuePair.Key, keyValuePair.Value.ToString());
            }

            return(dom);
        }