private MainViewModel PrepareMainViewModel(ClientStorage clientStorage, ProjectStorage projectStorage)
 {
     var clientListViewModel = new ClientListViewModel(clientStorage);
     var projectListViewModel = new ProjectListViewModel(projectStorage);
     var mainViewModel = new MainViewModel(clientListViewModel, projectListViewModel);
     return mainViewModel;
 }
 public void Start(MainWindow window)
 {
     var dataManager = new DataManager();
     var clientStorage = new ClientStorage();
     var projectStorage = new ProjectStorage();
     LoadDefaultData(dataManager, clientStorage, projectStorage);
     window.DataContext = PrepareMainViewModel(clientStorage, projectStorage);
     window.Show();
 }
 public void LoadDefaultProjects(ProjectStorage projectStorage)
 {
     projectStorage.AddProject(new Project {
         ClientName = "Enbridge",
         Name = "iOS QDR",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "В работе"),
         EndDate = "30.11.15"
     });
     projectStorage.AddProject(new Project {
         ClientName = "Enbridge",
         Name = "iOS CDR",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "Согласование договора"),
         EndDate = "30.12.15"
     });
     projectStorage.AddProject(new Project {
         ClientName = "Enbridge",
         Name = "Punch List",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "Переговоры")
     });
     projectStorage.AddProject(new Project {
         ClientName = "DODO",
         Name = "Dodo IS",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "В работе")
     });
     projectStorage.AddProject(new Project {
         ClientName = "Avicom",
         Name = "PJM",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "В работе")
     });
     projectStorage.AddProject(new Project {
         ClientName = "Павел",
         Name = "Kinect",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "Переговоры")
     });
     projectStorage.AddProject(new Project {
         ClientName = "Дмитрий",
         Name = "Android-Касса",
         Status = AvaliableProjectStatus.GetAvaliableStatusList().Single(_ => _ == "Первичный контакт")
     });
 }
 public void SetUp()
 {
     projectStorage = new ProjectStorage();
 }
 private void LoadDefaultData(DataManager dataManager, ClientStorage clientStorage, ProjectStorage projectStorage)
 {
     dataManager.LoadDefaultClients(clientStorage);
     dataManager.LoadDefaultProjects(projectStorage);
 }
 public ProjectListViewModel(ProjectStorage projectStorage)
 {
     this.projectStorage = projectStorage;
     NewProject = new NewProjectViewModel(this);
     ShowNewProjectControl = new Command(OnShowNewProjectControl);
 }