@inherits ButtonBaseComponent<CheckBoxControl>

<span style="@GetStyle">
    <input style="vertical-align: middle; padding: 0; margin: 0 5px 0 0;" 
           type="checkbox"
           name="@Control.Name"
           value="@Control.Text"
           checked="@Control.Checked"
           disabled="@IsDisabled"
           @onchange="OnChanged"/>
    <label style="@GetControlFont()">@Control.Text</label>
</span>

@code {

    private void OnChanged()
    {
        CheckBoxClick();

        Refresh();
    }

    private void CheckBoxClick()
    {
        Control.Checked = !Control.Checked;
        Control.FilterData();
        Control.OnClick(null);
        Control.OnCheckedChanged(EventArgs.Empty);
    }
}
