ReadOnlyContinuousCollection from multiple source collections

Sep 2, 2010 at 10:14 PM

Is there a way to have a single ReadOnlyContinuousCollection generated from multiple aggregated source collections? I'm looking for something similiar to the Union LINQ operation/extension-method.

For example:

var a = new ObservableCollection<string> { "a", "b", "c" };
var b = new ObservableCollection<string> { "d", "e", "f" };
ReadOnlyContinuousCollection<string> c = a.Union(b);

Where the contents of 'c' would be "a", "b", "c", "d", "e", "f".


Sep 2, 2010 at 10:32 PM

I've used a SelectMany operator to combine multiple collections together like this. It works similarly to the Union operator.

If you need to get distinct values, as a typical Union would do, then you can use the Distinct operator to do that.

- Nathan

Sep 15, 2010 at 5:53 PM

Yeah, Its .Concat()