Well the question says it all? I have a DataTemplate with a button is there any way to run a function or some how tell the object that the button was pressed?
+3
A:
Give the button a x:name and you can see that name in the button events 'sender' or e.source parameter
var source = sender as FrameworkElement; // Or whatever real control it is
var parent = source.parent; // Get parent control(s)
var dataContext = source.DataContext; // Get databinding context
TFD
2009-03-10 08:49:45
Ok so far so good but that did not solve my problem :P, i get to .net code but how do i get the Object that the datatemplate is for? in my case Job
Petoj
2009-03-10 08:52:39
nvm button.DataContext solved it! thank you
Petoj
2009-03-10 08:58:50