public PopUpAirlinerAutoRoutes(FleetAirliner airliner)
        {
            this.Entries = new Dictionary<Route, List<RouteTimeTableEntry>>();
            this.EntriesToDelete = new Dictionary<Route, List<RouteTimeTableEntry>>();
            this.NewestEntries = new List<RouteTimeTableEntry>();

            this.Airliner = airliner;

            InitializeComponent();

            this.Title = this.Airliner.Name;

            this.Width = 1200;

            this.Height = 350;

            this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            ScrollViewer scroller = new ScrollViewer();
            //scroller.Margin = new Thickness(10, 10, 10, 10);
            scroller.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            scroller.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            scroller.MaxHeight = this.Height;

            StackPanel mainPanel = new StackPanel();
            mainPanel.Margin = new Thickness(10, 10, 10, 10);
            scroller.Content = mainPanel;

            Grid grdFlights = UICreator.CreateGrid(2);
            grdFlights.ColumnDefinitions[1].Width = new GridLength(200);
            // mainPanel.Children.Add(grdFlights);

            lbFlights = new ListBox();
            lbFlights.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbFlights.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
            lbFlights.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            //Grid.SetColumn(lbFlights, 0);
            //grdFlights.Children.Add(lbFlights);

            mainPanel.Children.Add(lbFlights);

            ScrollViewer panelRoutes = createRoutesPanel();

            Grid.SetColumn(panelRoutes, 1);
            grdFlights.Children.Add(panelRoutes);

            this.RouteFrame = new Frame();
            this.RouteFrame.NavigationUIVisibility = System.Windows.Navigation.NavigationUIVisibility.Hidden;

            mainPanel.Children.Add(this.RouteFrame);
            //mainPanel.Children.Add(createAutoGeneratePanel());
            mainPanel.Children.Add(createButtonsPanel());

            this.Content = scroller;

            showFlights();

            PageAirlinerAutoRoute pageRoute = new PageAirlinerAutoRoute(this.Airliner, this, PopUpAirlinerAutoRoutes_RouteChanged);

            this.RouteFrame.Navigate(pageRoute);
        }
        private void btnRegular_Click(object sender, RoutedEventArgs e)
        {
            PageAirlinerAutoRoute pageRoute = new PageAirlinerAutoRoute(this.Airliner, this, PopUpAirlinerAutoRoutes_RouteChanged);

            this.RouteFrame.Navigate(pageRoute);
            this.btnRegular.Visibility = System.Windows.Visibility.Collapsed;
            this.btnAdvanced.Visibility = System.Windows.Visibility.Visible;
        }