public I_AdvanceSearchMenu AddMenu(string header) { if (Node.ContextMenu == null) { Node.ContextMenu = new ContextMenu(); } MenuItem menu = new MenuItem(); menu.Header = header; AdvanceSearchMenu advanceSearchMenu = new AdvanceSearchMenu(menu); Node.ContextMenu.Items.Add(menu); menu.Click += (sender, e) => Menu_Click(sender, e, advanceSearchMenu); return(advanceSearchMenu); }
private void Menu_Click(object sender, RoutedEventArgs e, AdvanceSearchMenu advanceSearchMenu) { advanceSearchMenu.OnClicked(); }