Is it possible to create a ReactiveUI derived collection that has more elements in it than the original?
I've seen that there is a way of filtering a collection, and selecting single properties, but what I'm looking for is the equivalent of the SelectMany operation for enumerables.
To illustrate, imagine trying to get a derived collection representing every passenger stuck in a traffic jam.
class Car
{
ReactiveCollection<Passenger> Passengers;
}
var TrafficJam=new ReactiveCollection<Car>();
EveryPassengerInTheTrafficJam=Cars.CreateDerivedCollection(c=>c.Passengers);
The above doesn't work, I think the error was IEnumerable<ReactiveCollection<Passenger>>
can't be cast to ReactiveCollection<Passenger>
- or something up with the types, in any case.
I can't figure out the right approach for this flattening - admittedly I may be barking up completely the wrong tree here, so please let me know if there's a better way of achieving the same thing!