Beispiel #1
0
        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.Register <MainPage>();
            serviceRegistry.Register <MainViewModel>();
            var viewLookupService = new ViewModelPageLocator(serviceRegistry);

            serviceRegistry.Register <ViewModelPageLocator>(s => viewLookupService, new PerContainerLifetime());
            serviceRegistry.Register <INavigationService, NavigationService>();
            serviceRegistry.Register <IFriendsService, FriendsService>();

            viewLookupService.Register <FriendDetailViewModel, FriendDetailPage>();
        }
Beispiel #2
0
        public void Compose(IServiceRegistry serviceRegistry)
        {
            serviceRegistry.Register <MainPage>();
            var viewModelLocator = new ViewModelPageLocator(serviceRegistry);

            serviceRegistry.Register <ViewModelPageLocator>(s => viewModelLocator, new PerContainerLifetime());
            serviceRegistry.Register <MainViewModel>();
            serviceRegistry.Register <IFriendsService, FriendsService>();
            serviceRegistry.Register <HttpClient>();
            serviceRegistry.Register <INavigationService, NavigationService>();

            //Register pages that should be navigateable
            viewModelLocator.Register <FriendDetailViewModel, FriendDetailPage>();
        }