views:

527

answers:

1

Is there an ItemActivated event (like in Windows Forms) in the WPF ListBox or ComboBox controls? I can't see one.

It seems crazy for there not to be some event doing the same kind of thing - so does it just go by another name? If not, is there another easy way to do it? I've seen various blog posts about this but they all seem to involve subclassing the control and other things like that. I'm sure the WPF designers realised this was pretty much the most common thing that is done with a ListBox or ComboBox!

I'm basically looking for an event which will fire when the item is activated, telling me which item has activated and allowing me to access the properties of that item.

+1  A: 

from what I understand of your description, you want to look at the SelectedItem (individual) and SelectedItems (a collection) properties. Additionally, there should be a SelectionChanged event (though I'm not certain about that naming there).

Stephen Wrighton