private void InitializeProjetWrappers(int projectId) { var projectWorkspace = _projectRepository.GetProjectWorkspacesForProject(projectId); foreach (var wrapper in ProjectWorkspace) { wrapper.PropertyChanged -= ProjectWorkspaceWrapper_PropertyChanged; } ProjectWorkspace.Clear(); foreach (var item in projectWorkspace) { var wrapper = new ProjectWorkspaceWrapper(item); ProjectWorkspace.Add(wrapper); wrapper.PropertyChanged += ProjectWorkspaceWrapper_PropertyChanged; } }
private void SavePathInProject(string selectedPath) { var existingWorkspacesForProject = _projectRepository.GetProjectWorkspacesForProject(Project.Id); if (existingWorkspacesForProject.Where(p => p.WorkspacePath == selectedPath).Count() == 0) { var newWorkspace = new ProjectWorkspaceWrapper(new ProjectWorkspace()); newWorkspace.WorkspacePath = selectedPath; Project.Model.ProjectWorkspaces.Add(newWorkspace.Model); //TODO - Integrate with whole model validations OnSaveExecute(); ProjectWorkspace.Add(newWorkspace); } else { //TODO: Implement info for user, that path already exists } }