Click here to Skip to main content
15,891,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a drag canvas and its child elements are textblock, button abd another canvas.
On right click of button or textblock contextmenu is displayed containing menuitem delete and deleteall.

On click of delete how to identify the menuitem is from a textblock or a button
Posted
Updated 23-Dec-10 16:25pm

To add to Eddy's answer, you would do something like this:

C#
if (sender is TextBlock)
{
    // ... do something 
}
else if (sender is Button)
{
    // ... do something 
}


 
Share this answer
 
Check out the sender object in the method that get's raised :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900