File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Blazor.AdminLte.Site.Shared/Pages/Forms Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1919 }
2020 @for ( int i = 0 ; i < Checkboxes .Count ; i ++ )
2121 {
22- <CustomCheckbox @bind-State =" Checkboxes[i]" /> <text >Checked : @Checkboxes [i ].IsChecked ;</text >
22+ <CustomCheckbox @bind-Value =" Checkboxes[i]" /> <text >Checked : @Checkboxes [i ].IsChecked ;</text >
2323 }
2424 </FormGroup >
2525 </Body >
Original file line number Diff line number Diff line change 11@namespace Blazor.AdminLte
22<div class =" custom-control custom-checkbox" >
3- <input class =" custom-control-input" type =" checkbox" id =" @State .Identifier" value =" @State .Value" disabled =" @State .IsDisabled" checked =" @State .IsChecked" @onchange =" DoChange" >
4- <label for =" @State .Identifier" class =" custom-control-label" >@( (MarkupString )State .Label ) </label >
3+ <input class =" custom-control-input" type =" checkbox" id =" @Value .Identifier" value =" @Value .Value" disabled =" @Value .IsDisabled" checked =" @Value .IsChecked" @onchange =" DoChange" >
4+ <label for =" @Value .Identifier" class =" custom-control-label" >@( (MarkupString )Value .Label ) </label >
55</div >
66
Original file line number Diff line number Diff line change @@ -5,20 +5,20 @@ namespace Blazor.AdminLte
55 public partial class CustomCheckbox
66 {
77 [ Parameter ]
8- public CustomCheckboxState State { get ; set ; }
8+ public CustomCheckboxState Value { get ; set ; }
99
1010 [ Parameter ]
11- public EventCallback < CustomCheckboxState > StateChanged { get ; set ; }
11+ public EventCallback < CustomCheckboxState > ValueChanged { get ; set ; }
1212
1313 [ Parameter ]
1414 public EventCallback < CustomCheckboxState > OnChange { get ; set ; }
1515
1616 private void DoChange ( ChangeEventArgs e )
1717 {
18- State . IsChecked = ( bool ? ) e . Value ;
19- StateChanged . InvokeAsync ( State ) ;
18+ Value . IsChecked = ( bool ? ) e . Value ;
19+ ValueChanged . InvokeAsync ( Value ) ;
2020 if ( OnChange . HasDelegate )
21- OnChange . InvokeAsync ( State ) ;
21+ OnChange . InvokeAsync ( Value ) ;
2222 }
2323 }
2424}
You can’t perform that action at this time.
0 commit comments