Problem :
‘Im populating a ListView with ControlTemplate.
In this template for each item there will be a button that when clicked need to perform some action.
How i can access the object that generated the ListViewItem so i can fetch something (like a id).
DataContextis your friend. Each list item (and button inside that item if you haven’t override button’sDataContext) will have a data item which was used to generate the item inDataContextproperty.