void lookup(object sender, EventArgs e) { if (CheckNetwork()) { Trip.Line = dataProvider.GetLineClassFromName(spinnerLine.SelectedItem.ToString()); Trip.From = dataProvider.GetStationClassFromName(spinnerStationFrom.SelectedItem.ToString()); Trip.To = dataProvider.GetStationClassFromName(spinnerStationTo.SelectedItem.ToString()); DataGetter dataGetter = new DataGetter(); RunOnUiThread(delegate { StartActivity(typeof(TimetableList)); }); } }
private void lookup(object sender, EventArgs e) { if (NetworkInterface.GetIsNetworkAvailable()) { Trip.Line = (LineClass)lineListPicker.SelectedItem; Trip.From = (StationClass)stationFromListPicker.SelectedItem; Trip.To = (StationClass)stationToListPicker.SelectedItem; String direction = Trip.From.Rank > Trip.To.Rank ? "Inbound" : "Outbound"; DataGetter dataGetter = new DataGetter(); NavigationService.Navigate(new Uri("/TimetableList.xaml", UriKind.RelativeOrAbsolute)); } else { ToastPrompt toast = new ToastPrompt(); toast.Title = "No Network Detected"; toast.Message = "A network connection is required to \rdownload the train timetable."; toast.TextOrientation = System.Windows.Controls.Orientation.Vertical; toast.MillisecondsUntilHidden = 3000; toast.Show(); } }