Ejemplo n.º 1
0
        private bool IsInputValid()
        {
            if (string.IsNullOrEmpty(this.FirstNameTextBox.Text))
            {
                InputHelper.DisplayError("First name cannot be empty.");
                return(false);
            }

            if (string.IsNullOrEmpty(this.SurnameNameTextBox.Text))
            {
                InputHelper.DisplayError("Surname cannot be empty.");
                return(false);
            }

            if (string.IsNullOrEmpty(this.GenderComboBox.SelectedValue.ToString()))
            {
                InputHelper.DisplayError("Gender cannot be empty.");
                return(false);
            }

            if (this.BirthdayDatePicker.SelectedDate is null)
            {
                InputHelper.DisplayError("Birthday cannot be empty.");
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
 private void App_DispatcherUnhandledExceptionHandler(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
 {
     InputHelper.DisplayError(e.Exception.Message);
     e.Handled = true;
 }