RadzenToggleButton Class

RadzenButton component.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenButton

RadzenToggleButton

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Namespace: Radzen.Blazor

Assembly: Radzen.Blazor.dll

Syntax

public class RadzenToggleButton : RadzenButton, IComponent, IHandleEvent, IHandleAfterRender, IRadzenFormComponent

Examples

<RadzenToggleButton Click=@(args => Console.WriteLine("Button clicked")) Text="ToggleButton" />

Constructors

RadzenToggleButtonlink

RadzenButton component.

Declaration
public RadzenToggleButton()

Fields

_valuelink

The value

Declaration
protected bool _value

Properties

AriaControlslink

Gets or sets the aria-controls attribute.

Declaration
public string AriaControls { get; set; }
Property Value
Type Description
stringGets or sets the aria-controls attribute.

AriaExpandedlink

Gets or sets the aria-expanded attribute.

Declaration
public string AriaExpanded { get; set; }
Property Value
Type Description
stringGets or sets the aria-expanded attribute.

AriaHasPopuplink

Gets or sets the aria-haspopup attribute.

Declaration
public string AriaHasPopup { get; set; }
Property Value
Type Description
stringGets or sets the aria-haspopup attribute.

AriaLabellink

Gets or sets the aria-label attribute.

Declaration
public string AriaLabel { get; set; }
Property Value
Type Description
stringGets or sets the aria-label attribute.

Changelink

Gets or sets the change.

Declaration
public EventCallback<bool> Change { get; set; }
Property Value
Type Description
EventCallback<bool>Gets or sets the change.

CurrentPlaceholderlink

Gets the current placeholder. Returns empty string if this component is inside a RadzenFormField.

Declaration
protected string CurrentPlaceholder { get; }
Property Value
Type Description
stringGets the current placeholder. Returns empty string if this component is inside a RadzenFormField.

EditContextlink

Gets or sets the edit context.

Declaration
public Forms.EditContext EditContext { get; set; }
Property Value
Type Description
Forms.EditContextGets or sets the edit context.

FieldIdentifierlink

Gets the field identifier.

Declaration
public Forms.FieldIdentifier FieldIdentifier { get; set; }
Property Value
Type Description
Forms.FieldIdentifierGets the field identifier.

Formlink

Gets or sets the form.

Declaration
public IRadzenForm Form { get; set; }
Property Value
Type Description
IRadzenFormGets or sets the form.

FormFieldContextlink

Provides support for RadzenFormField integration.

Declaration
public IFormFieldContext FormFieldContext { get; set; }
Property Value
Type Description
IFormFieldContextProvides support for RadzenFormField integration.

HasValuelink

Gets a value indicating whether this instance has value.

Declaration
public bool HasValue { get; }
Property Value
Type Description
boolGets a value indicating whether this instance has value.

InputAttributeslink

Specifies additional custom attributes that will be rendered by the input.

Declaration
public IReadOnlyDictionary<string, object> InputAttributes { get; set; }
Property Value
Type Description
IReadOnlyDictionary<string, object>Specifies additional custom attributes that will be rendered by the input.

IsBoundlink

Gets a value indicating whether this instance is bound.

Declaration
public bool IsBound { get; }
Property Value
Type Description
boolGets a value indicating whether this instance is bound.

Namelink

Gets or sets the name.

Declaration
public string Name { get; set; }
Property Value
Type Description
stringGets or sets the name.

Placeholderlink

Gets or sets the placeholder.

Declaration
public string Placeholder { get; set; }
Property Value
Type Description
stringGets or sets the placeholder.

ToggleButtonStylelink

Gets or sets the ToggleButton style.

Declaration
public ButtonStyle ToggleButtonStyle { get; set; }
Property Value
Type Description
ButtonStyleGets or sets the ToggleButton style.

ToggleIconlink

Gets or sets the toggle icon.

Declaration
public string ToggleIcon { get; set; }
Property Value
Type Description
stringGets or sets the toggle icon.

ToggleShadelink

Gets or sets the ToggleButton shade.

Declaration
public Shade ToggleShade { get; set; }
Property Value
Type Description
ShadeGets or sets the ToggleButton shade.

Valuelink

Gets or sets the value.

Declaration
public bool Value { get; set; }
Property Value
Type Description
boolGets or sets the value.

ValueChangedlink

Gets or sets the value changed.

Declaration
public EventCallback<bool> ValueChanged { get; set; }
Property Value
Type Description
EventCallback<bool>Gets or sets the value changed.

ValueExpressionlink

Gets or sets the value expression.

Declaration
public Expressions.Expression<Func<bool>> ValueExpression { get; set; }
Property Value
Type Description
Expressions.Expression<Func<bool>>Gets or sets the value expression.

Methods

BuildRenderTreelink

Declaration
protected override void BuildRenderTree(Rendering.RenderTreeBuilder __builder)
Parameters
Type Name Description
Rendering.RenderTreeBuilder __builder

Disposelink

Disposes this instance.

Declaration
public override void Dispose()

FocusAsynclink

Declaration
public virtual ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClasslink

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetValuelink

Gets the value.

Declaration
public object GetValue()
Returns
Type Description
objectSystem.Object.

OnClicklink

Declaration
public override Task OnClick(MouseEventArgs args)
Parameters
Type Name Description
MouseEventArgs args
Returns
Type Description
Task

OnContextMenulink

Handles the context menu event.

Declaration
public override Task OnContextMenu(MouseEventArgs args)
Parameters
Type Name Description
MouseEventArgs args The MouseEventArgs instance containing the event data.
Returns
Type Description
TaskTask.

SetParametersAsynclink

Sets the parameters asynchronous.

Declaration
public override Task SetParametersAsync(ParameterView parameters)
Parameters
Type Name Description
ParameterView parameters The parameters.
Returns
Type Description
TaskTask.
An error has occurred. This app may no longer respond until reloaded. Reload 🗙