Class ChangeEventArgs<TChecked>
Provides event data for the ValueChange
event of the Checkbox and similar components in the Syncfusion Blazor Buttons library.
Inheritance
Namespace: Syncfusion.Blazor.Buttons
Assembly: Syncfusion.Blazor.dll
Syntax
public class ChangeEventArgs<TChecked> : Object
Type Parameters
Name |
---|
TChecked |
Remarks
This class is used to pass contextual information when the checked value of a Checkbox component has changed. It contains details about the new checked value and the associated mouse event that triggered the change, if any.
Examples
The following example demonstrates how to use the ChangeEventArgs<TChecked> in a ValueChange event handler:
<SfCheckBox @bind-Checked="isChecked" ValueChange="OnCheckedChanged" />
@code {
private bool isChecked;
private void OnCheckedChanged(ChangeEventArgs<bool> args)
{
// Access the new checked value
bool checkedValue = args.Checked;
// Use event details if needed
var mouseEvent = args.Event;
}
}
Constructors
ChangeEventArgs()
Declaration
public ChangeEventArgs()
Properties
Checked
Gets or sets the checked value of the Checkbox component after a value change has occurred.
Declaration
public TChecked Checked { get; set; }
Property Value
Type | Description |
---|---|
TChecked | The checked value of type |
Remarks
When the checkbox is toggled, this property provides the updated checked value, which is typically true
or false
for boolean types.
Examples
void OnCheckedChanged(ChangeEventArgs<bool> args)
{
bool checkedValue = args.Checked;
}
Event
Gets or sets the mouse event arguments associated with the checked value change.
Declaration
public MouseEventArgs Event { get; set; }
Property Value
Type | Description |
---|---|
Microsoft.AspNetCore.Components.Web.MouseEventArgs | A Microsoft.AspNetCore.Components.Web.MouseEventArgs object that describes the mouse event triggering the value change. This value can be |
Remarks
This property contains additional information about the user's mouse event, such as click coordinates and button details, when the checked value is changed through user interaction.
Examples
void OnCheckedChanged(ChangeEventArgs<bool> args)
{
var mouseEvent = args.Event;
// You can check mouseEvent properties such as mouseEvent.Button
}