예제 #1
0
 private bool IsValidated()
 => !string.IsNullOrWhiteSpace(nameTextBox.Text) &&
 !string.IsNullOrWhiteSpace(phoneTextBox.Text) &&
 !Validator.GetHasError(nameTextBox) &&
 !Validator.GetHasError(phoneTextBox) &&
 hourCB.SelectedItem != null &&
 minuteCB.SelectedItem != null &&
 dateSelector.SelectedDate != null;
예제 #2
0
        /// <summary>
        /// Removes all errors from the specified element.
        /// </summary>
        /// <param name="element">The element to remove errors from.</param>
        public static void ClearInvalid(DependencyObject element)
        {
            var errorsToRemove = WValidation.GetErrors(element)
                                 .ToArray();

            foreach (var error in errorsToRemove)
            {
                removeValidationError.Invoke(null, new object[] { error, element, true });
            }
        }