/// <summary> /// Prepare the JSON Format for the local file /// </summary> /// <returns>Method has no return value. Async method have to return a Label</returns> public async Task PrepareListForLocalFileAsync() { var list = new List <TreasurePin>(); foreach (var pin in _map.Pins) { var treasurePin = new TreasurePin { Label = pin.Label, Latitude = pin.Position.Latitude, Longitude = pin.Position.Longitude }; list.Add(treasurePin); } await _fileSaver.SaveContentToLocalFileAsync(list); }
private void OnAllPinsButtonClicked(object sender, EventArgs e) { var list = new List <TreasurePin>(); foreach (var pin in _map.Pins) { var treasurePin = new TreasurePin { Label = pin.Label, Latitude = pin.Position.Latitude, Longitude = pin.Position.Longitude }; list.Add(treasurePin); } Application.Current.MainPage = new NavigationPage(new AllPinsPage(list)); }