public Snapshot(ScalarValidation source) { _source = source; _showAll = source._showAll; _progress = source._progress; _valueChanged = source._progress; }
internal override void FlushCore(T element, bool isFlushing, bool isProgressiveFlushing) { var valueChanged = DoFlush(element); var makeProgress = isProgressiveFlushing || IsValidationVisible; ScalarValidation.OnFlushed(this, makeProgress, valueChanged); }
/// <inheritdoc/> public override bool SubmitInput(bool focusToErrorInput = true) { RequireLayoutManager(); if (IsEditing) { CurrentRow.EndEdit(); } if (IsEditing) { return(false); } RowValidation.Validate(); ScalarValidation.Validate(); if (!CanSubmitInput) { if (focusToErrorInput) { LayoutManager.FocusToInputError(); } return(false); } return(true); }
/// <summary> /// Determines whether validation error exists. /// </summary> /// <param name="flowIndex">The flow index.</param> /// <returns><see langword="true"/> if validation error exists, otherwise <see langword="false"/>.</returns> public bool HasValidationError(int flowIndex = 0) { if (flowIndex < 0 || flowIndex >= InputManager.FlowRepeatCount) { throw new ArgumentOutOfRangeException(nameof(flowIndex)); } return(ScalarValidation.HasError(this, flowIndex, true)); }
/// <summary> /// Gets the validation info. /// </summary> /// <param name="flowIndex">The flow index.</param> /// <returns>The validation info.</returns> public ValidationInfo GetValidationInfo(int flowIndex = 0) { if (flowIndex < 0 || flowIndex >= InputManager.FlowRepeatCount) { throw new ArgumentOutOfRangeException(nameof(flowIndex)); } return(ScalarValidation.GetInfo(this, flowIndex)); }
/// <summary> /// Tries to submit data input with validation. /// </summary> /// <param name="focusToErrorInput">A value indicates whether the UI element with validation error should have keyboard focus.</param> /// <returns><see langword="true"/> if data input submitted sccessfully, otherwise <see langword="false"/>.</returns> public virtual bool SubmitInput(bool focusToErrorInput = true) { RequireLayoutManager(); ScalarValidation.Validate(); if (!CanSubmitInput) { if (focusToErrorInput) { LayoutManager.FocusToInputError(); } return(false); } return(true); }
void ScalarContainer.IOwner.OnEndEdit() { ScalarValidation.ExitEdit(); }
void ScalarContainer.IOwner.OnCancelEdit() { ScalarValidation.CancelEdit(); }
void ScalarContainer.IOwner.OnBeginEdit() { ScalarValidation.EnterEdit(); }