Esempio n. 1
0
 public async override void Initialize()
 {
     RegisterAppStart <HomeViewModel>();
     Mvx.RegisterType(typeof(IHttpClient), typeof(HttpClientImpl));
     Mvx.ConstructAndRegisterSingleton <IServicesManager, ServicesManager>();
     await TMDbApiConfig.InitializeAsync(Mvx.Resolve <IHttpClient>());
 }
Esempio n. 2
0
        public override void Initialize()
        {
#pragma warning disable CS0618 // Type or member is obsolete
            Mvx.ConstructAndRegisterSingleton <IApis, Apis>();
#pragma warning restore CS0618 // Type or member is obsolete

            RegisterAppStart <HomeViewModel>();
        }
Esempio n. 3
0
        protected override IMvxApplication CreateApp()
        {
            Mvx.ConstructAndRegisterSingleton <INetworkService, NetworkService>();
            Mvx.RegisterType <ITimerService, TimerService>();
            Mvx.ConstructAndRegisterSingleton <IGLOSAWiFiService, GLOSAWiFiService>();

            return(new Core.App());
        }
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, GeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, CachedGeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <ILocationTrackerService, LocationTrackerService>();
        }
Esempio n. 5
0
        public override void Initialize()
        {
            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, AppStart>();

            var appStart = Mvx.Resolve <IMvxAppStart>();

            RegisterAppStart(appStart);
        }
Esempio n. 6
0
        protected override void InitializeIoC()
        {
            base.InitializeIoC();

            Mvx.ConstructAndRegisterSingleton <IConfigService, ConfigService>();
            Mvx.ConstructAndRegisterSingleton <IConfigManager, ConfigManager>();
            // Setting the device as android
            Mvx.Resolve <IConfigManager>().Device = Device.ANDROID;
        }
Esempio n. 7
0
 protected override void InitializeLastChance()
 {
     base.InitializeLastChance();
     MvvmCross.Plugins.File.PluginLoader.Instance.EnsureLoaded();
     MvvmCross.Plugins.DownloadCache.PluginLoader.Instance.EnsureLoaded();
     Acr.Settings.Settings.InitRoaming(ApplicationContext.PackageName);
     Mvx.GetSingleton <IMvxTargetBindingFactoryRegistry>().RegisterCustomBindingFactory <TextView>("BBCode", view => new BBCodeBinding(view));
     Mvx.ConstructAndRegisterSingleton <IMvxLocalFileImageLoader <Bitmap>, VectorFileImageLoader>();
 }
Esempio n. 8
0
        public override void Initialize()
        {
            CreatableTypes().EndingWith("Service").AsInterfaces().RegisterAsLazySingleton();

            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, AppStart>();
            var appStart = Mvx.Resolve <IMvxAppStart>();

            RegisterAppStart(appStart);
        }
Esempio n. 9
0
        public override void Initialize()
        {
            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, AppStart>();
            Mvx.RegisterSingleton <IMvxFormsPageLoader>(new MvxFormsViewLoader());

            var appStart = Mvx.Resolve <IMvxAppStart>();

            RegisterAppStart(appStart);
        }
Esempio n. 10
0
        protected override void InitializePlatformServices()
        {
            base.InitializePlatformServices();

            Mvx.RegisterSingleton <IDreamsLogService>(() => new DreamsLogService(_applicationContext));
            Mvx.Resolve <IDreamsLogService>(); // Trigger creation of singleton

            Mvx.ConstructAndRegisterSingleton <IDialogService, DialogService>();
        }
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, GeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, CachedGeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <IShareService, ShareService>();
            Mvx.Resolve <ILocationService>().StartWatching();
        }
Esempio n. 12
0
        protected override IMvxApplication CreateApp()
        {
            Mvx.ConstructAndRegisterSingleton <IMvxJsonConverter, JsonSerializer>();
            var preferencesManager       = new PreferencesManager();
            var storageContainer         = new LocalStorageContainer();
            var keyStorage               = new LocalKeyStorageContainer(storageContainer);
            var deviceInformationService = new DeviceInformationService();

            return(new Client.Shared.App(keyStorage, storageContainer, preferencesManager, deviceInformationService));
        }
Esempio n. 13
0
        public override void Initialize()
        {
            base.Initialize();

            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, MvxAppExtendedStart>();

            Mvx.RegisterSingleton <IMvxTextProvider>(new MvxResxTextProvider(AppResources.ResourceManager));

            RegisterCustomAppStart <MvxAppExtendedStart>();
        }
