public void Run(IBackgroundTaskInstance taskInstance)
        {
            var deferral = taskInstance.GetDeferral();

            try
            {
                var dbManager = new DatabaseManager(new WindowsSqliteConnectionFactory(),
                    new MvxWindowsCommonFileStore());

                paymentRepository = new PaymentRepository(dbManager);

                paymentManager = new PaymentManager(paymentRepository,
                    new AccountRepository(dbManager),
                    new RecurringPaymentRepository(dbManager),
                    null);

                ClearPayments();

                // We have to access the settings object here directly without the settings helper since this thread is executed independently.
                if (new WindowsCommonSettings().GetValue(SHOW_CASH_FLOW_ON_MAIN_TILE_KEYNAME, true))
                {
                    UpdateMainTile();
                }
            }
            finally
            {
                deferral.Complete();
            }
        }
        private void CheckRecurringPayments()
        {
            var dbManager = new DatabaseManager(new DroidSqliteConnectionFactory(), new MvxAndroidFileStore());

            var paymentRepository = new PaymentRepository(dbManager);

            var paymentManager = new PaymentManager(paymentRepository,
                new AccountRepository(dbManager),
                new RecurringPaymentRepository(dbManager),
                null);

            new RecurringPaymentManager(paymentManager, paymentRepository, new SettingsManager(new Settings())).CheckRecurringPayments();
        }
        public void ClearPayments()
        {
            var dbManager = new DatabaseManager(new DroidSqliteConnectionFactory(), new MvxAndroidFileStore());

            var paymentRepository = new PaymentRepository(dbManager);

            var paymentManager = new PaymentManager(paymentRepository,
                new AccountRepository(dbManager),
                new RecurringPaymentRepository(dbManager),
                null);

            paymentManager.ClearPayments();
        }
        private async void SyncBackups()
        {
            var dbManager = new DatabaseManager(new DroidSqliteConnectionFactory(), new MvxAndroidFileStore());

            var settings = new SettingsManager(new Settings());

            var backupManager = new BackupManager(new OneDriveService(new MvxAndroidFileStore(), new OneDriveAuthenticator()), 
                new MvxAndroidFileStore(), 
                dbManager, settings, 
                new PaymentRepository(dbManager),
                new Connectivity());

            await backupManager.DownloadBackup();
        }
        public async void Run(IBackgroundTaskInstance taskInstance)
        {
            var deferral = taskInstance.GetDeferral();

            try
            {
                var dbManager = new DatabaseManager(new WindowsSqliteConnectionFactory(),
                    new MvxWindowsCommonFileStore());

                var settingsManager = new SettingsManager(new WindowsCommonSettings());

                var backupManager = new BackupManager(new OneDriveService(new MvxWindowsCommonFileStore(), new OneDriveAuthenticator()),
                        new MvxWindowsCommonFileStore(), 
                        dbManager, settingsManager,
                        new PaymentRepository(dbManager),
                        new Connectivity());

                await backupManager.DownloadBackup();
            }
            finally
            {
                deferral.Complete();
            }
        }