public void Initalize() { var tasksSection = new MenuSection <ItemCommand <ClientViewModel> >(); var tasksSubMenu = new NavigationalEntry <ItemCommand <ClientViewModel> > { Header = Tx.T("TasksInfrastructure:CreateTask.Commands", 2), IsOrdered = true, Icon = _icons.SelectCommandColumn }; InitializeCommands(tasksSubMenu); tasksSection.Add(tasksSubMenu); var createTaskCommand = new ItemCommand <ClientViewModel> { Header = Tx.T("TasksInfrastructure:CreateTask"), Icon = _icons.NewCatalog, Command = new DelegateCommand <ClientViewModel>(client => CreateTaskCommand(new List <ClientViewModel> { client })), MultipleCommand = new DelegateCommand <IList <ClientViewModel> >(CreateTaskCommand) }; tasksSection.Add(createTaskCommand); _clientsContextMenu.Add(tasksSection); }
public FileExplorerListDirectoryContextMenu() { Add(Section1 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); Section1.Add(Section1Path = new NavigationalEntry <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); Add(Section2 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); Section2.Add(Section2Archive = new NavigationalEntry <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); Add(Section3 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); Add(Section4 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >()); }
private static void InitializeGroupsContextMenu(MenuSection <ItemCommand <ClientViewModel> > contextMenu, IWindowService windowService, IRestClient restClient, IClientManager clientManager) { var menuItem = new MenuItem { Style = (Style)Application.Current.Resources["ClientGroupsMenuItem"], Tag = new GroupMenuItemViewModel(windowService, restClient) }; menuItem.SetBinding(ItemsControl.ItemsSourceProperty, new Binding("GroupViewModels") { Source = clientManager }); var section = new MenuSection <ItemCommand <ClientViewModel> > { new MenuItemEntry <ItemCommand <ClientViewModel> >(menuItem) }; contextMenu.Add(section); }