private void AddAccount_Click(object sender, RoutedEventArgs e) { if (LoginTextBox.Text.Length < 4 || PasswordTextBox.Text.Length < 4) { MessageBox.Show("Login and password should have at least 4 symbols.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); return; } AccountsList.ItemsSource = _engine.AddAccount(LoginTextBox.Text, PasswordTextBox.Text); LoginTextBox.Text = ""; PasswordTextBox.Text = ""; }