Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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);
        }