Class
Sealed
public sealed class InlineEditState
Namespace: Moka.Blazor.Json.Models
Tracks the state of an active inline edit session.
Properties
| Name | Description |
|---|---|
CurrentValue |
|
OriginalValue |
|
Path |
|
Target |
|
ValidationError |
|
ValueKind |
Methods
| Name | Description |
|---|---|
WithError(string error) |
Copies this state with a validation error. Rows re-render when they get a new instance. |
WithError(string error)
public InlineEditState WithError(string error)
Copies this state with a validation error. Rows re-render when they get a new instance.
View Source
/// <summary>
/// Tracks the state of an active inline edit session.
/// </summary>
public sealed class InlineEditState
{
public required string Path { get; init; }
public required InlineEditTarget Target { get; init; }
public required string OriginalValue { get; init; }
public string CurrentValue { get; set; } = "";
public string? ValidationError { get; set; }
public JsonValueKind ValueKind { get; init; }
/// <summary>
/// Copies this state with a validation error. Rows re-render when they get a new instance.
/// </summary>
public InlineEditState WithError(string error) => new()
{
Path = Path,
Target = Target,
OriginalValue = OriginalValue,
CurrentValue = CurrentValue,
ValueKind = ValueKind,
ValidationError = error
};
}