private void MenuItem_CompareCommitClick(object sender, RoutedEventArgs e) { var mi = sender as MenuItem; var sha = (string)(mi.Parent as ContextMenu).Tag; View.ChangeParentSnapshot(sha, false); }