Пример #1
0
 public TabsContextMenuViewModel(MainViewModel mainViewModel, LayoutElementViewModel layoutElement)
 {
     m_mainViewModel = mainViewModel;
       m_layoutElement = layoutElement;
       m_menuItems.Add(new MenuItemViewModel("Close", mainViewModel.CloseFileCommand, layoutElement, "SelectedFile"));
       m_menuItems.Add(new MenuItemViewModel("Revert", new ManualCommand(() => layoutElement.SelectedFile.Reload())));
       m_closeAllMenuItemViewModel = new MenuItemViewModel("Close all", new ManualCommand(() => mainViewModel.CloseAllFiles(false)));
       m_menuItems.Add(m_closeAllMenuItemViewModel);
       m_closeOthersMenuItemViewModel = new MenuItemViewModel("Close others", new ManualCommand(() => mainViewModel.CloseAllFiles(true)));
       m_menuItems.Add(m_closeOthersMenuItemViewModel);
       m_layoutElement.OpenFiles.PropertyChanged += OpenfilesOnPropertyChanged;
       m_menuItems.Add(new MenuItemViewModel("Show in project tree", new ManualCommand(ShowInTree)));
       m_menuItems.Add(new MenuItemViewModel("Open containing folder", new ManualCommand(OpenContainingFolder)));
 }