Пример #1
0
        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;
        }
Пример #2
0
        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)
            {
            }
        }
Пример #3
0
        private async void MyPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (stations_sm?.Count > 0 && stations_ms?.Count > 0)
            {
                switch (MyPivot.SelectedIndex)
                {
                case 0:
                    MyListView_sm.ItemsSource   = stations_sm;
                    MyListView_sm.SelectedIndex = Fav_sm;
                    SelectedStation             = stations_sm[Fav_sm];
                    MyListView_sm.ScrollIntoView(MyListView_sm.Items[Fav_sm]);
                    AvailableTimesOfStation = await GetAvailableTimesOfStation(Station.Directions.SM, SelectedStation.Id);

                    break;

                case 1:
                    MyListView_ms.ItemsSource   = stations_ms;
                    MyListView_ms.SelectedIndex = Fav_ms;
                    SelectedStation             = stations_ms[Fav_ms];
                    MyListView_ms.ScrollIntoView(MyListView_ms.Items[Fav_ms]);
                    AvailableTimesOfStation = await GetAvailableTimesOfStation(Station.Directions.MS, SelectedStation.Id);

                    break;

                default: break;
                }
                UpdateInformation();
            }
        }
Пример #4
0
        private void MyPivot_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                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;
                }
            }
            catch
            {
            }
        }