private bool TryValidateAll() { var validated = true; var handler = ValidatingAll; if (handler != null) { var args = new ValidatingAllEventArgs(false); foreach (ValidatingAllEventHandler subHandler in handler?.GetInvocationList()) { subHandler(args); if (args.Cancel) { validated = false; } } } return(validated); }
private void OnValidatingAll(ValidatingAllEventArgs e) { e.Cancel = Validate() == ValidationStatus.Error; }