+ Profile Settings
+
+
+ A focused form-validation sample combining
+ DataAnnotations, FluentValidation, backend field
+ errors, accessible inputs, and dirty-state tracking.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ @if (_isDirty)
+ {
+
+
+ You have unsaved changes.
+
+
+
+
+
+
+ }
+
+ @if (!string.IsNullOrWhiteSpace(
+ _statusMessage))
+ {
+
+ @_statusMessage
+
+ }
+
+
+
+@code {
+ private ProfileModel _model =
+ new();
+
+ private ProfileModel _savedModel =
+ new();
+
+ private EditContext _editContext =
+ default!;
+
+ private ValidationMessageStore
+ _backendMessages =
+ default!;
+
+ private bool _isDirty;
+ private bool _isSaving;
+ private string? _statusMessage;
+
+ private static readonly IReadOnlyDictionary<
+ string, string[]> ValidationDependencies =
+ new Dictionary