Why do you think you cannot use LINQ with ObservableCollection<T>? He implements Collection<T>, so everything should be fine.
For instance:
using System;
using System.Collections.ObjectModel;
using System.Linq;
class Test
{
static void Main()
{
var collection = new ObservableCollection<int>()
{
1, 2, 3, 6, 8, 2, 4, 5, 3
};
var query = collection.Where(x => x % 2 == 0);
foreach (int x in query)
{
Console.WriteLine(x);
}
}
}
source
share