Take the 2-minute tour ×

I have a list of images inside a grid triggering this method "imageBtnClicked()" on their leftmousebuttondown event. Now how can i know which image was clicked inside this method, so that i can change its property later?

share|improve this question
sender as <ElementType> where ElementType is the type of element which triggers the event should give you the Element. Now, you can extract whatever property you need to identify the element (Tag, Name, Datacontext, etc) Please put some code, so that we can help you with more specifics. –  abhinav Feb 28 '12 at 12:09
add comment

1 Answer

you can identify it by the sender :

Image i = (image)sender;

After that, you can use Image(in this case "i") properties to know which Image was clicked.

share|improve this answer
add comment

Your Answer


