Beispiel #1
0
        private async Task <IList <TripLogEntry> > RetrieveEntries()
        {
            var data = await _dataService.ReadAllEntriesAsync();

            var hardCodedData = new List <TripLogEntry>
            {
                new TripLogEntry
                {
                    Title     = "Washington Monument",
                    Notes     = "Amazing!",
                    Rating    = 3,
                    Date      = new DateTime(2017, 2, 5),
                    Latitude  = 38.8895,
                    Longitude = -77.0352
                },
                new TripLogEntry
                {
                    Title     = "Statue of Liberty",
                    Notes     = "Inspiring!",
                    Rating    = 4,
                    Date      = new DateTime(2017, 4, 13),
                    Latitude  = 40.6892,
                    Longitude = -74.0444
                },
                new TripLogEntry
                {
                    Title     = "Golden Gate Bridge",
                    Notes     = "Foggy, but beautiful.",
                    Rating    = 5,
                    Date      = new DateTime(2017, 4, 26),
                    Latitude  = 37.8268,
                    Longitude = -122.4798
                }
            };

            return(new List <TripLogEntry>(data).Union(hardCodedData).ToList());
        }
        public override async void Init()
        {
            LogEntries = new ObservableCollection <TripLogEntry>(
                await _tripLogDataService.ReadAllEntriesAsync());

            var item1 = new TripLogEntry
            {
                Title     = "Washington Monument",
                Notes     = "Amazing!",
                Rating    = 3,
                Date      = new DateTime(2017, 2, 5),
                Latitude  = 38.8895,
                Longitude = -77.0352
            };
            var item2 = new TripLogEntry
            {
                Title     = "Statue of Liberty",
                Notes     = "Inspiring!",
                Rating    = 4,
                Date      = new DateTime(2017, 4, 13),
                Latitude  = 40.6892,
                Longitude = -74.0444
            };
            var item3 = new TripLogEntry
            {
                Title     = "Golden Gate Bridge",
                Notes     = "Foggy, but beautiful.",
                Rating    = 5,
                Date      = new DateTime(2017, 4, 26),
                Latitude  = 37.8268,
                Longitude = -122.4798
            };

            LogEntries.Add(item1);
            LogEntries.Add(item2);
            LogEntries.Add(item3);
        }