Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
 private void OnError()
 {
     NavigationService.Navigate(MainAndFilterPage.GetUri(this, removeBackEntry: true));
 }
Exemplo n.º 4
0
 private void OnHomeClick(object sender, EventArgs e)
 {
     ErrorReporting.Log("OnHomeClick");
     NavigationService.Navigate(MainAndFilterPage.GetUri(this));
 }
Exemplo n.º 5
0
 private void OnFilterByAnotherDestinationClick(object sender, EventArgs e)
 {
     ErrorReporting.Log("OnFilterByAnotherDestinationClick");
     NavigationService.Navigate(MainAndFilterPage.GetUri(this, departuresAndArrivalsTable.Station, departuresAndArrivalsTable.CallingAt.Value));
 }