public PanelFleetAirliner(FleetAirliner airliner)
        {
            this.Airliner = airliner;

            WrapPanel buttonsPanel = new WrapPanel();

            ucSelectButton sbFacilities = new ucSelectButton();
            sbFacilities.Content = Translator.GetInstance().GetString("PanelFleetAirliner","200");
            sbFacilities.IsSelected = this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger;
            sbFacilities.Click += new System.Windows.RoutedEventHandler(sbFacilities_Click);
            sbFacilities.Visibility = this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            buttonsPanel.Children.Add(sbFacilities);

            ucSelectButton sbRoute = new ucSelectButton();
            sbRoute.Content = Translator.GetInstance().GetString("PanelFleetAirliner","201");
            sbRoute.IsSelected = this.Airliner.Airliner.Type.TypeAirliner != AirlinerType.TypeOfAirliner.Passenger;
            sbRoute.Click += new System.Windows.RoutedEventHandler(sbRoute_Click);
            buttonsPanel.Children.Add(sbRoute);

            ucSelectButton sbTimeSlot = new ucSelectButton();
            sbTimeSlot.Content  = Translator.GetInstance().GetString("PanelFleetAirliner","202");
            sbTimeSlot.Visibility = System.Windows.Visibility.Collapsed;
            sbTimeSlot.Click += new System.Windows.RoutedEventHandler(sbTimeSlot_Click);
            buttonsPanel.Children.Add(sbTimeSlot);

            ucSelectButton sbStatistics = new ucSelectButton();
            sbStatistics.Content  = Translator.GetInstance().GetString("PanelFleetAirliner","203");
            sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
            buttonsPanel.Children.Add(sbStatistics);

            ucSelectButton sbMaintenance = new ucSelectButton();
            sbMaintenance.Content = Translator.GetInstance().GetString("PanelFleetAirliner","205");
            sbMaintenance.Visibility = this.Airliner.Airliner.Airline.IsHuman ? Visibility.Visible : System.Windows.Visibility.Collapsed;
            sbMaintenance.Click +=sbMaintenance_Click;
            buttonsPanel.Children.Add(sbMaintenance);

            ucSelectButton sbInsurance = new ucSelectButton();
            sbInsurance.Content = Translator.GetInstance().GetString("PanelFleetAirliner", "204");
            sbInsurance.Visibility = this.Airliner.Airliner.Airline.IsHuman ? Visibility.Visible : Visibility.Collapsed;
            sbInsurance.Click+=sbInsurance_Click;
            buttonsPanel.Children.Add(sbInsurance);

             this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;

            if (this.Airliner.Airliner.Type.TypeAirliner == AirlinerType.TypeOfAirliner.Passenger)
                frameContent.Navigate(new PageFleetFacilities(this.Airliner));
            else
                frameContent.Navigate(new PageFleetRoute(this.Airliner));

            this.Children.Add(frameContent);
        }
Example #2
0
 public MainWindow()
 {
     InitializeComponent();
     var uneFrame = new Frame();
     MainGrid.Children.Add(uneFrame);
     uneFrame.Navigate(new PageSwitcher());
 }
