Exemple #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="activationArgs">Details about the launch request and process.</param>
        protected override async void OnLaunched(LaunchActivatedEventArgs activationArgs)
        {
            CoreApp.CurrentPlatform = AppPlatform.UWP;
            base.OnLaunched(activationArgs);

            if (activationArgs.PreviousExecutionState != ApplicationExecutionState.Running)
            {
                ConfigurationManager.Initialise(PCLAppConfig.FileSystemStream.PortableStream.Current);
                ApplicationLanguages.PrimaryLanguageOverride = GlobalizationPreferences.Languages[0];
#if !DEBUG
                AppCenter.Start(ConfigurationManager.AppSettings["WindowsAppcenterSecret"], typeof(Analytics), typeof(Crashes));
#endif

                Xamarin.Forms.Forms.Init(activationArgs);
                var app = new Presentation.App();

                BackgroundTaskHelper.Register(typeof(ClearPaymentsTask), new TimeTrigger(60, false));
                BackgroundTaskHelper.Register(typeof(RecurringPaymentTask), new TimeTrigger(60, false));
                BackgroundTaskHelper.Register(typeof(LiveTiles), new TimeTrigger(15, false));

                mainView.ViewModel = Mvx.IoCProvider.Resolve <MainViewModel>();

                if (!Mvx.IoCProvider.CanResolve <Session>())
                {
                    return;
                }

                if (Mvx.IoCProvider.Resolve <Session>().ValidateSession())
                {
                    (mainView.ViewModel as MainViewModel)?.ShowAccountListCommand.ExecuteAsync();
                }
                else if (Mvx.IoCProvider.CanResolve <IMvxNavigationService>())
                {
                    await Mvx.IoCProvider
                    .Resolve <IMvxNavigationService>()
                    .Navigate <LoginViewModel>()
                    ;
                }

                ((MainViewModel)mainView.ViewModel)?.ShowAccountListCommand.ExecuteAsync();

                OverrideTitleBarColor();

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

                await CallRateReminder();
            }
        }
Exemple #2
0
 public static void Main()
 {
     Presentation.App app = new Presentation.App();
     app.InitializeComponent();
     app.Run();
 }
Exemple #3
0
 public static void Main() {
     Presentation.App app = new Presentation.App();
     app.InitializeComponent();
     app.Run();
 }
Exemple #4
0
 public static void Main()
 {
     Presentation.App app = new Presentation.App();
     app.Run();
 }