public LibraryView(ITagCache tags, IPathsCache paths, IBinariesCache binaries, Dispatcher dispatcher, ILibraryOperations libraryOps, IErrorHandler errorHandler, IFileValidator fileValidator, IEventAggregator eventAggregator) { _tags = tags; _paths = paths; _binariesCache = binaries; _dispatcher = dispatcher; _eventAggregator = eventAggregator; _sourceNodes = new ObservableCollection <LibraryViewNode>(); _nodeViewer = new PropertyOrderedObservableCollectionViewer <LibraryViewNode>(_dispatcher); _nodeViewer.SetMediator(this); _nodeViewer.Attach(_sourceNodes); _nodeViewer.OrderBy(f => f.Name, new [] { "Name" }, false); _eventAggregator.AddListener(this, _dispatcher); LoadedBinariesCache = new LoadedBinaryCache(100, binaries); Operations = new LibraryContentOperations(libraryOps, this, errorHandler, fileValidator, _dispatcher, _eventAggregator); _dispatcher.BeginInvoke(new Action(PerformLoad)); }
protected LibraryViewNode(Dispatcher dispatcher, IEventAggregator eventAggregator) { EventAggregator = eventAggregator; _children = new ObservableCollection <LibraryViewNode>(); _childViewer = new PropertyOrderedObservableCollectionViewer <LibraryViewNode>(dispatcher); _childViewer.SetMediator(this); _childViewer.Attach(_children); _childViewer.OrderBy(c => c.Name, new [] { "Name" }, false); _editLabelCommand = new SimpleCommand <object> { ExecuteDelegate = PerformEditLabel }; _finishEditLabelCommand = new SimpleCommand <object> { ExecuteDelegate = o => EndEditLabel(true) }; _cancelEditLabelCommand = new SimpleCommand <object> { ExecuteDelegate = o => EndEditLabel(false) }; _removeNodeCommand = new SimpleCommand <object> { ExecuteDelegate = PerformRemoveNode }; _newFolderCommand = new BlockableCommand <object>(true, PerformNewFolder); }