Esempio n. 14
0
        public override void Initialize()
        {
            base.Initialize();

            //Register extended app startup in IoC container:
            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, CustomStart>();
            var appStart = Mvx.Resolve <IMvxAppStart>();

            RegisterAppStart(appStart);
        }
Esempio n. 15
0
        /// <summary>
        /// Initializes the first chance.
        /// </summary>
        protected override void InitializeFirstChance()
        {
            Mvx.ConstructAndRegisterSingleton <IApplicationConfigurationService, AndroidConfigurationService>();

            Mvx.ConstructAndRegisterSingleton <IUserInteraction, UserInteraction>();
            Mvx.ConstructAndRegisterSingleton <ISettings, MvxAndroidSettings>();

            Mvx.ConstructAndRegisterSingleton <IPlatformCapabilities, AndroidPlatformCapabilities>();

            base.InitializeFirstChance();
        }
Esempio n. 16
0
 public MvxApp()
 {
     Mvx.RegisterType <IDispatcherUtility>(() => new DispatcherUtility(() => App.Current.CurrentActivity));
     Mvx.RegisterType <ICredentialUtility, CredentialUtility>();
     Mvx.RegisterType <ISettingsUtility>(
         () => new SettingsUtility(PreferenceManager.GetDefaultSharedPreferences(App.Current)));
     Mvx.RegisterType <IStorageUtility, StorageUtility>();
     Mvx.ConstructAndRegisterSingleton <IApplicationUtility, ApplicationUtility>();
     Mvx.RegisterSingleton <IMvxAppStart>(new MvxAppStart <MainViewModel>());
     Mvx.RegisterType <IFindierService, FindierService>();
 }
Esempio n. 17
0
        public override void Initialize()
        {
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.ConstructAndRegisterSingleton <ISquareRtCalculator, SquareRtCalculator>();

            RegisterNavigationServiceAppStart <ViewModels.SquareRtViewModel>();
        }
Esempio n. 18
0
        public static void Register()
        {
            MvxSimpleIoCContainer.Initialize();

            Mvx.ConstructAndRegisterSingleton <IUserDialogService, UserDialogService>();
            Mvx.ConstructAndRegisterSingleton <IGitHubDataProvider, GitHubDataProvider>();
            Mvx.ConstructAndRegisterSingleton <INavigationService, NavigationService>();

            Mvx.RegisterType <IRepositoriesViewModel, RepositoriesViewModel>();
            Mvx.RegisterType <IRepositoryDetailsViewModel, RepositoryDetailsViewModel>();
        }
Esempio n. 19
0
        public override void Initialize()
        {
            base.Initialize();

            // Construct custom application start object
            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, AppStart>();
            var appStart = Mvx.Resolve <IMvxAppStart>();

            // register the appstart object
            RegisterAppStart(appStart);
        }
Esempio n. 20
0
        public override void Initialize()
        {
            Mvx.ConstructAndRegisterSingleton <IMyHealthClient, MyHealthClient> ();
            Mvx.RegisterType <ICurrentUserService, CurrentUserService>();

            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            RegisterAppStart(new AppStart());
        }
Esempio n. 21
0
        /// <summary>
        /// Ensures the platform specific version is loaded
        /// </summary>
        public void EnsureLoaded()
        {
            Mvx.CallbackWhenRegistered <IMvxFileStore>(
                () => Mvx.CallbackWhenRegistered <IMvxUserInteraction>(() =>
            {
                Mvx.ConstructAndRegisterSingleton <IFeedbackDataService, FeedbackDataService>();
                var manager = Mvx.Resolve <IMvxPluginManager>();
                manager.EnsurePlatformAdaptionLoaded <PluginLoader>();

                ((MvxFeedbackDialog)Mvx.GetSingleton <IMvxFeedbackDialog>()).SetConfiguration(_configuration);
            }));
        }
        protected override void InitializeFirstChance()
        {
            Mvx.ConstructAndRegisterSingleton <IPageService, PageService>();
            Mvx.ConstructAndRegisterSingleton <ITimerService, TimerService>();
            Mvx.ConstructAndRegisterSingleton <IDeviceService, DeviceService>();
            Mvx.ConstructAndRegisterSingleton <IPopupService, PopupService>();

            Mvx.ConstructAndRegisterSingleton <ISettings, TrackMe.Services.Settings>();
            Mvx.ConstructAndRegisterSingleton <ILocalize, Localize>();

            base.InitializeFirstChance();
        }
