public MainActivity() { var navigationService = new AppCompatNavigationService(); navigationService.Configure(ViewModelLocator.NewCounterPageKey, typeof(NewCounterActivity)); navigationService.Configure(ViewModelLocator.EditCounterPageKey, typeof(EditCounterActivity)); ViewModelLocator.RegisterNavigationService(navigationService); ViewModelLocator.RegisterDialogService(new AppCompatDialogService()); }
public MainActivity() { var navigationService = new AppCompatNavigationService(); navigationService.Configure(ViewModelLocator.CloseCartKey, typeof(CloseCartActivity)); ViewModelLocator.RegisterNavigationService(navigationService); ViewModelLocator.RegisterDialogService(new AppCompatDialogService()); }
/// <summary> /// Creates and configures a NavigationService. /// </summary> /// <returns>The navigation service.</returns> private INavigationService CreateNavigationService() { var navigationService = new AppCompatNavigationService(); navigationService.Configure(ViewNames.Room, typeof(RoomActivity)); navigationService.Configure(ViewNames.Messages, typeof(MessagesActivity)); navigationService.Configure(ViewNames.Settings, typeof(SettingsActivity)); navigationService.Configure(ViewNames.SystemVariable, typeof(SystemVariableActivity)); navigationService.Configure(ViewNames.Program, typeof(ProgramActivity)); navigationService.Configure(ViewNames.About, typeof(AboutActivity)); return navigationService; }
/// <summary> /// Creates and configures a NavigationService. /// </summary> /// <returns>The navigation service.</returns> private INavigationService CreateNavigationService() { var navigationService = new AppCompatNavigationService(); navigationService.Configure(ViewNames.Room, typeof(RoomActivity)); navigationService.Configure(ViewNames.Messages, typeof(MessagesActivity)); navigationService.Configure(ViewNames.Settings, typeof(SettingsActivity)); navigationService.Configure(ViewNames.SystemVariable, typeof(SystemVariableActivity)); navigationService.Configure(ViewNames.Program, typeof(ProgramActivity)); navigationService.Configure(ViewNames.About, typeof(AboutActivity)); return(navigationService); }
protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //Initialize the dispatcher and navigation service. DispatcherHelper.Initialize(); var nav = new AppCompatNavigationService(); SimpleIoc.Default.Register <INavigationService>(() => nav); nav.Configure(ViewModelLocator.DetailPageKey, typeof(DetailDeal)); SetContentView(Resource.Layout.Main); var toolbar = FindViewById <Toolbar>(Resource.Id.main_toolbar); toolbar.SetBackgroundColor(Color.ParseColor("#d50000")); SetSupportActionBar(toolbar); // Get our RecyclerView layout: mRecyclerView = FindViewById <RecyclerView>(Resource.Id.recyclerView); //var fab = FindViewById<FloatingActionButton>(Resource.Id.fab); //fab.AttachToRecyclerView(mRecyclerView); // Use the built-in linear layout manager: mLayoutManager = new LinearLayoutManager(this); mRecyclerView.SetLayoutManager(mLayoutManager); // Adapter Setup: mAdapter = new DealAdapter(); // Plug the adapter into the RecyclerView: mRecyclerView.SetAdapter(mAdapter); }
void Init() { if (!IsInitialized) { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); var nav = new AppCompatNavigationService(); nav.Configure(ScreenName.LandingPage, typeof(LandingPageActivity)); nav.Configure(ScreenName.MainPage, typeof(MainPageActivity)); nav.Configure(ScreenName.FilterLocationScreen, typeof(SearchActivity)); nav.Configure(ScreenName.AboutScreen, typeof(AboutActivity)); SimpleIoc.Default.Register <INavigationService>(() => nav); Run(); } }
void Init () { if (!IsInitialized) { ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); var nav = new AppCompatNavigationService(); nav.Configure(ScreenName.LandingPage, typeof(LandingPageActivity)); nav.Configure(ScreenName.MainPage, typeof(MainPageActivity)); nav.Configure(ScreenName.FilterLocationScreen, typeof(SearchActivity)); nav.Configure(ScreenName.AboutScreen, typeof(AboutActivity)); SimpleIoc.Default.Register<INavigationService>(() => nav); Run(); } }
protected override void Load(ContainerBuilder builder) { var nav = new AppCompatNavigationService(); nav.Configure(Constants.Pages.CategoryDetailsKey, typeof(CategoryActivity)); nav.Configure(Constants.Pages.MainKey, typeof(MainActivity)); nav.Configure(Constants.Pages.SubcategoryDetailsKey, typeof(SubcategoryActivity)); nav.Configure(Constants.Pages.CourseDetailsKey, typeof(CourseActivity)); nav.Configure(Constants.Pages.SessionKey, typeof(SessionActivity)); builder.RegisterInstance(nav).AsImplementedInterfaces().AsSelf().SingleInstance(); Type[] types = { typeof(AppCompatDialogService), typeof(LocalizationProvider), typeof(DispatcherHelper) }; builder.RegisterTypes(types).AsImplementedInterfaces(); builder.RegisterType <AuthenticationService>().AsImplementedInterfaces().SingleInstance(); }
private void InitDependances() { // Navigation services Log.Debug("SplashActivity", "InitDependances : Initializing AppCompatNavigationService..."); var nav = new AppCompatNavigationService(); nav.Configure(App.LOGIN_PAGE, typeof(LoginActivity)); nav.Configure(App.NEED_UPDATE_PAGE, typeof(NeedUpdateActivity)); nav.Configure(App.CGU_PAGE, typeof(CGUActivity)); nav.Configure(App.LIST_SEEKIOS_PAGE, typeof(ListSeekiosActivity)); nav.Configure(App.DETAIL_SEEKIOS_PAGE, typeof(DetailSeekiosActivity)); nav.Configure(App.MAP_PAGE, typeof(MapActivity)); nav.Configure(App.MAP_HISTORIC_PAGE, typeof(MapHistoricActivity)); nav.Configure(App.MODE_ZONE_PAGE, typeof(ModeZoneActivity)); nav.Configure(App.MODE_ZONE_2_PAGE, typeof(ModeZone3Activity)); nav.Configure(App.MODE_ZONE_3_PAGE, typeof(ModeZone2Activity)); nav.Configure(App.MODE_DONT_MOVE_PAGE, typeof(ModeDontMove2Activity)); nav.Configure(App.MODE_DONT_MOVE_2_PAGE, typeof(ModeDontMoveActivity)); nav.Configure(App.MODE_TRACKING_PAGE, typeof(ModeTrackingActivity)); nav.Configure(App.ALERT_PAGE, typeof(AlertActivity)); nav.Configure(App.ALERT_SOS_PAGE, typeof(AlertSOSActivity)); nav.Configure(App.PARAMETER_PAGE, typeof(ParameterActivity)); nav.Configure(App.ABOUT_PAGE, typeof(AboutActivity)); nav.Configure(App.ADD_SEEKIOS_PAGE, typeof(AddSeekiosActivity)); //nav.Configure(App.MAP_ALL_SEEKIOS_PAGE, typeof(MapAllSeekiosActivity)); nav.Configure(App.RELOAD_CREDIT_PAGE, typeof(ReloadCreditActivity)); nav.Configure(App.TRANSACTION_HISTORIC_PAGE, typeof(TransactionHistoricActivity)); nav.Configure(App.LIST_TUTORIAL_PAGE, typeof(ListTutorialActivity)); nav.Configure(App.TUTORIAL_PAGE, typeof(TutorialFirstLaunchActivity)); nav.Configure(App.TUTORIAL_BACKGROUND_FIRST_LAUNCH_PAGE, typeof(TutorialBackgroundActivity)); nav.Configure(App.TUTORIAL_CREDITCOST_PAGE, typeof(TutorialCreditCostActivity)); nav.Configure(App.TUTORIAL_POWERSAVING_PAGE, typeof(TutorialPowerSavingActivity)); // Registration of services Log.Debug("SplashActivity", "InitDependances : Initializing SimpleIoc..."); SimpleIoc.Default.Reset(); ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default); SimpleIoc.Default.Register <INavigationService>(() => nav, true); SimpleIoc.Default.Register <Interfaces.IDialogService, AppCompatDialogService>(true); SimpleIoc.Default.Register <ISaveDataService, SaveDataService>(); SimpleIoc.Default.Register <IDispatchOnUIThread, DispatchService>(true); SimpleIoc.Default.Register <IInternetConnectionService, InternetConnectionService>(true); SimpleIoc.Default.Register <ITimer, TimerWrapper>(); SimpleIoc.Default.Register <ILocalNotificationService, LocalNotificationService>(); ViewModel.ViewModelLocator.Initialize(); (ServiceLocator.Current.GetInstance <IDispatchOnUIThread>() as DispatchService).SetContext(this); (ServiceLocator.Current.GetInstance <IInternetConnectionService>() as InternetConnectionService).Initialize(this, ConnectivityService); // Instantiation of the data service var SaveDataService = ServiceLocator.Current.GetInstance <ISaveDataService>(); SaveDataService.Init(ApplicationContext); // Initialization of the internet connection service var InternetConnectionService = ServiceLocator.Current.GetInstance <IInternetConnectionService>(); InternetConnectionService.Initialize(ApplicationContext, ConnectivityService); Log.Debug("SplashActivity", "InitDependances : Starting CloseGestureService..."); StartService(new Intent(this, typeof(CloseGestureService))); // Check if notification are enabled if (!Android.Support.V4.App.NotificationManagerCompat.From(this).AreNotificationsEnabled()) { App.Locator.ListSeekios.IsNotificationAvailable = false; } }