Example #1
0
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
#if !DEBUG
            MobileCenter.Start("1fba816a-eea6-42a8-bf46-0c0fcc1589db", typeof(Analytics), typeof(Crashes));
#endif
            if (e.PreviousExecutionState != ApplicationExecutionState.Running)
            {
                var mainView = new MainView {
                    Language = ApplicationLanguages.Languages[0]
                };

                Window.Current.Content = mainView;
                ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];

                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                var setup = new Setup(mainView.MainFrame);
                setup.Initialize();

                var start = Mvx.Resolve <IMvxAppStart>();
                start.Start();

                BackgroundTaskHelper.Register(typeof(ClearPaymentsTask), new TimeTrigger(60, false));
                BackgroundTaskHelper.Register(typeof(RecurringPaymentTask), new TimeTrigger(60, false));
                Mvx.Resolve <IBackgroundTaskManager>().StartBackupSyncTask(60);

                mainView.ViewModel = Mvx.Resolve <MenuViewModel>();

                OverrideTitleBarColor();

                //If Jump Lists are supported, add them
                if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
                {
                    await SetJumplist();
                }

                await CallRateReminder();
            }

            //OverrideTitleBarColor();

            // Ensure the current window is active
            Window.Current.Activate();
        }
Example #2
0
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            var shell = Window.Current.Content as AppShell;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (shell == null)
            {
                //TODO: check if this can be removed with the neutral language set.
                // Create a AppShell to act as the navigation context and navigate to the first page
                shell = new AppShell {
                    Language = ApplicationLanguages.Languages[0]
                };

                shell.MyAppFrame.NavigationFailed += OnNavigationFailed;
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;
            ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];

            if (shell.MyAppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                var setup = new Setup(shell.MyAppFrame);
                setup.Initialize();

                var start = Mvx.Resolve <IMvxAppStart>();
                start.Start();

                shell.ViewModel = Mvx.Resolve <MenuViewModel>();
            }

            new TileHelper().DoNavigation(string.IsNullOrEmpty(e.Arguments)
                ? e.TileId
                : e.Arguments);

            OverrideTitleBarColor();

            //If Jump Lists are supported, adds them§a
            if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
            {
                SetJumplist();
            }

            CallRateReminder();

            // Ensure the current window is active
            Window.Current.Activate();

            var settings           = ApplicationData.Current.LocalSettings;
            var clearPaymentResult = settings.Values["CLEAR_PAYMENT"]?.ToString();

            if (!string.IsNullOrEmpty(clearPaymentResult) && clearPaymentResult == "true")
            {
                await new DialogService().ShowMessage("Task Executed", "Clear PaymentViewModel");
            }

            var recPaymentResult = settings.Values["RECURRING_PAYMENT"]?.ToString();

            if (!string.IsNullOrEmpty(recPaymentResult) && recPaymentResult == "true")
            {
                await new DialogService().ShowMessage("Task Executed", "RecPayment");
            }

            var syncBackupResult = settings.Values["SYNC_BACKUP"]?.ToString();

            if (!string.IsNullOrEmpty(syncBackupResult) && syncBackupResult == "true")
            {
                await new DialogService().ShowMessage("Task Executed", "Sync Backup");
            }
        }
