Exemplo n.º 1
0
        protected async override void OnResume()
        {
            try
            {
                AppCrossConnectivity.Init(CrossConnectivity.Current);
                UserDialogs.Instance.ShowLoading("Reconnecting, please wait...");

                if (AppCrossConnectivity.Instance.IsConnected)
                {
                    var keyValueCacheUtility = Container.Resolve <IDependencyService>().Get <IKeyValueCacheUtility>();
                    UserName = keyValueCacheUtility.GetUserDefaultsKeyValue("Username");
                    Password = keyValueCacheUtility.GetUserDefaultsKeyValue("Password");

                    if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
                    {
                        await PostFeedSpokeStatic.LogonToHubFake(UserName, Password);
                    }

                    await ShowLocalNotifications();
                }

                Container.Resolve <IDependencyService>().Get <IHelperUtility>().ResetPackageVersionNo();
            }
            catch (Exception ex)
            {
                Container.GetContainer().Resolve <IDependencyService>().Get <ILogger>().Log(ex);
            }
            finally
            {
                UserDialogs.Instance.HideLoading();
            }
        }
Exemplo n.º 2
0
        protected override void OnInitialized()
        {
            try
            {
                Xamarin.Forms.Mocks.MockForms.Init();
                CreateMocks();
                ConfigureAppWideSettings();
                ConfigureDatabaseInitilization();

                var unityContainer = Container.GetContainer();
                unityContainer.RegisterInstance <INavigationService>(NavigationService, new ContainerControlledLifetimeManager());
                AppUnityContainer.Init(unityContainer);
                AppCrossConnectivity.Init(unityContainer.Resolve <IConnectivity>());

                if (WasWelcomeInstructionsLoaded())
                {
                    NavigateToRootPage(nameof(WikiPage), Container.Resolve <INavigationStackService>(), NavigationService);
                }
                else
                {
                    NavigateToRootPage(nameof(WelcomeInstructionsPage), Container.Resolve <INavigationStackService>(), NavigationService);
                }

                AllowAppPermissions();
            }
            catch (Exception ex)
            {
            }
        }
Exemplo n.º 3
0
        protected override async void OnInitialized()
        {
            try
            {
                InitializeComponent();
                InitFakeData();
                ConfigureAppWideSettings();
                ConfigureDatabaseInitilization();

                var unityContainer = Container.GetContainer();
                unityContainer.RegisterInstance <INavigationService>(NavigationService, new ContainerControlledLifetimeManager());
                AppCrossConnectivity.Init(unityContainer.Resolve <IConnectivity>());
                AppUnityContainer.Init(unityContainer);

                if (WasSignedUpAndLogon())
                {
                    await NavigateToRootPage(nameof(MainTabbedPage) + AddPagesInTab(), unityContainer.Resolve <INavigationStackService>(), NavigationService);
                }
                else
                {
                    await NavigateToRootPage(nameof(LogonPage), unityContainer.Resolve <INavigationStackService>(), NavigationService);
                }

                AllowAppPermissions();
            }
            catch (Exception ex)
            {
                AppUnityContainer.Instance.Resolve <IDependencyService>().Get <ILogger>().Log(ex);
            }
        }
Exemplo n.º 4
0
        protected override void OnInitialized()
        {
            InitializeComponent();
            InitFakeData();
            ConfigureAppWideSettings();
            ConfigureDatabaseInitilization();

            var unityContainer = Container.GetContainer();

            unityContainer.RegisterInstance <INavigationService>(NavigationService, new ContainerControlledLifetimeManager());
            AppUnityContainer.Init(unityContainer);
            AppCrossConnectivity.Init(CrossConnectivity.Current);

            if (WasWelcomeInstructionsLoaded())
            {
                NavigateToRootPage(nameof(WikiPage), Container.Resolve <INavigationStackService>(), NavigationService);
            }
            else
            {
                NavigateToRootPage(nameof(WelcomeInstructionsPage), Container.Resolve <INavigationStackService>(), NavigationService);
            }

            AllowAppPermissions();
        }