Change Blazor Toggle Switch Button state using toggle method

8 Oct 20211 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>

    private bool isChecked = false;
    SfSwitch<bool> SwitchObj;
    private void create(object obj)

Changing Blazor Toggle Switch Button State

Switch triggers OnChange event on every state stage to perform custom operations.