예제 #1
0
        public MoneyBoxesViewModel(INavigationService navigationService,
            IEntityBaseService<MoneyBox> moneyBoxesService,
            IEntityBaseService<ReportingPeriod> reportingPeriodService,
            IPlatformEvents platformEvents,
            IDataInitService dataInitService)
        {
            _navigationService = navigationService;
            _moneyBoxesService = moneyBoxesService;
            _reportingPeriodService = reportingPeriodService;
            _platformEvents = platformEvents;
            _dataInitService = dataInitService;
            _navigationData = new Dictionary<string, object>();

            _platformEvents.BackButtonPressed += BackButtonPressed;

            _dataInitService.CheckReportingPeriods();
        }
예제 #2
0
        /// <summary>
        /// Initializes the singleton application object.  This is the first line of authored code
        /// executed, and as such is the logical equivalent of main() or WinMain().
        /// </summary>
        public App()
        {
            this.InitializeComponent();
            this.Suspending += this.OnSuspending;

            databaseName = "FinanceManager.sqlite";
            databasePath = Path.Combine(ApplicationData.Current.LocalFolder.Path, databaseName);
            platform = new SQLitePlatformWinRT();
            container = UnityConfig.Container;

            if (!DatabaseExists(databaseName).Result)
            {
                _dataInitService = container.Resolve<IDataInitService>();
                _dataInitService.Initialize();
            }

            _currencyRateService = container.Resolve<ICurrencyRatesService>();

            _dataInitService = container.Resolve<IDataInitService>();
            _dataInitService.CheckReportingPeriods();

            _currencyRateService.UpdateExchangeRates();
        }