private void CheckList_Remove(object sender, RoutedEventArgs e) { for (int i = 0; i < CheckedElements.Count; i++) { if (((Element)((CheckBox)sender).DataContext).path == CheckedElements[i].path) { CheckedElements.RemoveAt(i); break; } } }
private void ViewList_Uncheck(object sender, RoutedEventArgs e) { if (((Element)((CheckBox)sender).DataContext).type == "Folder") { for (int i = 0; i < CheckedElements.Count; i++) { if (CheckedElements[i].path.Contains(((Element)((CheckBox)sender).DataContext).path)) { CheckedElements.RemoveAt(i--); } } } else { for (int i = 0; i < CheckedElements.Count; i++) { if (((Element)((CheckBox)sender).DataContext).path == CheckedElements[i].path) { CheckedElements.RemoveAt(i); break; } } } }