RadzenToggleButton Class

RadzenButton component.

Inheritance

Object

ComponentBase

RadzenComponent

RadzenButton

RadzenToggleButton

Implements

IComponent

IHandleEvent

IHandleAfterRender

IRadzenFormComponent

Inherited Members

RadzenButton.ChildContent

RadzenButton.TabIndex

RadzenButton.Text

RadzenButton.ImageAlternateText

RadzenButton.Icon

RadzenButton.IconColor

RadzenButton.Image

RadzenButton.ButtonStyle

RadzenButton.ButtonType

RadzenButton.Variant

RadzenButton.Shade

RadzenButton.Size

RadzenButton.Disabled

RadzenButton.Click

RadzenButton.IsBusy

RadzenButton.BusyText

RadzenButton.IsDisabled

RadzenComponent.OnMouseEnter

RadzenComponent.OnMouseLeave

RadzenComponent.GetCssClass

RadzenComponent.GetId

RadzenComponent.Debounce

RadzenComponent.Localize

RadzenComponent.OnInitialized

RadzenComponent.OnAfterRenderAsync

RadzenComponent.RaiseContextMenu

RadzenComponent.RaiseMouseEnter

RadzenComponent.AddContextMenu

RadzenComponent.RaiseMouseLeave

RadzenComponent.OnBecameInvisible

RadzenComponent.Attributes

RadzenComponent.Element

RadzenComponent.MouseEnter

RadzenComponent.MouseLeave

RadzenComponent.ContextMenu

RadzenComponent.Culture

RadzenComponent.DefaultCulture

RadzenComponent.UICulture

RadzenComponent.DefaultUICulture

RadzenComponent.Style

RadzenComponent.Visible

RadzenComponent.UniqueID

RadzenComponent.JSRuntime

RadzenComponent.IsJSRuntimeAvailable

RadzenComponent.Reference

RadzenComponent.CurrentStyle

ComponentBase.OnInitializedAsync

ComponentBase.OnParametersSet

ComponentBase.OnParametersSetAsync

ComponentBase.StateHasChanged

ComponentBase.ShouldRender

ComponentBase.OnAfterRender

ComponentBase.InvokeAsync

ComponentBase.DispatchExceptionAsync

ComponentBase.RendererInfo

ComponentBase.Assets

ComponentBase.AssignedRenderMode

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 to this section

RadzenButton component.

Declaration
public RadzenToggleButton()

Fields

_valueLink to this section

The value

Declaration
protected bool _value

Properties

AriaControlsLink to this section

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 to this section

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 to this section

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 to this section

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 to this section

Gets or sets the change.

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

CurrentPlaceholderLink to this section

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 to this section

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 to this section

Gets the field identifier.

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

FormLink to this section

Gets or sets the form.

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

FormFieldContextLink to this section

Provides support for RadzenFormField integration.

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

HasValueLink to this section

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 to this section

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 to this section

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 to this section

Gets or sets the name.

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

PlaceholderLink to this section

Gets or sets the placeholder.

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

ToggleButtonStyleLink to this section

Gets or sets the ToggleButton style.

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

ToggleIconLink to this section

Gets or sets the toggle icon.

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

ToggleShadeLink to this section

Gets or sets the ToggleButton shade.

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

ToggleVariantLink to this section

Gets or sets the variant used when the button is toggled.

Declaration
public Variant? ToggleVariant { get; set; }
Property Value
Type Description
Variant?Gets or sets the variant used when the button is toggled.

ValueLink to this section

Gets or sets the value.

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

ValueChangedLink to this section

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 to this section

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 to this section

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

DisposeLink to this section

Disposes this instance.

Declaration
public override void Dispose()

FocusAsyncLink to this section

Declaration
public virtual ValueTask FocusAsync()
Returns
Type Description
ValueTask

GetComponentCssClassLink to this section

Declaration
protected override string GetComponentCssClass()
Returns
Type Description
string

GetValueLink to this section

Gets the value.

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

OnClickLink to this section

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

OnContextMenuLink to this section

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 to this section

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 🗙