Example #3
0
        public PanelAirlines()
        {
            WrapPanel buttonsPanel = new WrapPanel();

            // chs, 2011-18-10 added for different views / statistics for airlines
            ucSelectButton sbFlights = new ucSelectButton();
            sbFlights.Uid = "1001";
            sbFlights.Content = Translator.GetInstance().GetString("PanelAirlines", sbFlights.Uid);
            sbFlights.IsSelected = true;
            sbFlights.Click += new System.Windows.RoutedEventHandler(sbFlights_Click);
            buttonsPanel.Children.Add(sbFlights);

            ucSelectButton sbFinancial = new ucSelectButton();
            sbFinancial.Uid = "1002";
            sbFinancial.Content = Translator.GetInstance().GetString("PanelAirlines", sbFinancial.Uid);
            sbFinancial.Click += new System.Windows.RoutedEventHandler(sbFinancial_Click);
             buttonsPanel.Children.Add(sbFinancial);

            ucSelectButton sbFleet = new ucSelectButton();
            sbFleet.Uid = "1003";
            sbFleet.Content = Translator.GetInstance().GetString("PanelAirlines", sbFleet.Uid);
            sbFleet.Click += new System.Windows.RoutedEventHandler(sbFleet_Click);
            buttonsPanel.Children.Add(sbFleet);

            this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameContent.Navigate(new PageAirlinesStatistics());

            this.Children.Add(frameContent);
        }
        public PanelAirports(PageAirports parent)
        {
            this.ParentPage = parent;

            WrapPanel buttonsPanel = new WrapPanel();

            ucSelectButton sbSearch = new ucSelectButton();
            sbSearch.Uid = "201";
            sbSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbSearch.Uid);
            sbSearch.IsSelected = true;
            sbSearch.Click += new System.Windows.RoutedEventHandler(sbSearch_Click);
            buttonsPanel.Children.Add(sbSearch);

            ucSelectButton sbExtendedSearch = new ucSelectButton();
            sbExtendedSearch.Uid = "203";
            sbExtendedSearch.Content = Translator.GetInstance().GetString("PanelAirports", sbExtendedSearch.Uid);
            sbExtendedSearch.Click += new System.Windows.RoutedEventHandler(sbExtendedSearch_Click);
            buttonsPanel.Children.Add(sbExtendedSearch);

            ucSelectButton sbStatistics = new ucSelectButton();
            sbStatistics.Uid = "202";
            sbStatistics.Content = Translator.GetInstance().GetString("PanelAirports", sbStatistics.Uid);
            sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
            buttonsPanel.Children.Add(sbStatistics);

            this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameContent.Navigate(new PageSearchAirports(this.ParentPage));

            this.Children.Add(frameContent);
        }
Example #5
0
        private async Task OpenExpensesListDialog(ExpenseCategory cat, DateTime?date)
        {
            selectedCategory = cat;
            selectedDate     = date;
            var listPage = new ListPage(cat, date);

            listPage.HideTitleAndLabels();
            var listFrame = new Frame();

            listFrame.Navigate(listPage);
            var dialog = new ContentDialog
            {
                Title             = "Lista wydatków",
                PrimaryButtonText = "Ok",
                Content           = listFrame
            };

            listPageElement = listPage;
            dialog.Closed  += (sender, args) =>
            {
                FillTable();
                listPageElement = null;
            };
            var result = await dialog.ShowAsync();
        }
        private void AddCommandBinding_OnExecuted(object sender, ExecutedRoutedEventArgs e)
        {
            DateTime?           date           = DateTime.Today;
            ExpenseCategory     category       = null;
            FrameworkElement    objectToShowAt = PagesList;
            FlyoutPlacementMode placement      = FlyoutPlacementMode.Right;

            // new expense flyout
            var listFrame = new Frame();
            var flyout    = new Flyout
            {
                Content   = listFrame,
                ShowMode  = FlyoutShowMode.Standard,
                Placement = placement
            };

            flyout.Closed += (s, o) => RefreshPage();

            switch (PagesList.SelectedIndex)
            {
            case 1:      // table view
                var listPageInTablePage = (ListPage)((TablePage)RootFrame.Content).Table.listPageElement;
                if (listPageInTablePage != null)
                {
                    date = listPageInTablePage.ExpensesDatePicker.SelectedDate;
                    if (date == null)
                    {
                        date = DateTime.Today;
                    }
                    category       = (ExpenseCategory)listPageInTablePage.CategoriesComboBox.SelectedItem;
                    objectToShowAt = listPageInTablePage;

                    flyout.Closed += (s, o) => listPageInTablePage.FillPage();
                }
                else
                {
                    date = DateTime.Today;
                }

                break;

            case 2:     // list view --> new expense for selected date/category
                var listPage = (ListPage)RootFrame.Content;
                date           = listPage.ExpensesDatePicker.SelectedDate;
                category       = (ExpenseCategory)listPage.CategoriesComboBox.SelectedItem;
                objectToShowAt = listPage.AddButton;
                placement      = FlyoutPlacementMode.Bottom;
                break;
            }

            Expense expense     = null;
            var     expensePage = new ExpensePage(flyout, expense, category, date);

            listFrame.Navigate(expensePage);
            flyout.ShowAt(objectToShowAt);
        }