Esempio n. 23
0
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

            Mvx.ConstructAndRegisterSingleton <IDialogService, DialogService>();

            //IFetcherRepositoryStoragePathService path = new FetcherRepositoryStoragePathService();
            //IFetcherRepositoryService repository = new FetcherRepositoryService(path);
            //IFetcherWebService web = new FetcherWebService();

            //Mvx.LazyConstructAndRegisterSingleton<IFetcherService>(() => new FetcherService(web, repository));
        }
Esempio n. 24
0
 public App()
 {
     Mvx.RegisterSingleton(Acr.UserDialogs.UserDialogs.Instance);
     Mvx.RegisterSingleton(Plugin.FileSystem.CrossFileSystem.Current);
     Mvx.RegisterSingleton(Plugin.LocalNotifications.CrossLocalNotifications.Current);
     Mvx.RegisterSingleton(Plugin.VersionTracking.CrossVersionTracking.Current);
     Mvx.RegisterSingleton(Plugin.Settings.CrossSettings.Current);
     Mvx.ConstructAndRegisterSingleton <ICryptographyService, CryptographyService>();
     Mvx.ConstructAndRegisterSingleton <ISaveStateService, SaveStateService>();
     Mvx.LazyConstructAndRegisterSingleton <IEmulationService, EmulationService>();
     Mvx.LazyConstructAndRegisterSingleton <IMvxAppStart, AppStart>();
 }
Esempio n. 25
0
        public override void Initialize()
        {
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.RegisterSingleton <IProvider>(() => new RestProvider());
            Mvx.ConstructAndRegisterSingleton <IRepository, DataRepository>();

            RegisterAppStart <ViewModels.SplashViewModel>();
        }
Esempio n. 26
0
        public void Load()
        {
            Mvx.ConstructAndRegisterSingleton <IFetcherLoggerService, FetcherLoggerService>();
            Mvx.ConstructAndRegisterSingleton <IFetcherWebService, FetcherWebService>();
            Mvx.ConstructAndRegisterSingleton <IFetcherRepositoryStoragePathService, FetcherRepositoryStoragePathService>();
            Mvx.LazyConstructAndRegisterSingleton <IFetcherRepositoryService>(() => new FetcherRepositoryService(Mvx.Resolve <IFetcherLoggerService>(), () => CreateConnection(Mvx.Resolve <IFetcherRepositoryStoragePathService>())));
            Mvx.ConstructAndRegisterSingleton <IFetcherService, FetcherService>();

            // Ensure database tables are created
            var repository = Mvx.Resolve <IFetcherRepositoryService>() as FetcherRepositoryService;

            Task.Run(async() => await repository.Initialize());
        }
Esempio n. 27
0
        public override void Initialize()
        {
            //Registra todos os tipos cujo nome termina em Service
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.RegisterSingleton(new MyOtherService());
            Mvx.ConstructAndRegisterSingleton <IMyService, MyService>();

            RegisterAppStart <ViewModels.DependencyViewModel>();
        }
Esempio n. 28
0
        private static void Configurate()
        {
            ////здесь будет конфигурироваться DI контейнер
            MvxSimpleIoCContainer.Initialize();


            Mvx.RegisterSingleton <IOrderService>(new OrderService());
            Mvx.RegisterSingleton <IUserService>(new UserService());
            Mvx.RegisterSingleton <IOrderHubService>(new OrderHubService());

            Mvx.ConstructAndRegisterSingleton <IUserController, UserController>();
            Mvx.ConstructAndRegisterSingleton <IOrderController, OrderController>();
        }
Esempio n. 29
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        public override void Initialize()
        {
            Mvx.ConstructAndRegisterSingleton <IUserSettings, UserSettings>();

            PluginLoader.Instance.EnsureLoaded();
            Mvx.ConstructAndRegisterSingleton <IMancobaMobileDataApi, MancobaMobileDataApi>();
            Mvx.RegisterSingleton <IMobileDataService>(MobileDataService.DataServiceInstance);

            EntityMapping();
            //Navigation.SetUp ();

            RegisterAppStart(new CustomApplicationStart());
        }
Esempio n. 30
0
        public override void Initialize()
        {
            base.Initialize();

            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, AppStart>();

            Mvx.RegisterSingleton(Acr.Settings.Settings.Local);

            // request a reference to the constructed appstart object
            var appStart = Mvx.Resolve <IMvxAppStart>();

            // register the appstart object
            RegisterAppStart(appStart);
        }