Razor
xxxxxxxxxx
@foreach (var item in Model.Brand.CheckBoxes)
{
<label>
@item.Value
<input type="checkbox" @onchange="(e) => FilterChangedBrand(item, e)" />
</label>
}
@code
xxxxxxxxxx
// Some Model
public FiltersModel Model { get; set; } // Initialized in OnParametersSet
// Some event you want to fire
public event Action<FiltersModel> FiltersChanged;
private void FilterChangedBrand(FilterCheckBox item, ChangeEventArgs e)
{
// here you do work of @bind
item.Checked = !item.Checked;
string newCheckedBrand = e.Value.ToString();
// Now How to Find and Set the relevant Model property to newCheckedBrand
// You can invoke anything here, not just this event
FiltersChanged?.Invoke(Model);
}