void moveDownCommand_Execute(object parameter) { var highlighted = StreamedItems.Where(si => si.IsHighlighted).ToList(); StreamedItems.ToList().ForEach(h => h.IsHighlighted = false); int index; for (var i = highlighted.Count - 1; i >= 0; i--) { index = StreamedItems.IndexOf(highlighted[i]); StreamedItems.Move(index, ++index); } highlighted.ForEach(h => h.IsHighlighted = true); }
void moveUpCommand_Execute(object parameter) { var highlighted = StreamedItems.Where(si => si.IsHighlighted).ToList(); StreamedItems.ToList().ForEach(h => h.IsHighlighted = false); int index; foreach (var moveUpItem in highlighted) { index = StreamedItems.IndexOf(moveUpItem); StreamedItems.Move(index, --index); } highlighted.ForEach(h => h.IsHighlighted = true); }