New to Telerik UI for ASP.NET Core? Start a free 30-day trial

Kendo UI badge TagHelper ButtonBadgeSettingsTagHelper class.

Definition

Namespace:Kendo.Mvc.TagHelpers

Assembly:Kendo.Mvc.dll

Syntax:

C#
[HtmlTargetElement("badge", ParentTag = "kendo-button", TagStructure = TagStructure.NormalOrSelfClosing)]
[RestrictChildren("badge-template", new string[] { "button-badge-icon" })]
[SuppressTagRendering]
public class ButtonBadgeSettingsTagHelper : TagHelperChildBase, ITagHelper, ITagHelperComponent, ITemplateComponent

Inheritance: objectTagHelperTagHelperChildBaseButtonBadgeSettingsTagHelper

Implements: ITagHelperITagHelperComponentITemplateComponent

Inherited Members TagHelperChildBase.Init(TagHelperContext)TagHelperChildBase.AddSelfToContext(TagHelperContext)TagHelperChildBase.CreateHandler(string)TagHelperChildBase.IdPrefixTagHelper.Process(TagHelperContext, TagHelperOutput)TagHelper.Orderobject.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Example:

csharp
@addTagHelper *, Kendo.Mvc

<kendo-button name="button">
    <badge align="BadgeAlign.TopEnd" />
</kendo-button>

Constructors

Initializes a new instance of the ButtonBadgeSettingsTagHelper class.

C#
public ButtonBadgeSettingsTagHelper()

Properties

Specifies alignment of the badge relative to button. Valid position options are: top start, top end, bottom start, bottom end. works in conjunction with badge.position.

C#
public BadgeAlign? Align { get; set; }

Specifies wether or not to render additional "cutout" border around the badge.

C#
public bool? CutoutBorder { get; set; }

Enables or disables the configuration.

C#
public bool? Enabled { get; set; }

Determines whether the textual content should be rendered as an HTML string or it should be encoded.

C#
public bool? Encoded { get; set; }

Sets a value controlling how the color is applied to the badge. When undefined (the default), the theme controls the fill mode. Can also be set to the following string values: "solid" or "outline".

C#
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.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.

C#
[HtmlAttributeName("icon")]
public string Icon { get; set; }

If text is a number, it will cap that number.

C#
public double? Max { get; set; }

Specifies position of the badge relative to the edge of the button. Valid placemnt options are: inline, edge, inside, outside.Note: position configuration, other than inline, requires the badge to be aligned. See badge.align for more details.

C#
public BadgePosition? Position { get; set; }

Specifies the rounding of the badge. When undefined (the default), the theme controls the default border radius. Valid options are small, medium, large and full.

C#
public Rounded? Rounded { get; set; }

Sets a value controlling the size of the badge. When undefined (the default), the theme controls the size. Can also be set to the following string values: "small"; "medium" or "large".

C#
public BadgeSize? Size { get; set; }

The template which renders the content of the badge.

C#
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.

C#
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.

C#
public string TemplateId { get; set; }

Configures the templates for the ButtonBadgeSettings.

C#
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }

Implements: ITemplateComponent.Templates

The template which renders the content of the badge. This option expects the IHtmlContent instance containing the created HTML.

C#
public IHtmlContent TemplateView { get; set; }

The text of the badge. Valid input includes string, number or object with toString method. Default is empty string.

C#
public string Text { get; set; }

Specifies the color of the component. Valid options are inherit, default, primary, secondary, tertiary, info, success, warning, error, inverted.

C#
public BadgeColor? ThemeColor { get; set; }

If set to false the badge will not be displayed.

C#
public bool? Visible { get; set; }

Methods

Adds the current TagHelper instance to its parent TagHelper.

C#
protected override void AddSelfToParent(TagHelperContext context)
Parameters:contextTagHelperContext

The TagHelper context.

Overrides: TagHelperChildBase.AddSelfToParent(TagHelperContext)

C#
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Parameters:contextTagHelperContextoutputTagHelperOutputReturns:

Task

Overrides: TagHelperChildBase.ProcessAsync(TagHelperContext, TagHelperOutput)

Serializes the defined settings.

C#
public Dictionary<string, object> Serialize()
Returns:

Dictionary<string, object>

Serializes the defined templates.

C#
public Dictionary<string, object> SerializeTemplates()
Returns:

Dictionary<string, object>