public ApplicationController(CompositionContainer container, IPresentationService presentationService, IMessageService messageService, ShellService shellService, ProxyController proxyController, DataController dataController) { InitializeCultures(); presentationService.InitializeCultures(); this.container = container; this.dataController = dataController; this.proxyController = proxyController; this.messageService = messageService; this.dataService = container.GetExportedValue<IDataService>(); this.floatingViewModel = container.GetExportedValue<FloatingViewModel>(); this.mainViewModel = container.GetExportedValue<MainViewModel>(); this.userBugsViewModel = container.GetExportedValue<UserBugsViewModel>(); this.teamBugsViewModel = container.GetExportedValue<TeamBugsViewModel>(); shellService.MainView = mainViewModel.View; shellService.UserBugsView = userBugsViewModel.View; shellService.TeamBugsView = teamBugsViewModel.View; this.floatingViewModel.Closing += FloatingViewModelClosing; this.showMainWindowCommand = new DelegateCommand(ShowMainWindowCommandExcute); this.englishCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("en-US"))); this.chineseCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("zh-CN"))); this.settingCommand = new DelegateCommand(SettingDialogCommandExcute, CanSettingDialogCommandExcute); this.aboutCommand = new DelegateCommand(AboutDialogCommandExcute); this.exitCommand = new DelegateCommand(ExitCommandExcute); }
public ApplicationController(CompositionContainer container, IPresentationService presentationService, IMessageService messageService, ShellService shellService, ProxyController proxyController, DataController dataController) { InitializeCultures(); presentationService.InitializeCultures(); this.container = container; this.dataController = dataController; this.proxyController = proxyController; this.messageService = messageService; this.dataService = container.GetExportedValue <IDataService>(); this.floatingViewModel = container.GetExportedValue <FloatingViewModel>(); this.mainViewModel = container.GetExportedValue <MainViewModel>(); this.userBugsViewModel = container.GetExportedValue <UserBugsViewModel>(); this.teamBugsViewModel = container.GetExportedValue <TeamBugsViewModel>(); shellService.MainView = mainViewModel.View; shellService.UserBugsView = userBugsViewModel.View; shellService.TeamBugsView = teamBugsViewModel.View; this.floatingViewModel.Closing += FloatingViewModelClosing; this.showMainWindowCommand = new DelegateCommand(ShowMainWindowCommandExcute); this.englishCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("en-US"))); this.chineseCommand = new DelegateCommand(() => SelectLanguage(new CultureInfo("zh-CN"))); this.settingCommand = new DelegateCommand(SettingDialogCommandExcute, CanSettingDialogCommandExcute); this.aboutCommand = new DelegateCommand(AboutDialogCommandExcute); this.exitCommand = new DelegateCommand(ExitCommandExcute); }
public void GenaralTeamBugsViewModelTest() { ITeamBugsView view = Container.GetExportedValue <ITeamBugsView>(); IDataService dataService = Container.GetExportedValue <IDataService>(); TeamBugsViewModel viewModel = new TeamBugsViewModel(view, dataService); Assert.AreEqual(0, viewModel.Bugs.Count); dataService.TeamBugs.Add( new Bug() { ID = 5, Title = "Bug5", Description = "Description for Bug5.", Type = BugType.Red, AssignedTo = "BigEgg", State = "Implement", ChangedDate = new DateTime(2013, 4, 11), CreatedBy = "Pupil", Priority = "High", Severity = "High" } ); Assert.AreEqual(1, viewModel.Bugs.Count); }
public void GenaralTeamBugsViewModelTest() { ITeamBugsView view = Container.GetExportedValue<ITeamBugsView>(); IDataService dataService = Container.GetExportedValue<IDataService>(); TeamBugsViewModel viewModel = new TeamBugsViewModel(view, dataService); Assert.AreEqual(0, viewModel.Bugs.Count); dataService.TeamBugs.Add( new Bug() { ID = 5, Title = "Bug5", Description = "Description for Bug5.", Type = BugType.Red, AssignedTo = "BigEgg", State = "Implement", ChangedDate = new DateTime(2013, 4, 11), CreatedBy = "Pupil", Priority = "High", Severity = "High" } ); Assert.AreEqual(1, viewModel.Bugs.Count); }