Пример #1
0
        protected virtual IMvxNavigationService InitializeNavigationService(IMvxViewModelLocatorCollection collection)
        {
            var loader = CreateViewModelLoader(collection);

            Mvx.RegisterSingleton <IMvxViewModelLoader>(loader);
            var navigationService = new MvxNavigationService(null, loader);

            Mvx.RegisterSingleton <IMvxNavigationService>(navigationService);
            return(navigationService);
        }
Пример #2
0
        public override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            var vmRequest = new MvxViewModelRequest <TViewModel>(null, null);

            _locatorCollection = _locatorCollection ?? Mvx.Resolve <IMvxViewModelLocatorCollection>();
            var vm = (new MvxViewModelLoader(_locatorCollection)).LoadViewModel(vmRequest, null);

            this.ViewModel  = (TViewModel)vm;
            CurrentActivity = (BaseHomeView)Activity;
            CurrentView     = null;
        }
Пример #3
0
        protected override IMvxNavigationService InitializeNavigationService(IMvxViewModelLocatorCollection collection)
        {
            analyticsService = new AnalyticsService();

            var loader = CreateViewModelLoader(collection);

            Mvx.RegisterSingleton <IMvxViewModelLoader>(loader);

            navigationService = new TrackingNavigationService(null, loader, analyticsService);

            Mvx.RegisterSingleton <IMvxNavigationService>(navigationService);
            return(navigationService);
        }
Пример #4
0
        protected override IMvxNavigationService InitializeNavigationService(IMvxViewModelLocatorCollection collection)
        {
            analyticsService = new AnalyticsService();
            platformInfo     = new PlatformInfo {
                Platform = Platform.Daneel
            };

            var loader = CreateViewModelLoader(collection);

            Mvx.RegisterSingleton <IMvxViewModelLoader>(loader);

            navigationService = new NavigationService(null, loader, analyticsService, platformInfo);

            Mvx.RegisterSingleton <IForkingNavigationService>(navigationService);
            Mvx.RegisterSingleton <IMvxNavigationService>(navigationService);
            return(navigationService);
        }
Пример #5
0
 protected virtual IMvxViewModelLoader CreateViewModelLoader(IMvxViewModelLocatorCollection collection)
 {
     return(new MvxViewModelLoader(collection));
 }
Пример #6
0
 protected override IMvxNavigationService InitializeNavigationService(IMvxViewModelLocatorCollection collection)
 => navigationService = base.InitializeNavigationService(collection);
Пример #7
0
 public MvxViewModelLoader(IMvxViewModelLocatorCollection locatorCollection)
 {
     LocatorCollection = locatorCollection;
 }