private async void Page_Loaded(object sender, RoutedEventArgs e) { try { stations_sm = await StationsRepo.GetStations(Station.Directions.SM); MyListView_sm.ItemsSource = stations_sm; stations_ms = await StationsRepo.GetStations(Station.Directions.MS); MyListView_ms.ItemsSource = stations_ms; MyListView_ms.SelectedIndex = Fav_ms; MyListView_ms.ScrollIntoView(MyListView_ms.Items[Fav_ms]); MyListView_sm.SelectedIndex = Fav_sm; MyListView_sm.ScrollIntoView(MyListView_sm.Items[Fav_sm]); if (MyPivot.SelectedIndex == 0) { StationName.Text = stations_sm[Fav_sm].NameAR; } else { StationName.Text = stations_ms[Fav_ms].NameAR; } MainPage.OnSearchBoxTextChanged += MainPage_OnSearchBoxTextChanged; } catch (Exception) { } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { MiddleArea.Opacity = 0; MyProgressRing.IsActive = true; try { stations_sm = await StationsRepo.GetStations(Station.Directions.SM); MyListView_sm.ItemsSource = stations_sm; stations_ms = await StationsRepo.GetStations(Station.Directions.MS); MyListView_ms.ItemsSource = stations_ms; SelectedStation = stations_sm[Fav_sm]; MyListView_sm.SelectedIndex = Fav_sm; MyListView_sm.ScrollIntoView(MyListView_sm.Items[Fav_sm]); AvailableTimesOfStation = await GetAvailableTimesOfStation(MyPivot.SelectedIndex == 0?Station.Directions.SM : Station.Directions.MS, SelectedStation.Id); UpdateInformation(); MainPage.OnSearchBoxTextChanged += MainPage_OnSearchBoxTextChanged; } catch (Exception) { } timer.Start(); MiddleArea.Opacity = 1; MyProgressRing.IsActive = false; }
private async void Page_Loaded(object sender, RoutedEventArgs e) { try { stations_sm = await StationsRepo.GetStations(Models.Station.Directions.SM); MyListView_sm.ItemsSource = stations_sm; stations_ms = await StationsRepo.GetStations(Models.Station.Directions.MS); MyListView_ms.ItemsSource = stations_ms; MainPage.OnSearchBoxTextChanged += MainPage_OnSearchBoxTextChanged; } catch (Exception) { } }
private async void Page_Loaded(object sender, RoutedEventArgs e) { Stations = await StationsRepo.GetStations(Station.Directions.SM); MyListView_sm.ItemsSource = Stations; MyListView_sm.SelectedIndex = 0; station = Stations.First(); MainPage.OnSearchBoxTextChanged += MainPage_OnSearchBoxTextChanged; InitMap(); MyMap.Center = new Geopoint(new BasicGeoposition() { Latitude = 35.670235, Longitude = 10.882897 }); MyMap.ZoomLevel = 10; }