Change Blazor Toggle Switch Button state using toggle method
17 Dec 20221 minute to read
This section explains about how to toggle between the Toggle Switch Button states using Toggle method.
@using Syncfusion.Blazor.Buttons
<SfSwitch @bind-Checked="isChecked" OffLabel="OFF" OnLabel="ON" Created="create" @ref="SwitchObj" TChecked="bool"></SfSwitch>
@code{
private bool isChecked = false;
SfSwitch<bool> SwitchObj;
private void create(object obj)
{
//SwitchObj.Toggle();
}
}
NOTE
Switch triggers OnChange event on every state stage to perform custom operations.