BadgeTagHelper
Kendo UI Badge TagHelper BadgeTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-badge")]
public class BadgeTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseBadgeTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-badge name="badge" align="BadgeAlign.TopEnd"></kendo-badge>
Child Tags
Constructors
Initializes a new instance of the BadgeTagHelper class.
Properties
Defines the alignment of the badge
public BadgeAlign? Align { get; set; }
Specifies whether or not to render additional "cutout" border around the badge.
public bool? CutoutBorder { get; set; }
Determines whether the textual content should be rendered as an HTML string or it should be encoded.
public bool? Encoded { get; set; }
Defines how theme colors are applied to a badge
public BadgeFill? FillMode { get; set; }
Defines the name for an existing icon in a Kendo UI theme or SVG content. The icon is rendered inside the badge by a span.k-icon or span.k-svg-icon element.See web font icons help article for more details on Kendo UI icons.Set this option to an icon descriptor such as { name: "gear", variant: "outline" }. The variant can be outline, solid, or duotone; it applies to SVG rendering and is ignored for font icons.
[HtmlAttributeName("icon")]
public string Icon { get; set; }
Defines the position of the badge
public BadgePosition? Position { get; set; }
The template which renders the content of the badge.
public string Template { get; set; }
The template which renders the content of the badge. This option expects the name of a JavaScript function that will be called to return the template.
public string TemplateHandler { get; set; }
The template which renders the content of the badge. This option expects the ID of the script element that contains the template.
public string TemplateId { get; set; }
Configures the templates for the Badge.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
The template which renders the content of the badge. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent TemplateView { get; set; }
The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.
public string Text { get; set; }
Defines the color of the badge
public BadgeColor? ThemeColor { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Serializes the defined templates.
protected override Dictionary<string, object> SerializeTemplates()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: