private void AddMecanicButton_OnClick(object sender, RoutedEventArgs e) { string name = AddMecanicNameTextBox.Text; string firstName = AddMecanicFirstNameTextBox.Text; if (!FieldsCompleted(name, firstName)) { AddMecanicDisplayInfoTextBlock.Text = @"Must complete mandatory fields."; } else { AddMecanicButton.IsEnabled = true; Mecanic mechanic = new Mecanic() { Nume = name, Prenume = firstName }; _client.AddMecanic(mechanic); AddMecanicDisplayInfoTextBlock.Text = @"Mecanic added."; AddMecanicDisplayInfoTextBlock.Visibility = Visibility.Visible; } MechanicsTabItem_OnLoaded(sender, e); }