Ejemplo 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>());
 }
Ejemplo 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>();
        }
Ejemplo n.º 3
0
        protected override IMvxApplication CreateApp()
        {
            Mvx.ConstructAndRegisterSingleton <INetworkService, NetworkService>();
            Mvx.RegisterType <ITimerService, TimerService>();
            Mvx.ConstructAndRegisterSingleton <IGLOSAWiFiService, GLOSAWiFiService>();

            return(new Core.App());
        }
Ejemplo n.º 4
0
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

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

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

            RegisterAppStart(appStart);
        }
Ejemplo 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;
        }
Ejemplo 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>();
 }
Ejemplo n.º 8
0
        public override void Initialize()
        {
            CreatableTypes().EndingWith("Service").AsInterfaces().RegisterAsLazySingleton();

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

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

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

            RegisterAppStart(appStart);
        }
Ejemplo 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>();
        }
Ejemplo n.º 11
0
        protected override void InitializeLastChance()
        {
            base.InitializeLastChance();

            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, GeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <IGeoCoderService, CachedGeoCoderService>();
            Mvx.ConstructAndRegisterSingleton <IShareService, ShareService>();
            Mvx.Resolve <ILocationService>().StartWatching();
        }
Ejemplo 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));
        }
Ejemplo n.º 13
0
        public override void Initialize()
        {
            base.Initialize();

            Mvx.ConstructAndRegisterSingleton <IMvxAppStart, MvxAppExtendedStart>();

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

            RegisterCustomAppStart <MvxAppExtendedStart>();
        }
Ejemplo 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);
        }
Ejemplo 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();
        }
Ejemplo 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>();
 }
Ejemplo n.º 17
0
        public override void Initialize()
        {
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.ConstructAndRegisterSingleton <ISquareRtCalculator, SquareRtCalculator>();

            RegisterNavigationServiceAppStart <ViewModels.SquareRtViewModel>();
        }
Ejemplo 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>();
        }
Ejemplo 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);
        }
Ejemplo n.º 20
0
        public override void Initialize()
        {
            Mvx.ConstructAndRegisterSingleton <IMyHealthClient, MyHealthClient> ();
            Mvx.RegisterType <ICurrentUserService, CurrentUserService>();

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

            RegisterAppStart(new AppStart());
        }
Ejemplo 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);
            }));
        }
Ejemplo n.º 22
0
        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();
        }
Ejemplo 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));
        }
Ejemplo 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>();
 }
Ejemplo n.º 25
0
        public override void Initialize()
        {
            CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

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

            RegisterAppStart <ViewModels.SplashViewModel>();
        }
Ejemplo 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());
        }
Ejemplo 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>();
        }
Ejemplo 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>();
        }
Ejemplo 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());
        }
Ejemplo 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);
        }