Example #3
0
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            ApplicationDataContainer localSettings = ApplicationData.Current.LocalSettings;
            StorageFolder            localFolder   = ApplicationData.Current.LocalFolder;
            var shell = Window.Current.Content as AppShell;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active

            //Two objects to store language preferences loaded from app data.
            object bool_check = localSettings.Values["LangBool"];
            object value      = localSettings.Values["ChosenLang"];

            if (shell == null)
            {
                //TODO: check if this can be removed with the neutral language set.
                // Create a AppShell to act as the navigation context and navigate to the first page
                if (Convert.ToBoolean(bool_check) == false)
                {
                    shell = new AppShell {
                        Language = ApplicationLanguages.Languages[0]
                    };



                    shell.MyAppFrame.NavigationFailed += OnNavigationFailed;

                    //Create an object of the DefaultLanguageSetter class.
                    DefaultLanguageSetter.LanguageSetter DLS = new DefaultLanguageSetter.LanguageSetter();

                    //Depending on the Langage of the machine, the default language index for the combo box is set.
                    if (shell.Language.Contains("de"))
                    {
                        DLS.setIndex(0);
                    }
                    if (shell.Language.Contains("de"))
                    {
                        DLS.setIndex(1);
                    }
                    if (shell.Language.Contains("es"))
                    {
                        DLS.setIndex(2);
                    }
                    if (shell.Language.Contains("pt"))
                    {
                        DLS.setIndex(3);
                    }
                    if (shell.Language.Contains("ru"))
                    {
                        DLS.setIndex(4);
                    }
                    if (shell.Language.Contains("cn"))
                    {
                        DLS.setIndex(5);
                    }
                }
                else
                {
                    shell = new AppShell {
                        Language = Convert.ToString(value)
                    };
                }
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;
            if (Convert.ToBoolean(bool_check) == false)
            {
                ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];
            }
            else
            {
                ApplicationLanguages.PrimaryLanguageOverride = Convert.ToString(value);
            }

            if (shell.MyAppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                var setup = new Setup(shell.MyAppFrame);
                setup.Initialize();

                var start = Mvx.Resolve <IMvxAppStart>();
                start.Start();

                shell.ViewModel = Mvx.Resolve <MenuViewModel>();
            }

            new TileHelper().DoNavigation(string.IsNullOrEmpty(e.Arguments)
                ? e.TileId
                : e.Arguments);

            OverrideTitleBarColor();

            //If Jump Lists are supported, adds them§a
            if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
            {
                SetJumplist();
            }

            CallRateReminder();

            // Ensure the current window is active
            Window.Current.Activate();
        }
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            var shell = Window.Current.Content as AppShell;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (shell == null)
            {
                // Create a AppShell to act as the navigation context and navigate to the first page
                shell = new AppShell {
                    Language = ApplicationLanguages.Languages[0]
                };

                shell.AppMyFrame.NavigationFailed += OnNavigationFailed;
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;
            ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];

            if (shell.AppMyFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                var setup = new Setup(shell.AppMyFrame);
                setup.Initialize();

                var start = Mvx.Resolve <IMvxAppStart>();
                start.Start();
            }

            if (Mvx.Resolve <Session>().ValidateSession())
            {
                shell.SetLoggedInView();
                shell.AppMyFrame.Navigate(typeof(MainView));
            }
            else
            {
                shell.SetLoginView();
                shell.AppMyFrame.Navigate(typeof(LoginView));
            }

            new TileHelper().DoNavigation(string.IsNullOrEmpty(e.Arguments)
                ? e.TileId
                : e.Arguments);

            await new BackgroundTaskService().RegisterTasksAsync();

            OverrideTitleBarColor();

            //If Jump Lists are supported, adds them
            if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
            {
                SetJumplist();
            }

            CallRateReminder();

            // Ensure the current window is active
            Window.Current.Activate();
        }
Example #5
0
        /// <summary>
        ///     Invoked when the application is launched normally by the end user.  Other entry points
        ///     will be used such as when the application is launched to open a specific file.
        /// </summary>
        /// <param name="e">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs e)
        {
            var shell = Window.Current.Content as AppShell;

            // Do not repeat app initialization when the Window already has content,
            // just ensure that the window is active
            if (shell == null)
            {
                // Create a AppShell to act as the navigation context and navigate to the first page
                shell = new AppShell {Language = ApplicationLanguages.Languages[0]};

                shell.MyAppFrame.NavigationFailed += OnNavigationFailed;
            }

            // Place our app shell in the current Window
            Window.Current.Content = shell;
            ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];

            if (shell.MyAppFrame.Content == null)
            {
                // When the navigation stack isn't restored, navigate to the first page
                // suppressing the initial entrance animation.
                var setup = new Setup(shell.MyAppFrame);
                setup.Initialize();

                var start = Mvx.Resolve<IMvxAppStart>();
                start.Start();

                shell.ViewModel = Mvx.Resolve<MenuViewModel>();
            }

            new TileHelper().DoNavigation(string.IsNullOrEmpty(e.Arguments)
                ? e.TileId
                : e.Arguments);

            await new BackgroundTaskService().RegisterTasksAsync();

            OverrideTitleBarColor();

            //If Jump Lists are supported, adds them
            if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.JumpList"))
            {
                SetJumplist();
            }

            CallRateReminder();

            // Ensure the current window is active
            Window.Current.Activate();
        }