wpf右键菜单
ContextMenu Menu1 = new ContextMenu();
MenuItem menuItem = new MenuItem();
menuItem.Header = "属性";
menuItem.Click += new RoutedEventHandler(menuItem_Click);
menuItem.Tag = item.Text;
Menu1.Items.Add(menuItem);
grid1.ContextMenu = Menu1;
void menuItem_Click(object sender, RoutedEventArgs e)
{
MenuItem menuItem = (MenuItem)sender;
MessageBox.Show("Hello " + menuItem.Tag.ToString());
}