private void Remove_Click(object sender, RoutedEventArgs e) { var removeButton = sender as Button; if (removeButton != null) { var parameter = removeButton.CommandParameter; if (parameter != null) { ILR.ApprenticeshipFinancialRecord les2Remove = parameter as ILR.ApprenticeshipFinancialRecord; les2Remove.IsSelected = true; if (les2Remove != null) { ApprenticeshipFinancialItemsCV.MoveCurrentTo(les2Remove); _learningDelivery.Delete(les2Remove); _apprenticeshipFinancialRecordList.Remove(les2Remove); if (!ApprenticeshipFinancialItemsCV.MoveCurrentToPrevious()) { ApprenticeshipFinancialItemsCV.MoveCurrentToFirst(); ApprenticeshipFinancialItemsCV.Refresh(); OnPropertyChanged("ApprenticeshipFinancialItemsCV"); } if (ApprenticeshipFinancialItemsCV.CurrentItem != null && ApprenticeshipFinancialItemsCV.CurrentItem != les2Remove) { ILR.ApprenticeshipFinancialRecord f = ApprenticeshipFinancialItemsCV.CurrentItem as ILR.ApprenticeshipFinancialRecord; f.IsSelected = true; } else { ApprenticeshipFinancialItemsCV.MoveCurrentToNext(); if (ApprenticeshipFinancialItemsCV.CurrentItem != null) { ILR.ApprenticeshipFinancialRecord f = ApprenticeshipFinancialItemsCV.CurrentItem as ILR.ApprenticeshipFinancialRecord; f.IsSelected = true; } } } ApprenticeshipFinancialItemsCV.Refresh(); OnPropertyChanged("ApprenticeshipFinancialItemsCV"); ShouldShowListView(); } } }
private void Remove_Click(object sender, RoutedEventArgs e) { if (TrailblazerItemsCV.CurrentItem != null) { ILR.ApprenticeshipTrailblazerFinancialDetails les2Remove = TrailblazerItemsCV.CurrentItem as ILR.ApprenticeshipTrailblazerFinancialDetails; if (les2Remove != null) { _learningDelivery.Delete(les2Remove); _TrailBlazerList.Remove(les2Remove); if (!TrailblazerItemsCV.MoveCurrentToPrevious()) { TrailblazerItemsCV.MoveCurrentToFirst(); TrailblazerItemsCV.Refresh(); OnPropertyChanged("TrailblazerItemsCV"); } if ((TrailblazerItemsCV.CurrentItem != null) && (TrailblazerItemsCV.CurrentItem != les2Remove)) { ILR.ApprenticeshipTrailblazerFinancialDetails f = TrailblazerItemsCV.CurrentItem as ILR.ApprenticeshipTrailblazerFinancialDetails; f.IsSelected = true; } else { TrailblazerItemsCV.MoveCurrentToNext(); if (TrailblazerItemsCV.CurrentItem != null) { ILR.ApprenticeshipTrailblazerFinancialDetails f = TrailblazerItemsCV.CurrentItem as ILR.ApprenticeshipTrailblazerFinancialDetails; f.IsSelected = true; } } } TrailblazerItemsCV.Refresh(); } OnPropertyChanged("TrailblazerItemsCV"); ShouldShowListView(); }
private void Remove_Click(object sender, RoutedEventArgs e) { if (ApprenticeshipFinancialItemsCV.CurrentItem != null) { ILR.ApprenticeshipFinancialRecord les2Remove = ApprenticeshipFinancialItemsCV.CurrentItem as ILR.ApprenticeshipFinancialRecord; if (les2Remove != null) { _learningDelivery.Delete(les2Remove); _apprenticeshipFinancialRecordList.Remove(les2Remove); if (!ApprenticeshipFinancialItemsCV.MoveCurrentToPrevious()) { ApprenticeshipFinancialItemsCV.MoveCurrentToFirst(); ApprenticeshipFinancialItemsCV.Refresh(); OnPropertyChanged("ApprenticeshipFinancialItemsCV"); } if ((ApprenticeshipFinancialItemsCV.CurrentItem != null) && (ApprenticeshipFinancialItemsCV.CurrentItem != les2Remove)) { ILR.ApprenticeshipFinancialRecord f = ApprenticeshipFinancialItemsCV.CurrentItem as ILR.ApprenticeshipFinancialRecord; f.IsSelected = true; } else { ApprenticeshipFinancialItemsCV.MoveCurrentToNext(); if (ApprenticeshipFinancialItemsCV.CurrentItem != null) { ILR.ApprenticeshipFinancialRecord f = ApprenticeshipFinancialItemsCV.CurrentItem as ILR.ApprenticeshipFinancialRecord; f.IsSelected = true; } } } ApprenticeshipFinancialItemsCV.Refresh(); } OnPropertyChanged("ApprenticeshipFinancialItemsCV"); ShouldShowListView(); }