WPF combo box, adding an all options item, when binding to an Observable Collection

Posted by Joel Barsotti on Stack Overflow See other posts from Stack Overflow or by Joel Barsotti
Published on 2011-01-06T19:37:56Z Indexed on 2011/01/06 19:54 UTC
Read the original article Hit count: 217

Filed under:
|

So I've got an object that has an observable collection. Most places I bind to this collection I only want the user to select a single item. But in one place I want the combobox to include an all items option.

Is the way to do this simply with xaml converter?

It seems like doing it in the view model would be a good idea, but it's really a lot dependency object goop to basically wire up an collection that is two objects deep for an on change event, where as the xaml converter just works.

But I always feel like xaml converters should be generic and reusable, where in this instance, the xaml converter would be more of a one off.

Of course the third option would be to create one off list for UI in the object that contains the standard observable collection. But this seems to be mixing the logic and presentation in a way that makes me uncomfortable.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml