public void Initialize() { _container.Resolve<IRegionManager>().RegisterViewWithRegion("GameRegion", () => { GameViewModel gameViewModel = new GameViewModel(_container); GameView gameView = new GameView() { DataContext = gameViewModel }; return gameView; }); }
private GameViewModel GetGameViewModel() { IUnityContainer container = new UnityContainer(); Mock<IGroupDefinitionService> groupDefinitionServiceMock = new Mock<IGroupDefinitionService>(); groupDefinitionServiceMock.Setup(gds => gds.GetGroups(It.IsAny<int>(), It.IsAny<int>())) .Returns(GetGroups()); container.RegisterInstance(groupDefinitionServiceMock.Object); GameViewModel viewModel = new GameViewModel(container); return viewModel; }