Пример #1
0
        public ExplorerViewModel(IWindowManager windowManager, IEventAggregator events)
        {
            _events        = events;
            _rootModels    = new IEntryModel[] { };
            _windowManager = windowManager;
            _initializer   = NullExplorerInitializer.Instance;

            WindowTitleMask = "{0}";
            DisplayName     = "";
            //Toolbar = new ToolbarViewModel(events);
            Breadcrumb    = new BreadcrumbViewModel(_internalEvents);
            Statusbar     = new StatusbarViewModel(_internalEvents);
            Sidebar       = new SidebarViewModel(_internalEvents);
            FileList      = new FileListViewModel(_windowManager, _internalEvents, Sidebar);
            DirectoryTree = new DirectoryTreeViewModel(_windowManager, _internalEvents);
            Navigation    = new NavigationViewModel(_internalEvents);

            DragHelper = NullSupportDrag.Instance;
            DropHelper = NullSupportDrop.Instance;

            Commands = new ExplorerCommandManager(this, FileList, DirectoryTree, Navigation, Breadcrumb);
            //setRootModels(_rootModels);

            if (_events != null)
            {
                _events.Subscribe(this);
            }
            _internalEvents.Subscribe(this);
        }
Пример #2
0
 public FileListDragHelper(FileListViewModel flvm)
     : base(
         () => flvm.Selection.SelectedItems.ToList(),
         ems => ems.First().Profile.DragDrop.QueryDrag(ems),
         ems => ems.First().Profile.DragDrop.GetDataObject(ems),
         (ems, da, eff) => ems.First().Profile.DragDrop.OnDragCompleted(ems, da, eff)
         , d => (d as IEntryViewModel).EntryModel)
 {
 }
Пример #3
0
            public FileListDropHelper(FileListViewModel flvm)
                : base(

                    new LambdaValueConverter <IEntryViewModel, IEntryModel>(
                        (evm) => evm.EntryModel,
                        (em) => EntryViewModel.FromEntryModel(em)),

                    new LambdaValueConverter <IEnumerable <IEntryModel>, IDataObject>(
                        ems => flvm.CurrentDirectory.Profile.DragDrop.GetDataObject(ems),
                        da => flvm.CurrentDirectory.Profile.DragDrop.GetEntryModels(da)),

                    (ems, eff) => flvm.CurrentDirectory.Profile.DragDrop.QueryDrop(ems, flvm.CurrentDirectory, eff),
                    (ems, da, eff) => flvm.CurrentDirectory.Profile.DragDrop.OnDropCompleted(ems, da, flvm.CurrentDirectory, eff))
            {
                _flvm = flvm;
            }