async void ShowDetail(LunchLocation ev) { var eventDetails = new LunchLocationDetailsPage(); eventDetails.Location = ev; App.Logger.TrackPage(AppPage.LunchLocation.ToString(), ev.Name); await NavigationService.PushAsync(Navigation, eventDetails); }
async void ShowDetail(LunchLocation ev) { var result = await this.DisplayActionSheet(ev.Name, "Cancel", null, "View Website", "Open Maps"); //var addr = ev.Address.Replace("\n", " ").Replace(" ", "+").Replace(",", string.Empty); var q = HttpUtility.UrlEncode($"{ev.Name} Stevens Point, WI"); if (result == "Cancel") { return; } Uri uri; if (result == "View Website") { uri = new Uri(ev.Website); } else if (Xamarin.Forms.Device.RuntimePlatform == Device.iOS) { // launch address w/ walking directions uri = new Uri($"http://maps.apple.com/?q={q}"); } else if (Xamarin.Forms.Device.RuntimePlatform == Device.Android) { uri = new Uri($"geo:0,0?q={q}"); } else { return; } Xamarin.Forms.Device.OpenUri(uri); }
public LunchLocationsDetailViewModel(INavigation navigation, LunchLocation item) : base(navigation) { _location = item; }