Example #7
0
 App()
 {
     Window mainWindow = new MainWindow();
     Frame rootFrame = new Frame();
     // Plugin
     Page page = new Page1();
     rootFrame.Navigate(page, null);
     mainWindow.Content = rootFrame;
     mainWindow.Show();
 }
Example #8
0
        public MainWindow()
        {
            InitializeComponent();

            StaticParams.ScreenWidth = System.Windows.SystemParameters.PrimaryScreenWidth;
            StaticParams.ScreenHeight = System.Windows.SystemParameters.PrimaryScreenHeight;

            Main.Width = ScreenWidth;
            Main.Height = ScreenHeight;
            MainFrame = new Frame();
            MainFrame.NavigationUIVisibility = NavigationUIVisibility.Hidden;

            Main.AddChild(MainFrame);

            MainFrame.Navigate(new LoginPage());
        }
        private void ShowCategoryFlyout(FrameworkElement objectToShowOn)
        {
            var categoryFrame = new Frame();
            var flyout        = new Flyout
            {
                Content   = categoryFrame,
                ShowMode  = FlyoutShowMode.Standard,
                Placement = FlyoutPlacementMode.Bottom
            };
            var category = objectToShowOn.GetType() == typeof(DataGridRow)
                ? ((CategoryDataItem)((DataGridRow)objectToShowOn).Item).originalCategory // DataGridRow
                : null;                                                                   // Button etc.
            var categoryPage = new CategoryPage(flyout, category);

            categoryFrame.Navigate(categoryPage);
            flyout.Closed += (sender, o) => LoadCategories();
            flyout.ShowAt(objectToShowOn);
        }
Example #10
0
        private void ShowAddExpenseFlyout(FrameworkElement objectToShowOn)
        {
            var listFrame = new Frame();
            var flyout    = new Flyout
            {
                Content   = listFrame,
                ShowMode  = FlyoutShowMode.Standard,
                Placement = FlyoutPlacementMode.Bottom
            };
            var expense = objectToShowOn.GetType() == typeof(DataGridRow)
                ? ((ExpenseDataItem)((DataGridRow)objectToShowOn).Item).originalExpense // DataGridRow
                : null;                                                                 // Button etc.
            var date        = ExpensesDatePicker.SelectedDate != null ? ExpensesDatePicker.SelectedDate : DateTime.Today;
            var expensePage = new ExpensePage(flyout, expense, (ExpenseCategory)CategoriesComboBox.SelectedItem, date);

            listFrame.Navigate(expensePage);
            flyout.Closed += (sender, o) => FillDataGridWithExpenses();
            flyout.ShowAt(objectToShowOn);
        }
        private async Task OpenBillingPeriodDialog(FrameworkElement objectToShowOn)
        {
            if (objectToShowOn == null)
            {
                return;
            }
            var period = objectToShowOn.GetType() == typeof(DataGridRow)
                ? ((BillingPeriodDataItem)((DataGridRow)objectToShowOn).Item).originalBillingPeriod // DataGridRow
                : null;                                                                             // Button etc.
            var periodFrame = new Frame();
            var dialog      = new ContentDialog
            {
                Title = "Miesiąc",
                IsPrimaryButtonEnabled = false,
                Content = periodFrame
            };
            var periodPage = new BillingPeriodPage(dialog, period);

            periodFrame.Navigate(periodPage);
            dialog.Closed += (sender, args) => FillTable();
            var result = await dialog.ShowAsync();
        }
Example #12
0
 private void GoToReadBooks(Frame BookShelfPageFrame)
 {
     BookShelfPageFrame.Navigate(new Uri("ReadBooks.xaml", UriKind.Relative));
 }
Example #13
0
 private void GoToCategories(Frame BookShelfPageFrame)
 {
     BookShelfPageFrame.Navigate(new Uri("Categoties.xaml", UriKind.Relative));
 }
