Is there a way to get the actual DataItem of a DataTemplate. More specifically, I have a custom button which I use in a datatemplate:
<DataTemplate x:Key="SampleDataTemplate1">
<custom:SampleButton />
</DataTemplate>
I use this in a listview to bind to a collection. I would like to pass a reference to the actual DataItem that is being bound. Something like this:
<DataTemplate x:Key="SampleDataTemplate1">
<custom:SampleButton BoundItem="{Binding DataItem}" />
</DataTemplate>
Is this possible? How can this be accomplished?