Ejemplo n.º 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="traveLogStore">ITravelLogStore for providing travel logs.</param>
        /// <param name="pageService">IPageService for providing page navigation.</param>
        public MainPageViewModel(ITravelLogStore traveLogStore, IPageService pageService)
        {
            _travelLogStore = traveLogStore;
            _pageService    = pageService;

            LoadTravelLogs(_travelLogStore);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Load list of travel logs.
        /// </summary>
        /// <param name="traveLogStore">ITravelLogStore used to retrieve travel logs.</param>
        public async void LoadTravelLogs(ITravelLogStore traveLogStore)
        {
            if (_isDataLoaded)
            {
                return;
            }

            _isDataLoaded = true;

            var logs = await traveLogStore.GetTravelLogs();

            foreach (TravelLog log in logs)
            {
                TravelLogs.Add(log);
            }
        }