Example #14
0
        public PanelAirline(Airline airline,StandardPage parent)
        {
            this.Airline = airline;
            this.PageParent = parent;

            WrapPanel buttonsPanel = new WrapPanel();

            ucSelectButton sbFleet = new ucSelectButton();
            sbFleet.Uid = "1001";
            sbFleet.Content = Translator.GetInstance().GetString("PanelAirline", sbFleet.Uid);
            sbFleet.IsSelected = true;
            sbFleet.Click += new System.Windows.RoutedEventHandler(sbFleet_Click);
            buttonsPanel.Children.Add(sbFleet);

            ucSelectButton sbDestinations = new ucSelectButton();
            sbDestinations.Uid = "1002";
            sbDestinations.Content = Translator.GetInstance().GetString("PanelAirline", sbDestinations.Uid);
            sbDestinations.Click += new System.Windows.RoutedEventHandler(sbDestinations_Click);
            buttonsPanel.Children.Add(sbDestinations);

            ucSelectButton sbPilots = new ucSelectButton();
            sbPilots.Uid = "1008";
            sbPilots.Content = Translator.GetInstance().GetString("PanelAirline", sbPilots.Uid);
            sbPilots.Click += sbPilots_Click;
            buttonsPanel.Children.Add(sbPilots);

            ucSelectButton sbStatistics = new ucSelectButton();
            sbStatistics.Uid = "1004";
            sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
            sbStatistics.Content = Translator.GetInstance().GetString("PanelAirline", sbStatistics.Uid);
            buttonsPanel.Children.Add(sbStatistics);

            ucSelectButton sbFinances = new ucSelectButton();
            sbFinances.Uid = "1005";
            sbFinances.Content = Translator.GetInstance().GetString("PanelAirline", sbFinances.Uid);
            sbFinances.Click += new System.Windows.RoutedEventHandler(sbFinances_Click);
            buttonsPanel.Children.Add(sbFinances);

            ucSelectButton sbSubsidiary = new ucSelectButton();
            sbSubsidiary.Uid = "1007";
            sbSubsidiary.Content = Translator.GetInstance().GetString("PanelAirline", sbSubsidiary.Uid);
            sbSubsidiary.Click += new System.Windows.RoutedEventHandler(sbSubsidiary_Click);
            sbSubsidiary.Visibility = this.Airline is SubsidiaryAirline ? System.Windows.Visibility.Collapsed : System.Windows.Visibility.Visible;
            buttonsPanel.Children.Add(sbSubsidiary);

            ucSelectButton sbWages = new ucSelectButton();
            sbWages.Uid = "1006";
            sbWages.Content = Translator.GetInstance().GetString("PanelAirline", sbWages.Uid);
            sbWages.Visibility = this.Airline.IsHuman ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            sbWages.Click += new System.Windows.RoutedEventHandler(sbWages_Click);
            buttonsPanel.Children.Add(sbWages);

            ucSelectButton sbInsurances = new ucSelectButton();
            sbInsurances.Uid = "1009";
            sbInsurances.Content = Translator.GetInstance().GetString("PanelAirline", sbInsurances.Uid);
            sbInsurances.Visibility = this.Airline.IsHuman ? System.Windows.Visibility.Visible : System.Windows.Visibility.Collapsed;
            sbInsurances.Click += sbInsurances_Click;
            buttonsPanel.Children.Add(sbInsurances);

            this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameContent.Navigate(new PageAirlineFleet(this.Airline));

            this.Children.Add(frameContent);
        }
