private void SelectContactButtonClick(object sender, RoutedEventArgs e) { var selected = ContactsList.SelectedItem as Contact; try { MessageService.AddRecipient(selected); StatusBlock.Alert($"{selected.FirstName} {selected.LastName} was added to the list", StatusBlock.Success); } catch (EmptyFieldException ex) { StatusBlock.Alert(ex.Message, StatusBlock.Warning); } catch (ItemAllreadyExistsException ex) { StatusBlock.Alert(ex.Message, StatusBlock.Warning); } catch (ItemNotFoundException ex) { StatusBlock.Alert(ex.Message, StatusBlock.Warning); } catch (Exception) { StatusBlock.Alert("Error while adding recipient", StatusBlock.Danger); } }