public RepositoryViewModel(TaskRepository repository, IDialogServiceFactory fileDialogServiceFactory, String filename) { if (null == repository) { throw new ArgumentNullException("repository"); } if (null == fileDialogServiceFactory) { throw new ArgumentNullException("fileDialogService"); } _dialog = fileDialogServiceFactory.CreateService(); _repository = repository; _filename = filename; _workspaces = new WorkspaceCollectionViewModel <WorkspaceViewModel>(); _tree = new WorkspaceCollectionViewModel <CollectionTreeViewModel>( _repository.Select(x => new CollectionTreeViewModel(x, _repository, _dialog))); _tree.PropertyChanged += this.OnChildCollectionPropertyChanged; _tree.RequestOpen += this.OnWorkspaceRequestOpen; _workspaces.PropertyChanged += this.OnChildCollectionPropertyChanged; _workspaces.RequestOpen += this.OnWorkspaceRequestOpen; _workspaces.RequestClose += this.OnWorkspaceRequestClose; _repository.RepositoryChanged += this.OnRepositoryChanged; this.IsSaved = true; }
public MainWindowViewModel(IDialogServiceFactory fileDialogServiceFactory) { if (null == fileDialogServiceFactory) throw new ArgumentNullException("fileDialogService"); _dialogFactory = fileDialogServiceFactory; _dialog = _dialogFactory.CreateService(); _repositories = new WorkspaceCollectionViewModel<RepositoryViewModel>(); _repositories.RequestClose += this.OnRequestClose; }
public MainWindowViewModel(IDialogServiceFactory fileDialogServiceFactory) { if (null == fileDialogServiceFactory) { throw new ArgumentNullException("fileDialogService"); } _dialogFactory = fileDialogServiceFactory; _dialog = _dialogFactory.CreateService(); _repositories = new WorkspaceCollectionViewModel <RepositoryViewModel>(); _repositories.RequestClose += this.OnRequestClose; }
public RepositoryViewModel(TaskRepository repository, IDialogServiceFactory fileDialogServiceFactory, String filename) { if (null == repository) throw new ArgumentNullException("repository"); if (null == fileDialogServiceFactory) throw new ArgumentNullException("fileDialogService"); _dialog = fileDialogServiceFactory.CreateService(); _repository = repository; _filename = filename; _workspaces = new WorkspaceCollectionViewModel<WorkspaceViewModel>(); _tree = new WorkspaceCollectionViewModel<CollectionTreeViewModel>( _repository.Select(x => new CollectionTreeViewModel(x, _repository, _dialog))); _tree.PropertyChanged += this.OnChildCollectionPropertyChanged; _tree.RequestOpen += this.OnWorkspaceRequestOpen; _workspaces.PropertyChanged += this.OnChildCollectionPropertyChanged; _workspaces.RequestOpen += this.OnWorkspaceRequestOpen; _workspaces.RequestClose += this.OnWorkspaceRequestClose; _repository.RepositoryChanged += this.OnRepositoryChanged; this.IsSaved = true; }