예제 #1
0
파일: MainViewModel.cs 프로젝트: Corne/VOC
        public MainViewModel(UserViewModel userViewModel)
        {
            if (userViewModel == null)
                throw new ArgumentNullException(nameof(userViewModel));

            User = userViewModel;
        }
예제 #2
0
        public NavigationServiceTest()
        {

            var builder = new ContainerBuilder();
            var user = new UserViewModel(new Mock<IUser>().Object);
            builder.RegisterInstance(new MainViewModel(user));

            builder.RegisterType<NavigationService>().AsSelf().As<INavigationService>();

            builder.RegisterType<DummyClass>().AsSelf().Keyed<IContentViewModel>(Keys.Value1);
            builder.RegisterType<TestClass>().AsSelf().Keyed<IContentViewModel>(Keys.Value2);

            builder.RegisterType<ContentScope>();

            container = builder.Build();

            main = container.Resolve<MainViewModel>();
        }