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)));
 }
 public SchemaContextMenuViewModel(MainViewModel mainViewModel)
 {
     m_mainViewModel = mainViewModel;
       m_mainViewModel.PropertyChanged += MainViewModelOnPropertyChanged;
       m_openMenuItemViewModel = new MenuItemViewModel("Open", mainViewModel.OpenFileViewModelCommand, mainViewModel, "SelectedNode");
       m_menuItems.Add(m_openMenuItemViewModel);
       m_renameMenuItemViewModel = new MenuItemViewModel("Rename", mainViewModel.RenameSelectedNodeCommand);
       m_menuItems.Add(m_renameMenuItemViewModel);
       m_menuItems.Add(new MenuItemViewModel("Delete", mainViewModel.DeleteSelectedNodeCommand));
       m_newMenuItemViewModel = new MenuItemViewModel("New");
       m_addSchemaMenuItemViewModel = new MenuItemViewModel("Add schema to file", new ManualCommand(AddSchema));
       m_menuItems.Add(m_addSchemaMenuItemViewModel);
       m_menuItems.Add(m_newMenuItemViewModel);
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Folder", m_mainViewModel.CreateFolderCommand));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("New schema", new ManualCommand(CreateSchema)));
 }
 public TemplateContextMenuViewModel(MainViewModel mainViewModel)
 {
     m_mainViewModel = mainViewModel;
       m_mainViewModel.PropertyChanged += MainViewModelOnPropertyChanged;
       m_openMenuItemViewModel = new MenuItemViewModel("Open", mainViewModel.OpenFileViewModelCommand, mainViewModel, "SelectedNode");
       m_menuItems.Add(m_openMenuItemViewModel);
       m_renameMenuItemViewModel = new MenuItemViewModel("Rename", mainViewModel.RenameSelectedNodeCommand);
       m_menuItems.Add(m_renameMenuItemViewModel);
       m_menuItems.Add(new MenuItemViewModel("Delete", mainViewModel.DeleteSelectedNodeCommand));
       m_newMenuItemViewModel = new MenuItemViewModel("New");
       m_menuItems.Add(m_newMenuItemViewModel);
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Folder", m_mainViewModel.CreateFolderCommand));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("New template", new ManualCommand(CreateTemplate)));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Txt", m_mainViewModel.CreateFileCommand, "file.txt"));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Json", m_mainViewModel.CreateFileCommand, "file.json"));
 }
 public ProjectContextMenuViewModel(MainViewModel mainViewModel)
 {
     m_mainViewModel = mainViewModel;
       m_mainViewModel.PropertyChanged += MainViewModelOnPropertyChanged;
       m_openMenuItemViewModel = new MenuItemViewModel("Open", mainViewModel.OpenFileViewModelCommand, mainViewModel, "SelectedNode");
       m_menuItems.Add(m_openMenuItemViewModel);
       m_renameMenuItemViewModel = new MenuItemViewModel("Rename", mainViewModel.RenameSelectedNodeCommand);
       m_menuItems.Add(m_renameMenuItemViewModel);
       m_menuItems.Add(new MenuItemViewModel("Delete", mainViewModel.DeleteSelectedNodeCommand));
       m_newMenuItemViewModel = new MenuItemViewModel("New");
       m_menuItems.Add(m_newMenuItemViewModel);
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Folder", m_mainViewModel.CreateFolderCommand));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Txt", m_mainViewModel.CreateFileCommand, "file.txt"));
       m_newMenuItemViewModel.Children.Add(new MenuItemViewModel("Json", m_mainViewModel.CreateFileCommand, "file.json"));
       m_newFromTemplateMenuItemViewModel = new MenuItemViewModel("New from template",
     new ConverterObservableCollection<Template, IMenuItemViewModel>(m_mainViewModel.TemplateManager.Templates, template => new MenuItemViewModel("Name", template, new GenericManualCommand<Template>(RunTemplate), template)));
       m_menuItems.Add(m_newFromTemplateMenuItemViewModel);
 }