private void buttonAddAgent_Click(object sender, RoutedEventArgs e) { if (NameNewAgent.Text == string.Empty) { labelError.Visibility = Visibility.Visible; } else { labelError.Visibility = Visibility.Hidden; var agent = agentService.AddNewAgent(NameNewAgent.Text); NameNewAgent.Text = ""; AgenstList.Items.Add(agent); LogConsole.Items.Add(consoleService.AddNewAgent(agent.Name)); } }