Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@using MudBlazor
@rendermode InteractiveServer
<EditForm EditContext="_editContext">
<FluentValidationValidator/>
<FluentValidationValidator @ref="_fluentValidationValidator" />
<ValidationSummary></ValidationSummary>
<MudInput Label="Person name" @bind-Value="_person.Name"></MudInput>

Expand Down Expand Up @@ -41,7 +41,9 @@
<button type="submit">Skicka in</button>
</EditForm>

@code{
@code {
private FluentValidationValidator? _fluentValidationValidator;

List<Car> _allCars = new();
Person _person = new();
private EditContext _editContext;
Expand All @@ -65,9 +67,10 @@
_person.Cars.Remove(car);
_editContext.NotifyFieldChanged(new FieldIdentifier(car, "Name"));
_editContext.NotifyFieldChanged(new FieldIdentifier(_person, "Cars"));
_fluentValidationValidator?.Validate();
}
}

private void NameChanged(Car car)
{
_editContext.NotifyFieldChanged(new FieldIdentifier(car, "Name"));
Expand Down