Trapping events within list box item templates in WPF
Posted
by AC
on Stack Overflow
See other posts from Stack Overflow
or by AC
Published on 2010-04-01T21:39:37Z
Indexed on
2010/04/01
21:43 UTC
Read the original article
Hit count: 276
I've got listbox that employs an item template. Within each item in the list, as defined in the template there is a button. When the user clicks the button I change a value in the data source that defines the sort order of the list. Changing the datasource is not a problem as this is working just fine within my application template.
However my next step is to reload the listbox with the new sorted data source. I've tried doing this from the tempalte but it apparently doesn't have access (or I can't figure out how to get access) to the parent elements so I can reset the .ItemSource property with a newly sorted data source.
Seems like this is possible but the solution is eluding me :(
© Stack Overflow or respective owner