protected void CreateEntityMenu(DevExpress.Utils.Menu.DXPopupMenu rowMenu, TEntity entity) { var newItem = new Utils.Menu.DXMenuItem(); newItem.Caption = "New"; newItem.BindCommand(() => viewModel.New(), viewModel); var editItem = new Utils.Menu.DXMenuItem(); editItem.Caption = "Edit..."; editItem.BindCommand((ee) => viewModel.Edit(ee), viewModel, () => entity); var deleteItem = new Utils.Menu.DXMenuItem(); deleteItem.Caption = "Delete"; deleteItem.BindCommand((ee) => viewModel.Delete(ee), viewModel, () => entity); rowMenu.Items.Add(newItem); rowMenu.Items.Add(editItem); rowMenu.Items.Add(deleteItem); }
protected DXPopupMenu CreateEntityMenu(TEntity entity) { var rowMenu = new DXPopupMenu(); var newItem = new DXMenuItem(); newItem.Caption = "New"; newItem.BindCommand(() => viewModel.New(), viewModel); var editItem = new DXMenuItem(); editItem.Caption = "Edit..."; editItem.BindCommand(ee => viewModel.Edit(ee), viewModel, () => entity); var deleteItem = new DXMenuItem(); deleteItem.Caption = "Delete"; deleteItem.BindCommand(ee => viewModel.Delete(ee), viewModel, () => entity); rowMenu.Items.Add(newItem); rowMenu.Items.Add(editItem); rowMenu.Items.Add(deleteItem); return(rowMenu); }