SwitchTagHelper
Kendo UI Switch TagHelper SwitchTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-switch")]
[HtmlTargetElement("switch-editor", ParentTag = "form-item")]
[HtmlTargetElement("switch-editor", ParentTag = "property-grid-item")]
[RestrictChildren("messages", new string[] { })]
public class SwitchTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IKendoFormEditor
Inheritance: objectTagHelperTagHelperBaseSwitchTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-switch name="switch" checked="true">
</kendo-switch>
Child Tags
Constructors
Initializes a new instance of the SwitchTagHelper class.
Properties
If set to false, the Switch will be disabled and will not allow the user to change its checked state.
public bool? Enabled { get; set; }
An expression to be evaluated against the current model.
public ModelExpression For { get; set; }
IsNested member.
[HtmlAttributeNotBound]
public bool IsNested { get; set; }
Implements:
The name of the JavaScript function that will handle the change event. Fires when the checked state of the Switch is changed through user interaction.
public string OnChange { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the Switch is focused.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnKendoKeydown { get; set; }
If set to true, the Switch will render into its read-only state.
public bool? Readonly { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
Sets a value controlling the thumb's border radius.
public Rounded? ThumbRounded { get; set; }
Sets a value controlling the track's border radius.
public Rounded? TrackRounded { 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:
TryAddAsEditor method.
public bool TryAddAsEditor(TagHelperContext context)
The result.
Implements:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: