This one should be easy, and im ashamed i havent figured it out myself yet. I'm trying to reverse the order of a list of items in my wp7 app. The list is an ObservableCollection. When using system.linq, intellisense lets me do this: myList.Reverse(); ,but this doesnt seem to work. Am i doing something wrong, or is there some other way i can do this easily?
Thanks in advance.
Reverse returns an IEnumerable, it does not modify the collection. To modify the collection you could do
collection = new ObservableCollection<YourType>(collection.Reverse());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With