tags:

views:

27

answers:

1

I've got a list of things that I want the user to easily edit the order of. Right now I'm binding them to a ListBox with a custom ItemTemplate. Within that template I have an UP & DOWN button. My goal was to move the item up/down based on the button clicked.

However I'm having trouble associating the button's click event with the actual item in the list. I've seen some folks setup a drag/drop for ordering items but that that would be too complex for this app (it's target user base =1, just me).

I assume this is possible with a ListBox. Maybe someone has a beter idea on how to implement this? It's not a huge set of data... less than 25 items.

A: 

The DataContext of the button (of the entire template, thus inherited by the button) is the item itself. Simply cast it to your desired type.

Timores
Duh... thanks Timores... that was eluding me...
AC