private void AddNewChassisButton_OnClick(object sender, RoutedEventArgs e) { var chassisCode = AddChassisCodeTextBox.Text; var chassisName = AddChassisNameTextBox.Text; if (!FieldsCompleted(chassisName, chassisCode)) { AddChassisDisplayInfoTextBlock.Text = @"Must complete mandatory fields."; } else { AddNewChassisButton.IsEnabled = true; Sasiu sasiu = new Sasiu() { CodSasiu = chassisCode, Denumire = chassisName }; _client.AddChassis(sasiu); AddChassisDisplayInfoTextBlock.Text = @"Chassis added."; AddChassisDisplayInfoTextBlock.Visibility = Visibility.Visible; } ChassisTabItem_OnLoaded(sender, e); }