Пример #1
0
 public void Initialize()
 {
     _container.Resolve<IRegionManager>().RegisterViewWithRegion("GameRegion", () =>
         {
             GameViewModel gameViewModel = new GameViewModel(_container);
             GameView gameView = new GameView() { DataContext = gameViewModel };
             return gameView;
         });
 }
Пример #2
0
        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;
        }