private void checkValidation(object sender, TextChangedEventArgs e) { TextBox textBox = (TextBox)sender; login = validation.userNameValidation(textBox) ? textBox.Text : ""; if (validation.isAllFieldValidate()) { LoginButton.IsEnabled = true; } else { LoginButton.IsEnabled = false; } }