///-------------------------------------------------------------------------------- /// <summary>This method handles the execution of the delete command.</summary> /// /// <param name="sender">The event sender.</param> /// <param name="e">The event arguments.</param> ///-------------------------------------------------------------------------------- private void DeleteExecuted(object sender, ExecutedRoutedEventArgs e) { RelationshipsViewModel items = DataContext as RelationshipsViewModel; if (items != null) { foreach (RelationshipViewModel item in items.Relationships) { if (item.IsSelected == true) { if (MessageBox.Show(DisplayValues.Message_DeleteItemConfirmation, DisplayValues.Message_DeleteItemConfirmationCaption, MessageBoxButton.OKCancel) == MessageBoxResult.OK) { items.DeleteRelationship(item); } return; } } } }