For those of you that like puzzles: I had this problem recently and am sure there must be a nicer solution.
Consider :
- an ObservableCollection of Foo objects called foos.
- Foo contains a string ID field
- I have no control over foos
- foos will be changing
Then:
- I have another collection called sortLikeThis
- sortListThis contains strings
- The strings are the IDs in the order in which the foos are to be shown
Plus:
- There may be objects in foos with an ID that is not in sortLikeThis. These need to go at the end.
- Likewise, there may be strings in sortLikeThis that do not appear in foos.
Is there a nice way to bind to and show in wpf the Foo objects in foos in the order defined by IDs in sortLikeThis ?
Thanks, Lee.