private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            ChangeTextInInfoStackPanel(InfoStackPanelTextIndex.App_Run, "Uruchamianie aplikacji... OK");

            SetActionFrame();
            MainFrameHelper.SetMainFrame(this.Frame);
        }
        private void ShowBusStopPage(Line line, Track track, Schedule schedule)
        {
            Model.LinesPage.ChangeBusStopParametr pageBusStopParametr = new Model.LinesPage.ChangeBusStopParametr()
            {
                BusStop  = track.BusStops.First(p => p.IdOfName == _LastClickedBusStop.Id),
                Track    = track,
                Line     = line,
                Schedule = schedule
            };

            MainFrameHelper.GetMainFrame().Navigate(typeof(Pages.Lines.LineBusStopPage), pageBusStopParametr);
        }
        private static void RemoveLineBusStopPageStackFromFrame()
        {
            Frame mainAppFrame = MainFrameHelper.GetMainFrame();

            mainAppFrame.BackStack.ToList().ForEach(p =>
            {
                if (p.SourcePageType == typeof(Pages.Lines.LineBusStopPage))
                {
                    mainAppFrame.BackStack.Remove(p);
                }
            });
        }
        public static void BackButtonPressed(object sender, BackRequestedEventArgs e)
        {
            Frame mainAppFrame = MainFrameHelper.GetMainFrame();

            if (IsGoBackFromPageAllowed(mainAppFrame))
            {
                mainAppFrame.GoBack();
                e.Handled = true;
                return;
            }

            e.Handled = false;
            //App.Current.Exit();
        }
        private void BusStopsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var selectedItem = BusStopsComboBox.SelectedItem as LineViewBusStop;

            if (selectedItem == null || selectedItem.BusStop.Id == _SelectedBusStop.Id)
            {
                return;
            }

            MainFrameHelper.GetMainFrame().Navigate(typeof(LineBusStopPage), new ChangeBusStopParametr()
            {
                BusStop  = selectedItem.BusStop,
                Track    = _SelectedTrack,
                Line     = _SelectedLine,
                Schedule = _SelectedSchedule
            });
        }
        private void BusStopsListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (BusStopsListView.SelectedIndex == -1 || BusStopsListView.SelectedItem == null)
            {
                return;
            }

            BusStopName selectedBusStop = ((ListView)sender).SelectedItem as BusStopName;

            MainFrameHelper.GetMainFrame().Navigate(typeof(Pages.BusStops.BusStopsListPage),
                                                    new Model.BusStopListPage.ChangeBusStopParametr()
            {
                BusStopName = selectedBusStop
            });

            BusStopsListView.SelectedIndex = -1;
        }
        private async void BusStopGoToBusStopPageButton_ClickAsync(object sender, RoutedEventArgs e)
        {
            Button button = sender as Button;

            if (!button.IsEnabled)
            {
                return;
            }

            button.IsEnabled = false;
            await Task.Delay(250);

            BusStopName selectedBusStopName = Timetable.Instance.BusStopsNames.First(p => p.Id == _SelectedBusStop.IdOfName);

            MainFrameHelper.GetMainFrame().Navigate(typeof(Pages.BusStops.BusStopsListPage),
                                                    new Model.BusStopListPage.ChangeBusStopParametr()
            {
                BusStopName = selectedBusStopName
            });

            button.IsEnabled = true;
        }
示例#8
0
        private async void ButtonClicked(object sender, SelectionChangedEventArgs e)
        {
            var clickedButton = ButtonListGridView.SelectedItem as MainMenuButton;

            if (clickedButton == null)
            {
                return;
            }

            ResetButtonSelected();
            await Task.Delay(250);

            Frame frame = MainFrameHelper.GetMainFrame();

            switch (clickedButton.Type)
            {
            case MainMenuButton.ButtonType.Lines:
                frame.Navigate(typeof(Pages.Lines.LinesListPage));
                break;

            case MainMenuButton.ButtonType.Stops:
                frame.Navigate(typeof(Pages.BusStops.BusStopsListPage));
                break;

            case MainMenuButton.ButtonType.Favourites:
                frame.Navigate(typeof(Pages.Favourites.FavouritePage));
                break;

            case MainMenuButton.ButtonType.Communicates:
                frame.Navigate(typeof(Pages.RSS.CommunicatesPage));
                break;

            default:
                break;
            }
        }
示例#9
0
        private static async Task ShowLinePageAsync(ChangeLineParameter changeLineParameter)
        {
            await Task.Delay(250);

            MainFrameHelper.GetMainFrame().Navigate(typeof(LinePage), changeLineParameter);
        }
 private void ShowMainMenu()
 => MainFrameHelper.GetMainFrame().Navigate(typeof(MainMenu));