Example #15
0
 private void GoToAllBooks(Frame BookShelfPageFrame)
 {
     BookShelfPageFrame.Navigate(new Uri("AllBooksStandartView.xaml", UriKind.Relative));
 }
 private void navigateInfo(Frame frame)
 {
     removeListener();
     Info info = new Info();
     _infoTab.Content = info;
     frame.Navigate(info);
     _lastPage = info;
 }
        public StandardPage()
        {
            if (GameObject.GetInstance().PagePerformanceCounterEnabled)
            {
                sw = new Stopwatch();
                sw.Start();

                this.Loaded += new RoutedEventHandler(StandardPage_Loaded);

            }

            this.Width = SystemParameters.PrimaryScreenWidth;
            this.Height = SystemParameters.PrimaryScreenHeight;

            int sideMargin = 200;
            int regularMargin = 25;
            int menuHeight = 25;
            int bottomMenuHeight = 25;

            ImageBrush imgBackground = new ImageBrush();

            BitmapImage img = (BitmapImage)App.Current.Resources["BackgroundImage"];

            imgBackground.ImageSource = (BitmapImage)FindResource("BackgroundImage");
            imgBackground.Viewport = new Rect(0, 0, this.Width, this.Height);
            imgBackground.ViewportUnits = BrushMappingMode.Absolute;
            imgBackground.TileMode = TileMode.Tile;

            this.Background = imgBackground;

            mainPanel = new Canvas();

            frameTopMenu = new Frame();
            frameTopMenu.Height = menuHeight;
            frameTopMenu.Width = this.Width;
            frameTopMenu.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameTopMenu.Navigate(new PageStandardMenuTop());

            Canvas.SetTop(frameTopMenu, 0);
            Canvas.SetLeft(frameTopMenu, 0);
            mainPanel.Children.Add(frameTopMenu);

            panelNavigation = new DockPanel();
            panelNavigation.Margin = new Thickness(0, 5, 0, 0);

            btnPrevious = new Button();
            btnPrevious.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnPrevious.Height = 24;
            btnPrevious.Width = 32;
            btnPrevious.Content = "<-";
            btnPrevious.Margin = new Thickness(2, 0, 0, 0);
            btnPrevious.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnPrevious.Click += new RoutedEventHandler(btnPrevious_Click);
            panelNavigation.Children.Add(btnPrevious);
            btnPrevious.ToolTip = UICreator.CreateToolTip("1001");

            btnNext = new Button();
            btnNext.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnNext.Height = 24;
            btnNext.Margin = new Thickness(2, 0, 0, 0);
            btnNext.Width = 32;
            btnNext.Content = "->";
            btnNext.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnNext.Click += new RoutedEventHandler(btnNext_Click);
            panelNavigation.Children.Add(btnNext);
            btnNext.ToolTip = UICreator.CreateToolTip("1002");

            btnPause = new Button();
            btnPause.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnPause.Height = 24;
            btnPause.Width = 32;
            btnPause.Margin = new Thickness(2, 0, 0, 0);
            btnPause.Content = "||";
            btnPause.Visibility = GameTimer.GetInstance().isPaused() ? Visibility.Collapsed : Visibility.Visible;
            btnPause.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnPause.Click += new RoutedEventHandler(btnPause_Click);
            panelNavigation.Children.Add(btnPause);
            btnPause.ToolTip = UICreator.CreateToolTip("1003");

            btnStart = new Button();
            btnStart.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnStart.Height = 24;
            btnStart.Width = 32;
            btnStart.Visibility = GameTimer.GetInstance().isPaused() ? Visibility.Visible : System.Windows.Visibility.Collapsed;
            btnStart.Margin = new Thickness(2, 0, 0, 0);
            btnStart.Content = ">";
            btnStart.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnStart.Click += new RoutedEventHandler(btnStart_Click);
            panelNavigation.Children.Add(btnStart);
            btnStart.ToolTip = UICreator.CreateToolTip("1004");

            Button btnThreadState = new Button();
            btnThreadState.Visibility = System.Windows.Visibility.Collapsed;
            btnThreadState.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnThreadState.Height = Double.NaN;
            btnThreadState.Width = Double.NaN;
            btnThreadState.Margin = new Thickness(2, 0, 0, 0);
            btnThreadState.Content = "Thread state";
            btnThreadState.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnThreadState.Click += btnThreadState_Click;
            panelNavigation.Children.Add(btnThreadState);

            Canvas.SetTop(panelNavigation, frameTopMenu.Height);
            Canvas.SetLeft(panelNavigation, 0);
            mainPanel.Children.Add(panelNavigation);

            Frame frameTop = new Frame();
            frameTop.Height = 75;
            frameTop.Width = this.Width - 2 * sideMargin;
            frameTop.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            this.PageHeader = new PageHeader();
            frameTop.Navigate(this.PageHeader);

            Canvas.SetTop(frameTop, frameTopMenu.Height + regularMargin);
            Canvas.SetRight(frameTop, sideMargin);
            mainPanel.Children.Add(frameTop);

            Frame frameContent = new Frame();

            frameContent.SizeChanged += new SizeChangedEventHandler(frameContent_SizeChanged);
            frameContent.Height = this.Height - Canvas.GetTop(frameTop) - 150;
            frameContent.Width = this.Width - 2 * sideMargin;
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            this.PageContent = new PageContent();
            frameContent.Navigate(this.PageContent);

            Canvas.SetTop(frameContent, Canvas.GetTop(frameTop) + frameTop.Height + regularMargin);
            Canvas.SetLeft(frameContent, sideMargin);
            mainPanel.Children.Add(frameContent);

            frameInformation = new Frame();
            frameInformation.Height = frameTopMenu.Height;
            frameInformation.Width = 125;
            frameInformation.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameInformation.Navigate(new PageInformation());

            Canvas.SetTop(frameInformation, 0);
            Canvas.SetRight(frameInformation, 0);
            mainPanel.Children.Add(frameInformation);

            frameBottomMenu = new Frame();
            frameBottomMenu.Height = bottomMenuHeight;
            frameBottomMenu.Width = this.Width;
            frameBottomMenu.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameBottomMenu.Navigate(new PageBottomMenu());

            Canvas.SetBottom(frameBottomMenu, 0);
            Canvas.SetLeft(frameBottomMenu, 0);
            mainPanel.Children.Add(frameBottomMenu);

            this.Content = this.mainPanel;
        }
