How to add an Event Trigger to a MenuItem in WPF

The Click event is used to add the menu item click event handler. The following code adds a click event handler for a menu item.

  <MenuItem IsCheckable="true" Header="_Open" Click="MenuItem_Click">

The event handler is defined like following in the code behind. I added a message box when the menu item is clicked.

private void MenuItem_Click(object sender, RoutedEventArgs e)

{

    MessageBox.Show("Menu item clicked");

}