# BormState (Class) `Bit.Borm.BormState` - implements `IDisposable` Runtime state for a form instance: holds the data, validation results, touched/dirty tracking, wizard position and submission state. The UI layer binds to this and reacts to BormState.StateChanged. ## Property - **AllMessages** : `IEnumerable` - All current validation messages across the form. - **CanRedo** : `bool` - Whether there is a change taken back that can be made again. - **CanUndo** : `bool` - Whether there is a change to take back. - **CurrentStep** : `BormStep` - **CurrentStepIndex** : `int` - Index of the active wizard step (ignored for non-wizard forms). - **CurrentStepNumber** : `int` - The 1-based position of the current step among the visible ones — what a stepper should show, so numbering stays contiguous when a conditional step is skipped. - **Data** : `IBormDataAccessor` - The data store (typed model or dictionary). - **Definition** : `BormDefinition` - The schema being rendered. - **DirtyFields** : `IReadOnlyCollection` - Every field path whose value has changed since the form was created or last reset. - **Disabled** : `bool` = `false` - Disables every control at once — while a save is in flight, or while the record is locked by someone else. Distinct from BormState.ReadOnly on purpose: a read-only form can still be read, tabbed through and copied from, which is what a review screen wants; a disabled one is skipped by keyboard navigation entirely, which is only right when the form is genuinely inoperable. - **ExternalValidator** : `BormExternalValidator` - Optional external validator merged with built-in rules (set by integrations). - **FormDescription** : `string` - The form's description, translated. - **FormTitle** : `string` - The form's title, translated. - **FurthestStepIndex** : `int` - The furthest step the user has reached. Steps up to it have been validated on the way past, so they can be returned to freely — including forwards. Without this, going back to step 1 of 4 makes steps 2 and 3 unreachable except by pressing Next through them again, which is the single most common complaint about hand-rolled wizards: the user came back to fix one answer and is now made to walk the whole form. - **HasErrors** : `bool` - True if there is at least one error-severity message. Written as a loop rather than a LINQ query on purpose: every render of every button reads it through IsValid, and a nested SelectMany allocates two iterators and a closure each time to answer a question that is almost always "no, and here is the first one". - **HasValidated** : `bool` - True once a full validation pass has run at least once, so BormState.IsValid reflects a real verdict rather than the absence of one. Reset by BormState.Reset. - **HistoryLimit** : `int` = `0` - How many changes BormState.UndoAsync can take back. Zero, the default, keeps no history at all; BormView's ShowUndo turns it on. A change is everything one answer set off: the value, a field a condition then hid and cleared, a sibling a change handler filled in, a row added, removed, moved or copied. Two writes to the same field within a second are one change, and so is the tidying a field does when the user leaves it. What changes the model behind the form's back is not recorded, so undo is only as good as the discipline of making changes through the state. BormState.Reset and restoring a draft start the history again. - **IdPrefix** : `string` = `"borm_"` - What every DOM id this form renders starts with — borm_ unless changed. Ids are derived from field paths, so two forms on one page binding the same schema render the same ids, and a label, an aria-describedby or an error-summary link in one of them points into the other. Give each a prefix of its own (for example through BormView.IdPrefix) to keep them apart. Set it before the form first renders. - **IsFirstStep** : `bool` - **IsFormDirty** : `bool` - **IsLastStep** : `bool` - **IsSubmitSuccessful** : `bool` - True when the last submit passed validation and the handler it dispatched to returned without throwing — React Hook Form's isSubmitSuccessful. This is what a "Saved." confirmation binds to. BormState.IsValid cannot do the job: it goes back to true the moment the user corrects the last error, long before anything has been saved, and it says nothing at all about whether the save then failed. Reset by the next submit attempt and by BormState.Reset. - **IsSubmitted** : `bool` - True once the form has been submitted at least once. - **IsSubmitting** : `bool` - True while the consumer's submit handler is running. Used to block double submits. - **IsUploading** : `bool` - Whether any file is still on its way. - **IsValid** : `bool` - True when no error-severity message is currently recorded. This reports what validation has found, not what it would find: a form that has never been validated has no messages and so reports valid, even with a required field left blank. Check BormState.HasValidated before treating it as a verdict — binding a submit button's disabled to IsValid alone would leave the button enabled on an empty form and then disable it the moment the user's first mistake is caught, which is exactly backwards. Prefer letting the user submit and reporting what is wrong. - **IsValidating** : `bool` - True while an async submit/validation is in flight. - **Language** : `string` - The language this form's own text is read out in - a culture name, de or pt-BR - whatever the page's culture is. Null (the default) follows CultureInfo.CurrentUICulture. For a form shown in a language other than the page's - a public form in the visitor's language - and for an application with no culture data to switch to: under InvariantGlobalization, common on WebAssembly, the UI culture is always the invariant one and no translation would ever apply. The document's BormDefinition.Translations are looked up by this name, then by the name with its last part dropped (de-CH, then de). BormView marks the form with it as its lang, so a screen reader reads it in that language. A registered IBormSchemaLocalizer is asked as before, and finds its culture its own way. The library's own words - validation messages, buttons, announcements - follow it when the message provider can answer in a language of its choosing: services.AddBormTranslations() registers one. A rule's message already on screen is rewritten in the new language when its field is next validated. - **NextRedoPath** : `string` - The field the next BormState.RedoAsync makes the change to again. - **NextUndoPath** : `string` - The field the next BormState.UndoAsync takes back the change to, for a button or an announcement to name. - **ReadOnly** : `bool` = `false` - Makes every field read-only at once — the "review before you submit" or "view an existing record" mode, without needing a second schema. - **ReadOnlyWhileSubmitting** : `bool` = `false` - When true, every field is read-only while the submit handler runs, so what the user types into the form during a slow save cannot leave the form showing values other than the ones saved. Off by default: a form that keeps working while it saves is what most people expect. - **RevalidationTrigger** : `BormValidationTrigger` = `BormValidationTrigger.OnChange` - When a field revalidates once the form has been submitted at least once, or the field already shows an error. Defaults to BormValidationTrigger.OnChange so a corrected field clears its error immediately. - **RunAsyncRulesOnInvalidFields** : `bool` = `false` - Whether a field's asynchronous rules still run when one of its synchronous rules has already found an error. False by default: a username that does not match its pattern is not sent to the server to ask whether it is taken. See BormValidator.RunAsyncRulesOnInvalidFields. - **Services** : `IServiceProvider` - Optional service provider for validators that need DI, and where the registered message provider and schema localizer are found. A state built without one takes the services of the BormView it is shown in. - **SingleErrorPerField** : `bool` = `false` - When true, a field shows only its first error at a time instead of every rule it currently breaks — React Hook Form's criteriaMode: "firstError", which is its default. This is about what the user reads, not about what runs: every rule is still evaluated, so BormState.IsValid and the submit decision are unchanged. A password that is too short, missing a digit and missing a symbol otherwise stacks three complaints under one box, which reads as three problems rather than one field to go and fix. Warnings are unaffected — they sit alongside the error rather than competing with it. Off by default, because showing everything at once is what this library has always done and telling the user only half of what is wrong is a choice, not an improvement. - **SubmitCancellationToken** : `CancellationToken` - The token of the submit in flight — what a handler wired through BormView.OnValidSubmit, which is handed only the state, passes on to its request. CancellationToken.None while no submit is running. - **SubmitCount** : `int` - Number of times submission has been attempted. - **SubmitError** : `Exception` - The exception the last submit's handler threw, when BormState.SubmitOutcome is BormSubmitOutcome.Failed; null otherwise. - **SubmitOutcome** : `BormSubmitOutcome` - How the last submit ended — BormSubmitOutcome.None before the first one and after BormState.Reset. What a "Saved." banner, a "could not save, try again" message and a retry button all bind to, each to the case that is theirs. - **TouchedFields** : `IReadOnlyCollection` - Every field path the user has interacted with. - **ValidatingFields** : `IReadOnlyCollection` - Every field path with an asynchronous rule currently in flight. - **ValidationTrigger** : `BormValidationTrigger` = `BormValidationTrigger.OnChange` - When a field revalidates before the form has been submitted. Defaults to BormValidationTrigger.OnChange. - **VisibleSteps** : `IReadOnlyList` - The steps that are currently visible, in schema order. ## Method - **AcceptChanges**() : `void` - Re-captures the current values as the baseline for BormState.Reset and clears dirty tracking — call this after a successful save so the form is no longer reported as dirty. - **AddArrayItem**(BormFieldDefinition arrayField, string arrayPath) : `int` - Appends a new item to an array field and returns its index. - **ArrayCount**(string arrayPath) : `int` - **Batch**(Action action) : `void` - Runs action with change notifications held back, raising a single one at the end. Nesting is safe; only the outermost batch notifies. An exception still releases the batch, so a failure part-way through cannot leave the form permanently silent. - **CanAddArrayItem**(BormFieldDefinition arrayField, string arrayPath) : `bool` - Whether another item may be added, given BormFieldDefinition.MaxItems. - **CancelSubmit**() : `void` - Asks a submit in flight to stop: the token its handler was given is signalled. A handler that honours it ends the submit as BormSubmitOutcome.Cancelled; one that has already sent its request is free to finish, since whether a request that reached the server took effect is the server's to say. Does nothing when no submit is running. - **CanRemoveArrayItem**(BormFieldDefinition arrayField, string arrayPath) : `bool` - Whether an item may be removed, given BormFieldDefinition.MinItems. - **ClearArrayItems**(string arrayPath) : `void` - Empties an array field, discarding every row's messages and touched/dirty state along with it. Removing rows one at a time costs a re-render and a re-index per row, and the caller has to walk backwards to avoid the indices moving underneath them. - **ClearHistory**() : `void` - Forgets every change, so there is nothing to undo or redo. - **ClearMessages**() : `void` - **ClearMessages**(string path) : `void` - Clears the messages for a single field and everything nested beneath it. - **Dispose**() : `void` - Cancels any in-flight validation and detaches listeners. - **DuplicateArrayItem**(BormFieldDefinition arrayField, string arrayPath, int index) : `int` - Inserts a copy of the item at index directly after it and returns the new index, or -1 if the row could not be copied. This is the "add another one like that" a repeater of anything non-trivial always ends up needing. Values are copied field by field through the schema rather than by cloning the object, so the new row is genuinely independent — a shallow copy would leave the two rows sharing the same nested objects and editing one would silently edit the other. - **EnsureOptionsAsync**(BormFieldDefinition field, string path) : `ValueTask` - Runs a field's options provider unless its results are already cached. Renderers call this on first render and after a dependency changes; it is a no-op for fields with static options. - **FocusAsync**(string path) : `ValueTask` - Moves focus to the control at path. Returns false when nothing is rendering it — a field on another wizard step, one a condition has hidden, or a control with no focusable element of its own. A path no control renders by itself — an object, or one row of a repeater — sends focus to the first control inside it that will take it. A message about "the address" or "line 2" as a whole is fixed somewhere in there, and the error summary's link to it, and focus-the-first-error after a failed submit, otherwise went nowhere at all. - **GetFieldState**(string path) : `BormFieldState` - Everything known about one field in a single read: whether the user has been there, whether the value has moved from its baseline, and what is currently wrong with it. The pieces are all separately available (BormState.IsTouched, BormState.IsDirty, BormState.MessagesFor); this is the aggregate React Hook Form spells getFieldState, and it exists because a custom renderer asking all three questions per render otherwise reads the state three times and has to keep the answers in step itself. - **GetValue**(string path) : `object` - **GoToStep**(int index) : `void` - Jumps to a step by index. Hidden steps and out-of-range indices are ignored. Jumping forward past a step the user has not reached is allowed here — the caller has asked for it explicitly — but it skips that step's validation, which is why the stepper only offers steps up to BormState.FurthestStepIndex. - **GoToStep**(string id) : `void` - Jumps to a step by its BormStep.Id. - **HelpOf**(BormFieldDefinition field, string path) : `string` - The field's help text, translated. - **InsertArrayItem**(BormFieldDefinition arrayField, string arrayPath, int index) : `int` - Inserts a new item at index (clamped into range) and returns the index it landed at. Messages below the insertion point are re-indexed so they stay with their item. - **InvalidateOptions**(string path) : `void` - Drops cached options for a field so the next render reloads them. - **IsDirty**(string path) : `bool` - **IsDisabled**(BormFieldDefinition field, string path = null) : `bool` - Whether a field is currently disabled given the data. Read-only fields are deliberately *not* disabled — a disabled control is skipped by keyboard navigation and unreadable to screen readers, so read-only is rendered with the readonly attribute instead. See BormState.IsReadOnly. - **IsLoadingOptions**(string path) : `bool` - True while a field's BormFieldDefinition.OptionsProvider is running. - **IsReadOnly**(BormFieldDefinition field, string path = null) : `bool` - Whether a field is read-only: in its own right, because a condition says so, or because the whole form is. Pass path so a condition written on an array item's template is evaluated against that row, exactly as BormState.IsVisible and BormState.IsDisabled do. - **IsRequired**(BormFieldDefinition field, string path = null) : `bool` - Whether a field is required right now, taking BormFieldDefinition.RequiredWhen into account. - **IsStepReachable**(int index) : `bool` - Whether a step may be jumped to directly: it has been reached, and so has every step shown before it - a step that appeared behind the user (a condition met on an earlier one) is reached by Next, like any other, rather than skipped past unvalidated. - **IsStepVisible**(BormStep step) : `bool` - Whether a wizard step is currently visible. - **IsTouched**(string path) : `bool` - **IsValidatingField**(string path) : `bool` - Whether an asynchronous rule is currently running for path — what a control showing "checking that username…" binds to. React Hook Form spells the set of these validatingFields; TanStack Form spells it field.state.meta.isValidating. Distinct from BormState.IsValidating, which is about the form: a remote uniqueness check on one box should put a spinner beside that box, not declare the whole form busy and grey out its submit button. Only fields that actually have an async rule are ever reported, so a form of ordinary synchronous rules never flickers. - **IsVisible**(BormFieldDefinition field, string path = null) : `bool` - Whether a field is currently visible given the data. Pass path so a condition written on an array item's template is evaluated against that row; omitting it evaluates against the root, which is all a top-level field ever needs. - **LabelOf**(BormFieldDefinition field, string path) : `string` - The field's label, translated, or null when it has none. - **Localize**(string key, string text) : `string` - A piece of the schema's own text, translated: what the registered IBormSchemaLocalizer says for key, else what the document's BormDefinition.Translations say for the current UI culture, else text as written. The built-in components render every label, help text, placeholder, option and title through this; a custom renderer should too. - **MarkAllTouched**() : `void` - Marks every field touched, so validation messages become visible everywhere. Called on submit so a user who submits an untouched form still sees what is missing. - **MarkTouched**(string path) : `void` - **MessagesFor**(string path) : `IReadOnlyList` - Messages for a specific field path. - **MoveArrayItem**(string arrayPath, int from, int to) : `void` - Moves an array item from one index to another. - **NextStepAsync**() : `ValueTask` - Advances to the next visible step — after validating the current one on a wizard; tabs and sections are moved between freely and validated together on submit. - **NormalizeAll**() : `bool` - Runs every declared normalizer across the form — including one per row of a repeater. Called before a submit validates, so a field the user never visited is still tidied. - **NormalizeField**(BormFieldDefinition field, string path) : `bool` - Runs the field's BormFieldDefinition.Normalize over the value at path, writing the result back when it differs. Returns true if anything changed. The write goes through the ordinary path, so tidying a value runs the same sweeps typing one does — a total that reads it recomputes, a condition that watches it re-evaluates, an autosave hears about it. It is written quietly: normalising is the form tidying up after the user, not the user visiting a field. - **NotifyDefinitionChanged**() : `void` - Tells the state that its BormState.Definition was changed in place — a field added, removed or reconfigured, a rule or condition swapped, a step inserted — so it can catch up without being rebuilt and losing what the user has entered. The state works out once which fields take part in each of the sweeps a write runs — clearing hidden values, recomputing, reloading cascading choices, revalidating dependents — because those run on every keystroke. A schema edited under it is otherwise only half seen: a computed field added to a form that had none was never computed, and a ClearOnHide added later never cleared anything. Catching up means: new fields get their defaults and their baselines (so they are not dirty), computed values are evaluated again, and everything recorded against a path the schema no longer has — messages, touched and dirty flags, rejected entries, loaded choices, work in flight — is dropped, so a removed field cannot keep blocking a submit from beyond the page. The values the user entered stay; a removed field's value is left in the model, where the application can still read it. Replacing the whole BormState.Definition object is a different matter: build a new state for it (BormView does that by itself). - **OptionsError**(string path) : `Exception` - The exception a field's options provider last failed with, or null when it has not failed. A lookup that goes over the network fails for ordinary reasons, and losing the whole form to it would be out of proportion — so the failure is recorded here, announced through BormState.OptionsLoadFailed, and shown in place of the choices. - **OptionsFor**(BormFieldDefinition field, string path) : `IReadOnlyList` - The options to render for a field: those loaded by its BormFieldDefinition.OptionsProvider if it has one, otherwise the static BormFieldDefinition.Options from the schema. - **OrderedMessages**() : `IReadOnlyList` - All current messages in the order their fields appear in the schema — the order an error summary should list them so "fix the first one" walks the user down the page. - **PlaceholderOf**(BormFieldDefinition field, string path) : `string` - The field's placeholder, translated. - **PrefixOf**(BormFieldDefinition field, string path) : `string` - The text before the field's input, translated. - **PreviousStep**() : `void` - Moves to the previous visible step (no validation). - **RedoAsync**() : `Task` - Makes the last change taken back again. True when there was one. - **RegisterFocusTarget**(string path, Func> focus) : `IDisposable` - Registers a way to move focus to the control rendering path. Input components call this so the state can honour "take me to the first error" without knowing anything about the DOM. The callback reports whether focus actually landed. Dispose the returned token to unregister. - **RegisterRowRevealer**(string arrayPath, Func> reveal) : `IDisposable` - Registers how the list at arrayPath brings one of its rows into view - a paged repeater turning to the row's page - so focusing a field in it works wherever the row is. The callback reports whether it had to show anything. Dispose the returned token to unregister. - **RegisterSubmitAttempt**() : `int` - Records a submit attempt (so validation messages become visible) and returns the count. - **RemoveArrayItem**(string arrayPath, int index) : `void` - Removes an item from an array field. - **RemoveStoredUpload**(BormFieldDefinition field, string path, string result) : `void` - Takes back a file the field held before anything was uploaded here - one of an edit form's saved files. - **RemoveUpload**(BormFieldDefinition field, string path, BormUpload upload) : `void` - Stops an upload, or takes back a finished one, and the field no longer holds it. - **Reset**() : `void` - Restores the values captured when the state was created, and clears validation, touched/dirty tracking, the submit count and the wizard position. Values are restored, not deep-cloned: array elements that already existed when the state was created are put back by reference, so edits made *inside* one of those objects are not rolled back. Items added after construction are removed. - **Reset**(IEnumerable> values) : `void` - Rebases the form onto values: they are written, become the new baseline for BormState.Reset and BormState.IsFormDirty, and everything the previous session accumulated — messages, touched and dirty flags, the submit count, the wizard position — is cleared. This is React Hook Form's reset(values), and it is what an edit form needs after a save round-trip returns the stored record: BormState.Reset would put back the values the form was constructed with, which are now the wrong ones. Only the paths named are written; anything else keeps the value it currently holds and is baselined at that value. Pass every field to replace the form's contents wholesale. - **ResetField**(string path) : `void` - Puts one field — and anything nested beneath it — back to the value it started with, clearing its messages and its touched/dirty state. This is the "undo just this answer" that a long form needs and that BormState.Reset is far too blunt for; React Hook Form spells it resetField. A path the form has no baseline for — a field inside a row added since construction — is emptied, because "the value it started with" is nothing. - **RetryUploadAsync**(BormFieldDefinition field, string path, BormUpload upload) : `Task` - Tries a failed upload again. - **SearchOptionsAsync**(BormFieldDefinition field, string path, string text) : `ValueTask` - Runs a field's search (see BormFieldDefinition.SearchMinLength) for text, replacing the options it offers. A search still running for earlier text is cancelled, and its answer never lands on top of this one. The built-in combobox calls this as the user types; a custom control can too. - **SearchText**(string path) : `string` - The text a search field's current results answer, or null before anything was typed. - **SetServerError**(string path, string message) : `void` - Adds a message for a path (used by server-side validation results). - **SetServerErrors**(IEnumerable messages) : `void` - Replaces the form's messages with those returned by a server round-trip, so a failed POST can surface its errors on the right fields in one call. The messages stand until the field they are on is next validated — the user correcting it, or the next submit — at which point the field's own rules speak for it again; the server is asked again on that next submit. A message on a path the form does not show still blocks BormState.IsValid, and is listed by the error summary. - **SetServerErrors**(IEnumerable> errors, Func mapPath = null) : `void` - Replaces the form's messages with the errors of a failed request, in the shape ASP.NET Core's ValidationProblemDetails.Errors — and most other validation responses — use: each key a field, each value what is wrong with it. Pass problem.Errors as it arrives. - **SetValue**(string path, object value) : `void` - Sets a value, marks the field dirty and touched, and notifies listeners. - **SetValueQuietly**(string path, object value) : `void` - Sets a value without marking the field touched — for programmatic updates (computed values, prefill) that should not make the user's untouched field start showing errors. - **SetValues**(IEnumerable> values, bool markTouched = false) : `void` - Writes several values as one change: listeners are notified once at the end rather than once per field. Prefilling a form from a saved record otherwise costs one re-render per value, and any intermediate state — half the answers applied — is briefly visible to a computed field or a condition watching from the outside. - **ShouldValidate**(string path, BormValidationTrigger trigger) : `bool` - Whether a change (or blur) on path should trigger validation, given the configured triggers. A field that already shows an error always revalidates eagerly so the error disappears as soon as it is fixed. - **Snapshot**() : `IReadOnlyDictionary` - Every value the schema binds to, as a flat path/value map — the shape BormState.Reset takes back, so the pair is a complete save-and-restore for a draft: stash a snapshot while the user is halfway through, hand it back when they return. Live array elements are walked, so a repeater contributes one entry per row per field (Lines[0].Product, Lines[1].Product, …) rather than one opaque list. Presentational fields and object containers hold no value of their own and are skipped, exactly as they are when the form captures its baseline. Values are the objects the model holds, not copies: this is a map of what is there, not a deep clone of it. Serialise it if it has to outlive the objects. - **Snapshot**(BormSnapshotOptions options) : `IReadOnlyDictionary` - BormState.Snapshot, leaving out what options asks — the values of fields the form is hiding, which a hidden branch keeps unless it is ClearOnHide, and sensitive values, which must not be written anywhere that outlives the page. This is how a payload gets the semantics a schema-driven form needs: a hidden answer is retained while the user can still toggle back to it, cleared when the field is ClearOnHide, and excluded from what is sent when the snapshot says so. - **StepDescriptionOf**(BormStep step) : `string` - A step's description, translated. - **StepTitleOf**(BormStep step) : `string` - A step's title, translated, falling back to its id. - **StoredUploadsFor**(string path) : `IReadOnlyList` - What the field holds for files sent before - the uploader's results - that no upload chosen here produced: an edit form's saved files, which a field taking several keeps beside the new ones. - **SubmitAsync**(Func onValid = null, Func onInvalid = null) : `Task` - Runs the full submit cycle: marks every field touched, validates, and invokes onValid or onInvalid. Concurrent calls are ignored while a submit is in flight, which is what stops a double-click from posting twice. - **SubmitAsync**(Func onValid) : `Task` - **SubmitAsync**(Func onValid, Func onInvalid = null) : `Task` - Runs the full submit cycle, handing each handler a token that BormState.CancelSubmit and disposing the form signal — the one to pass on to the request the handler makes. The cycle, in order: Every normalizer runs, so the values judged and sent are the tidied ones.Every field is marked touched and the whole form is validated, async rules included.Invalid: onInvalid runs, and the outcome is BormSubmitOutcome.Invalid. Valid: onValid runs. If it records errors — BormState.SetServerError or BormState.SetServerErrors with what a rejected request said — the outcome is BormSubmitOutcome.Rejected; if it throws, BormSubmitOutcome.Failed, with the exception in BormState.SubmitError and rethrown; if it stops because the token was cancelled, BormSubmitOutcome.Cancelled; otherwise BormSubmitOutcome.Succeeded. An error the user makes while it runs - text a number box cannot read, typed into a form that is not read-only while it saves - is the user's, not the handler's, and leaves a successful save successful. Nothing about a failure is retried behind the application's back, and the user's values are left exactly as they were, so "try again" is simply submitting again. - **SuffixOf**(BormFieldDefinition field, string path) : `string` - The text after the field's input, translated. - **SwapArrayItems**(string arrayPath, int first, int second) : `void` - Exchanges two array items, taking their messages and touched/dirty state with them. Distinct from BormState.MoveArrayItem, which shuffles everything between the two positions along by one; a swap leaves every other row exactly where it was, which is what a drag-and-drop reorder of two rows means and what React Hook Form's useFieldArray spells swap. - **Text**(string key, params object[] args) : `string` - Resolves a piece of the library's own text (see BormMessageKeys) through the registered IBormMessageProvider, falling back to the English defaults. The built-in components render everything through this, so a single provider translates the whole form — buttons, placeholders and repeater labels included, not only the validation messages. It answers in BormState.Language when the form has one and the provider can answer in a language of its choosing (IBormLocalizedMessageProvider, as BormTranslatedMessageProvider is). - **TextKeyOf**(BormFieldDefinition field, string path) : `string` - The key a field's texts are translated under: its BormFieldDefinition.TextKey, or its path with the rows taken out (Lines[2].Product is Lines.Product). - **TrackEntryAsync**(Task entry) : `Task` - Tells the form an entry is still being turned into a value, so a submit or a wizard's Next made meanwhile waits for it rather than judging the value from before. The built-in search combobox does this for text committed before its results arrived; a control of your own whose commit awaits something - a lookup, a parse on the server - passes that work here and awaits what it returns. - **UndoAsync**() : `Task` - Takes back the last change - everything it set off with it - and judges again what it touched. True when there was one to take back. - **UploadAsync**(BormFieldDefinition field, string path, IReadOnlyList files) : `Task` - Uploads files chosen for a field with an BormFieldDefinition.Uploader: judged by the field's file rules first - a file they refuse is not sent - then each on its way at once. A field taking one file replaces the one it had, which it no longer holds from then on, whether or not the new one arrives; one taking several adds to them, the files it held before included. A submit made meanwhile waits for them. - **UploadsFor**(string path) : `IReadOnlyList` - The files chosen for the field at path whose uploads are on their way, done or failed. - **ValidateAsync**(bool includeAsync = true) : `ValueTask` - Validates the entire form and stores the results. - **ValidateDependentsAsync**(string changedPath, bool includeAsync = false) : `ValueTask` - Revalidates every field that declared changedPath in its BormFieldDefinition.RevalidateOn list — the other half of a cross-field rule. A rule that reads two values lives on one of them, so only one of the two changes ever runs it. The confirm-password case is the whole story: the user mistypes the confirmation and is told the two do not match, then fixes the password to agree with what they typed — and the message under the confirmation box is now wrong, and stays wrong, because nothing revalidated a field the user did not touch. React Hook Form's deps and TanStack Form's onChangeListenTo exist for exactly this. A dependent that has nothing to say is left alone: a field the user has never visited on a form that has never been submitted must not start showing errors because a different field changed. The point is to correct a verdict already on screen, not to bring forward one that is not. - **ValidateFieldAsync**(string path, bool includeAsync = true) : `ValueTask` - Validates the single field at path, resolving its definition from the schema — React Hook Form's trigger(name). Returns false when the path names no field in the schema, so a caller checking one answer from outside the form does not have to go and find the definition first. The field counts as visited, so what the check found is shown on it - as trigger shows it - rather than only recorded for a field the user has not been to yet. - **ValidateFieldAsync**(BormFieldDefinition field, string path, bool includeAsync = true) : `ValueTask` - Validates a single field and refreshes only its messages. - **ValidateStepAsync**(bool includeAsync = true) : `ValueTask` - Validates the fields of the current wizard step. ## Event - **FieldChanged** : `Action` - Raised when a specific field value changes, with its path. - **OptionsLoadFailed** : `Action` - Raised with the field path and the exception when an options provider throws. Subscribe to log it; the form itself carries on with an empty list and retries on the next BormState.InvalidateOptions. - **StateChanged** : `Action` - Raised whenever state changes and the UI should re-render.