示例#1
0
        /// <summary>
        /// Shows the message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="controlName">Name of the control.</param>
        public void ShowMessage(string message, ControlNames controlName)
        {
            if (!string.IsNullOrEmpty(message))
            {
                ErrorMessageTextBlock.Text       = message;
                ErrorMessageTextBlock.Visibility = Visibility.Visible;
                switch (controlName)
                {
                case ControlNames.ConfirmPassword:
                {
                    ConfirmPasswordBox.DelayedFocus();
                    break;
                }

                case ControlNames.Password:
                {
                    PasswordBox.DelayedFocus();
                    break;
                }

                case ControlNames.ZipCode:
                {
                    ZipCodeTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.LastName:
                {
                    LastNameTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.FirstName:
                {
                    FirstNameTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.Email:
                {
                    EmailTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.GetEmail:
                {
                    GetEmailCheckBox.DelayedFocus();
                    break;
                }
                }
            }
            else
            {
                ErrorMessageTextBlock.Visibility = Visibility.Collapsed;
            }
        }