Example #18
0
        public PanelAirport(Airport airport)
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();

            this.Airport = airport;

            WrapPanel buttonsPanel = new WrapPanel();

            ucSelectButton sbGates = new ucSelectButton();
            sbGates.Uid = "201";
            sbGates.Content = Translator.GetInstance().GetString("PanelAirport", sbGates.Uid);
            sbGates.Click += new System.Windows.RoutedEventHandler(sbGates_Click);
            sbGates.IsSelected = true;
            buttonsPanel.Children.Add(sbGates);

            ucSelectButton sbRunways = new ucSelectButton();
            sbRunways.Uid = "205";
            sbRunways.Content = Translator.GetInstance().GetString("PanelAirport", sbRunways.Uid);
            sbRunways.Click += new System.Windows.RoutedEventHandler(sbRunways_Click);
            buttonsPanel.Children.Add(sbRunways);

            ucSelectButton sbFacilities = new ucSelectButton();
            sbFacilities.Uid = "202";
            sbFacilities.Content = Translator.GetInstance().GetString("PanelAirport", sbFacilities.Uid);
            sbFacilities.Click += new System.Windows.RoutedEventHandler(sbFacilities_Click);
            buttonsPanel.Children.Add(sbFacilities);

            ucSelectButton sbWeather = new ucSelectButton();
            sbWeather.Uid = "208";
            sbWeather.Content = Translator.GetInstance().GetString("PanelAirport", sbWeather.Uid);
            sbWeather.Click += new System.Windows.RoutedEventHandler(sbWeather_Click);
            buttonsPanel.Children.Add(sbWeather);

            ucSelectButton sbStatistics = new ucSelectButton();
            sbStatistics.Uid = "203";
            sbStatistics.Content = Translator.GetInstance().GetString("PanelAirport", sbStatistics.Uid);
            sbStatistics.Click += new System.Windows.RoutedEventHandler(sbStatistics_Click);
            buttonsPanel.Children.Add(sbStatistics);

            ucSelectButton sbTraffic = new ucSelectButton();
            sbTraffic.Uid = "207";
            sbTraffic.Content = Translator.GetInstance().GetString("PanelAirport", sbTraffic.Uid);
            sbTraffic.Click += new System.Windows.RoutedEventHandler(sbTraffic_Click);
            buttonsPanel.Children.Add(sbTraffic);

            ucSelectButton sbFlights = new ucSelectButton();
            sbFlights.Uid = "204";
            sbFlights.Content = Translator.GetInstance().GetString("PanelAirport", sbFlights.Uid);
            sbFlights.Click += new System.Windows.RoutedEventHandler(sbFlights_Click);
            buttonsPanel.Children.Add(sbFlights);

            ucSelectButton sbDistances = new ucSelectButton();
            sbDistances.Uid = "206";
            sbDistances.Content = Translator.GetInstance().GetString("PanelAirport",sbDistances.Uid);
            sbDistances.Click += new System.Windows.RoutedEventHandler(sbDistances_Click);
            buttonsPanel.Children.Add(sbDistances);

            this.Children.Add(buttonsPanel);

            frameContent = new Frame();
            frameContent.NavigationUIVisibility = NavigationUIVisibility.Hidden;
            frameContent.Navigate(new PageAirportGates(this.Airport));

            this.Children.Add(frameContent);

            sw.Stop();
            PerformanceCounters.AddPerformanceCounter(new PagePerformanceCounter("PanelAirport", GameObject.GetInstance().GameTime, sw.ElapsedMilliseconds));
        }
        /// <summary>
        /// Add a new search tab to the tab control
        /// </summary>
        private void AddSearchTab()
        {
            try
            {
                CloseableTabItem cti = new CloseableTabItem();
                cti.Header = "New Search " + _searchNumber.ToString(CultureInfo.CurrentCulture);
                _searchNumber++;
                Grid g = new Grid();
                Frame f = new Frame();
                SearchView sv = new SearchView();
                SearchViewModel svm = sv.DataContext as SearchViewModel;

                if (!string.IsNullOrEmpty(Properties.Settings.Default.SavedSearch))
                {
                    MemoryStream ms = new MemoryStream(Encoding.ASCII.GetBytes(Properties.Settings.Default.SavedSearch));
                    XmlSerializer xml = new XmlSerializer(typeof(DrawingSearchModel));
                    DrawingSearchModel dsm = xml.Deserialize(ms) as DrawingSearchModel;
                    svm.Model = dsm;
                }

                f.Navigate(sv);
                g.Children.Add(f);

                cti.Content = g;
                tabControl1.Items.Add(cti);
                tabControl1.SelectedItem = cti;
            }
            catch (Exception ex)
            { MessageBox.Show(ex.ToString()); }
            
        }
 private void navigateMarble(Frame frame)
 {
     removeListener();
     Marble mb = new Marble();
     frame.Navigate(mb);
     _lastPage = mb;
 }
        //creates the panel for stopover statistics
        private StackPanel createStopoverStatisticsPanel()
        {
            StackPanel panelStopoverStatistics = new StackPanel();

            WrapPanel panelMenuButtons = new WrapPanel();
            panelStopoverStatistics.Children.Add(panelMenuButtons);

            ucSelectButton sbRouteFinances = new ucSelectButton();
            sbRouteFinances.Uid = "1007";
            sbRouteFinances.Content = Translator.GetInstance().GetString("PanelRoute", sbRouteFinances.Uid);
            sbRouteFinances.Click += sbRouteFinances_Click;
            sbRouteFinances.IsSelected = true;
            panelMenuButtons.Children.Add(sbRouteFinances);

            if (this.Route.HasStopovers)
            {
                foreach (Route leg in this.Route.Stopovers.SelectMany(s => s.Legs))
                {
                    ucSelectButton sbLeg = new ucSelectButton();
                    sbLeg.Content = string.Format("{0}-{1}", new AirportCodeConverter().Convert(leg.Destination1), new AirportCodeConverter().Convert(leg.Destination2));
                    sbLeg.Tag = leg;
                    sbLeg.Click += sbLeg_Click;
                    panelMenuButtons.Children.Add(sbLeg);
                }
            }
            else
            {
                ucSelectButton sbStatistics = new ucSelectButton();
                sbStatistics.Content = string.Format("{0}-{1}", new AirportCodeConverter().Convert(this.Route.Destination1), new AirportCodeConverter().Convert(this.Route.Destination2));
                sbStatistics.Tag = this.Route;
                sbStatistics.Click += sbLeg_Click;
                panelMenuButtons.Children.Add(sbStatistics);
            }

            frmStopoverStatistics = new Frame();
            frmStopoverStatistics.Navigate(createRouteFinancesPanel());

            panelStopoverStatistics.Children.Add(frmStopoverStatistics);

            return panelStopoverStatistics;
        }
 private void navigateMovement(Frame frame)
 {
     removeListener();
     Movement movement = new Movement();
     _movementTab.Content = movement;
     frame.Navigate(movement);
     _lastPage = movement;
 }
 private void navigateCOG(Frame frame)
 {
     removeListener();
     _cogTab.Content = _cog;
     frame.Navigate(_cog);
     _lastPage = _cog;
 }
 private void navigateWeight(Frame frame)
 {
     removeListener();
     _wc.updateChart();
     frame.Navigate(_wc);
     _lastPage = _wc;
 }