In my WPF application I'd like to use LINQ as much as possible (especially to avoid foreach
). But WPF works a lot with the ObservableCollection, and I can't use LINQ with these kind of collection. What can I do?
Just for anybody else who may come across this issue with trying to filter an ObservableCollection but find that they can't.
Jon is absolutely correct in that there is no reason why you can't do this but the key thing for a newbie or for someone who has been developing with WPF for a while, is that you need to include the "using System.Linq;" namespace. As you soon as you do this, you can do a ".where" query on your object.