private void ShowDepartures(Station[] allStations, Station fromStation, string from, string to, bool actSilently) { var toStationCandidates = allStations.Where(x => MainAndFilterPage.Filter(to, fromStation, null, x)).ToArray(); var toStation = toStationCandidates.Length == 1 ? toStationCandidates[0] : null; if (fromStation != null) { if (toStation != null) { var target = DeparturesAndArrivalsTable.Create(fromStation, toStation); NavigationService.Navigate(StationPage.GetUri(this, target, removeBackEntry: true)); return; } else { if (string.IsNullOrEmpty(to)) { var target = DeparturesAndArrivalsTable.Create(fromStation); NavigationService.Navigate(StationPage.GetUri(this, target)); } else { NavigationService.Navigate(MainAndFilterPage.GetUri(this, fromStation, initialFilter: to, removeBackEntry: true)); } return; } } else { NavigationService.Navigate(MainAndFilterPage.GetUri(this, null, initialFilter: from, removeBackEntry: true)); } }
private void OnFilterOrClearFilterClick(object sender, EventArgs e) { ErrorReporting.Log("OnFilterOrClearFilterClick"); if (departuresAndArrivalsTable.HasDestinationFilter) { NavigationService.Navigate(GetUri(departuresAndArrivalsTable.WithoutFilter)); } else { NavigationService.Navigate(MainAndFilterPage.GetUri(this, departuresAndArrivalsTable.Station)); } }
private void OnError() { NavigationService.Navigate(MainAndFilterPage.GetUri(this, removeBackEntry: true)); }
private void OnHomeClick(object sender, EventArgs e) { ErrorReporting.Log("OnHomeClick"); NavigationService.Navigate(MainAndFilterPage.GetUri(this)); }
private void OnFilterByAnotherDestinationClick(object sender, EventArgs e) { ErrorReporting.Log("OnFilterByAnotherDestinationClick"); NavigationService.Navigate(MainAndFilterPage.GetUri(this, departuresAndArrivalsTable.Station, departuresAndArrivalsTable.CallingAt.Value)); }