title: In Blazor, How to @bind and then fire @onchange in a dynamic model
body: <p>Model:</p>
  <pre><code>public class FiltersModel
  {      
      public CheckBoxListWithTitle Brand { get; set; }
  }
  
  public class CheckBoxListWithTitle
  {        
      public List&lt;FilterCheckBox&gt; CheckBoxes { get; set; }
  }
  
  public class FilterCheckBox
  {        
      public string Value { get; set; }
      public bool Checked { get; set; }
  }
  </code></pre>
  <p>Razor:</p>
  <pre><code>@foreach (var item in Model.Brand.CheckBoxes)
  {
  &lt;label&gt;
      @item.Value
      &lt;input type=&quot;checkbox&quot; @onchange=&quot;@FilterChangedBrand&quot; /&gt;  
  &lt;/label&gt;
  }
  </code></pre>
  <p>@code:</p>
  <pre><code>public FiltersModel Model { get; set; } // Initialized in OnParametersSet
  
  private void FilterChangedBrand(UIChangeEventArgs e)
  {
      string newCheckedBrand = e.Value.ToString();
      // Now How to Find and Set the relevant Model property to newCheckedBrand
      FiltersChanged?.Invoke(Model);
  }
  </code></pre>
  <p>How to Find and Set the relevant Model property to newCheckedBrand in the FilterChangedBrand method.</p>
  <p>Or Use @bind=&quot;@item.Checked&quot; in the checkbox markup and then raise an event when the checked state for one of checkboxes changes?</p>