public FileListCommandManager(IFileListViewModel flvm, IWindowManager windowManager, IEventAggregator events,
                                      params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _flvm = flvm;

            IEntryModel _currentDirectoryModel = null;

            InitCommandManager();
            ToolbarCommands = new ToolbarCommandsHelper(events, ParameterDicConverter,
                                                        message => { _currentDirectoryModel = message.NewModel; return(new IEntryModel[] { _currentDirectoryModel }); },
                                                        message => message.SelectedModels.Count() == 0 && _currentDirectoryModel != null ? new IEntryModel[] { _currentDirectoryModel } : message.SelectedModels.ToArray())
            {
                ExtraCommandProviders = new[] {
                    new StaticCommandProvider(new SelectGroupCommand(flvm),
                                              new ViewModeCommand(flvm),
                                              new SeparatorCommandModel(),
                                              new CommandModel(ExplorerCommands.NewFolder)
                    {
                        IsVisibleOnToolbar  = true,
                        HeaderIconExtractor = ResourceIconExtractor <ICommandModel> .ForSymbol(0xE188)
                    },
                                              new DirectoryCommandModel(
                                                  new CommandModel(ExplorerCommands.NewFolder)
                    {
                        Header = Strings.strFolder, IsVisibleOnMenu = true
                    })
                    {
                        IsVisibleOnMenu = true, Header = Strings.strNew, IsEnabled = true
                    },
                                              new ToggleVisibilityCommand(flvm.Sidebar, ExplorerCommands.TogglePreviewer)
                                              )
                }
            };
        }
        public NavigationCommandManager(INavigationViewModel nvm, IEventAggregator events,
                                        params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _nvm = nvm;

            InitCommandManager();
            ToolbarCommands = new ToolbarCommandsHelper(events,
                                                        null,
                                                        null)
            {
            };
        }
        public ExplorerCommandManager(IExplorerViewModel evm,
                                      params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _evm = evm;

            InitCommandManager();
            ToolbarCommands = new ToolbarCommandsHelper(_evm.Events,
                                                        null,
                                                        null)
            {
            };
        }
Beispiel #4
0
        public TabbedExplorerCommandManager(ITabbedExplorerViewModel nvm, IEventAggregator events,
                                            params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _tevm   = nvm;
            _events = events;
            InitCommandManager();

            ToolbarCommands = new ToolbarCommandsHelper(events,
                                                        null,
                                                        null)
            {
            };
        }
Beispiel #5
0
        public SidebarCommandManager(ISidebarViewModel svm, IEventAggregator events,
                                     params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _svm = svm;

            InitCommandManager();


            ToolbarCommands = new ToolbarCommandsHelper(events,
                                                        null,
                                                        null)
            {
            };
        }
Beispiel #6
0
        public DirectoryTreeCommandManager(IDirectoryTreeViewModel dlvm, IWindowManager windowManager,
                                           IEventAggregator events, params IExportCommandBindings[] additionalBindingExportSource)
            : base(additionalBindingExportSource)
        {
            _dlvm = dlvm;
            InitCommandManager();

            ToolbarCommands = new ToolbarCommandsHelper(events, ParameterDicConverter,
                                                        message => new[] { message.NewModel },
                                                        null)
            {
                ExtraCommandProviders = new[] {
                    new StaticCommandProvider(
                        new CommandModel(ApplicationCommands.New)
                    {
                        IsVisibleOnMenu = true
                    },
                        new CommandModel(ExplorerCommands.Refresh)
                    {
                        IsVisibleOnMenu = true
                    },
                        new CommandModel(ApplicationCommands.Delete)
                    {
                        IsVisibleOnMenu = true
                    },
                        new CommandModel(ExplorerCommands.Rename)
                    {
                        IsVisibleOnMenu = true
                    },

                        new CommandModel(ExplorerCommands.Map)
                    {
                        HeaderIconExtractor = ResourceIconExtractor <ICommandModel> .ForSymbol(0xE17B),
                        //Symbol = Convert.ToChar(0xE17B),
                        IsEnabled       = true,
                        IsHeaderVisible = false, IsVisibleOnToolbar = true
                    },

                        new CommandModel(ExplorerCommands.Unmap)
                    {
                        HeaderIconExtractor = ResourceIconExtractor <ICommandModel> .ForSymbol(0xE17A),
                        IsVisibleOnToolbar  = true, IsVisibleOnMenu = true
                    }
                        )
                }
            };
        }