public void ProcessMenuItems(MenuKind menuKind, MenuItemDescriptionCollection items) { if (menuKind == MenuKind.Selection) { int index = Math.Max(0, items.IndexOf(ReportCommand.Cut)); MenuItemDescription itemShow = new MenuItemDescription("Show Grid", null, showGridCommandID); MenuItemDescription itemHide = new MenuItemDescription("Hide Grid", null, hideGridCommandID); items.Insert(index++, MenuItemDescription.Separator); items.Insert(index++, itemShow); items.Insert(index++, MenuItemDescription.Separator); items.Insert(index++, itemHide); items.Insert(index++, MenuItemDescription.Separator); } }
private void MenuItems_MouseDoubleClick(object sender, MouseButtonEventArgs e) { DataGrid gd = (DataGrid)sender; DataRowView row_selected = gd.SelectedItem as DataRowView; if (row_selected != null) { int SelectedItemId = int.Parse(row_selected[0].ToString()); string SelectedItemDesc = row_selected[4].ToString(); string SelectedItemCode = row_selected[5].ToString(); MenuItemDescription WindowMenuItemDescription = new MenuItemDescription(SelectedItemId, SelectedItemDesc, SelectedItemCode); WindowMenuItemDescription.ShowDialog(); reset(); } }
public Window(MenuItemDescription menuItemDescription) { MenuItemDescription = menuItemDescription; }