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); }
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; }
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); }
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); }
protected virtual IMvxViewModelLoader CreateViewModelLoader(IMvxViewModelLocatorCollection collection) { return(new MvxViewModelLoader(collection)); }
protected override IMvxNavigationService InitializeNavigationService(IMvxViewModelLocatorCollection collection) => navigationService = base.InitializeNavigationService(collection);
public MvxViewModelLoader(IMvxViewModelLocatorCollection locatorCollection) { LocatorCollection = locatorCollection; }