public PageAirliners()
        {
            InitializeComponent();

            this.Uid = "1000";
            this.Title = Translator.GetInstance().GetString("PageAirliners", this.Uid);

            airlinerType = AirlinerType.TypeOfAirliner.Passenger;
            sortCriteriaUsed = a => a.BuiltDate;
            sortDescending = true;

            StackPanel airlinersPanel = new StackPanel();
            airlinersPanel.Margin = new Thickness(10, 0, 10, 0);

            TextBlock txtNewHeader = new TextBlock();
            txtNewHeader.Uid = "1001";
            txtNewHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtNewHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtNewHeader.FontWeight = FontWeights.Bold;
            txtNewHeader.Text = Translator.GetInstance().GetString("PageAirliners", txtNewHeader.Uid);

            airlinersPanel.Children.Add(txtNewHeader);

            // chs, 2011-11-10 added a scroller so all elements are viewable

            ScrollViewer scroller = new ScrollViewer();
            scroller.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            scroller.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;

            airlinersPanel.Children.Add(scroller);

            StackPanel panelScroller = new StackPanel();
            panelScroller.Orientation = Orientation.Vertical;

            scroller.Content = panelScroller;

            ContentControl ccManufacturerHeader = new ContentControl();
            ccManufacturerHeader.ContentTemplate = this.Resources["ManufacturerHeader"] as DataTemplate;
            ccManufacturerHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            panelScroller.Children.Add(ccManufacturerHeader);

            lbManufacturers = new ListBox();
            lbManufacturers.ItemTemplate = this.Resources["ManufacturerItem"] as DataTemplate;
            lbManufacturers.MaxHeight = (GraphicsHelpers.GetContentHeight() - 100) / 2;
            lbManufacturers.ItemContainerStyleSelector = new ListBoxItemStyleSelector();

             panelScroller.Children.Add(lbManufacturers);

            TextBlock txtUsedHeader = new TextBlock();
            txtUsedHeader.Uid = "1002";
            txtUsedHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtUsedHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtUsedHeader.FontWeight = FontWeights.Bold;
            txtUsedHeader.Margin = new Thickness(0, 10, 0, 0);
            txtUsedHeader.Text = Translator.GetInstance().GetString("PageAirliners", txtUsedHeader.Uid);

            airlinersPanel.Children.Add(txtUsedHeader);

            WrapPanel airlinerTypePanel = new WrapPanel();
            airlinersPanel.Children.Add(airlinerTypePanel);

            RadioButton rbPassengerAirliner = new RadioButton();
            rbPassengerAirliner.GroupName = "AirlinerRouteType";
            rbPassengerAirliner.IsChecked = true;
            rbPassengerAirliner.Tag = AirlinerType.TypeOfAirliner.Passenger;
            rbPassengerAirliner.Checked += rbRouteType_Checked;
            rbPassengerAirliner.Content = Translator.GetInstance().GetString("PageAirliners", "1003");

            airlinerTypePanel.Children.Add(rbPassengerAirliner);

            RadioButton rbCargoAirliner = new RadioButton();
            rbCargoAirliner.GroupName = "AirlinerRouteType";
            rbCargoAirliner.Margin = new Thickness(5, 0, 0, 0);
            rbCargoAirliner.Tag = AirlinerType.TypeOfAirliner.Cargo;
            rbCargoAirliner.Checked += rbRouteType_Checked;
            rbCargoAirliner.Content = Translator.GetInstance().GetString("PageAirliners", "1004");

            airlinerTypePanel.Children.Add(rbCargoAirliner);

            ContentControl lblUsedHeader = new ContentControl();
            lblUsedHeader.ContentTemplate = this.Resources["AirlinersUsedHeader"] as DataTemplate;
            lblUsedHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;

            airlinersPanel.Children.Add(lblUsedHeader);

            lbUsedAirliners = new ListBox();
            lbUsedAirliners.ItemTemplate = this.Resources["AirlinerUsedItem"] as DataTemplate;
            lbUsedAirliners.Height = (GraphicsHelpers.GetContentHeight() - 150) / 2;
            lbUsedAirliners.ItemContainerStyleSelector = new ListBoxItemStyleSelector();

            airlinersPanel.Children.Add(lbUsedAirliners);

            Button btnSearch = new Button();
            btnSearch.Uid = "109";
            btnSearch.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnSearch.Height = Double.NaN;
            btnSearch.Width = Double.NaN;
            btnSearch.IsDefault = true;
            btnSearch.Content = Translator.GetInstance().GetString("General", btnSearch.Uid);
            btnSearch.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnSearch.Margin = new Thickness(0, 5, 0, 0);
            btnSearch.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            btnSearch.Click += new RoutedEventHandler(btnSearch_Click);

            airlinersPanel.Children.Add(btnSearch);

            showUsedAirliners(Airliners.GetAirlinersForSale());

            StandardContentPanel panelContent = new StandardContentPanel();

            panelContent.setContentPage(airlinersPanel, StandardContentPanel.ContentLocation.Left);

            sideFrame = new Frame();

            panelContent.setContentPage(sideFrame, StandardContentPanel.ContentLocation.Right);

            base.setContent(panelContent);

            base.setHeaderContent(this.Title);

            showPage(this);

            showManufacturers();
        }
        public PageAirliners()
        {
            InitializeComponent();

            this.Uid   = "1000";
            this.Title = Translator.GetInstance().GetString("PageAirliners", this.Uid);


            airlinerType     = AirlinerType.TypeOfAirliner.Passenger;
            sortCriteriaUsed = a => a.BuiltDate;
            sortDescending   = true;

            StackPanel airlinersPanel = new StackPanel();

            airlinersPanel.Margin = new Thickness(10, 0, 10, 0);

            TextBlock txtNewHeader = new TextBlock();

            txtNewHeader.Uid = "1001";
            txtNewHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtNewHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtNewHeader.FontWeight = FontWeights.Bold;
            txtNewHeader.Text       = Translator.GetInstance().GetString("PageAirliners", txtNewHeader.Uid);

            airlinersPanel.Children.Add(txtNewHeader);

            // chs, 2011-11-10 added a scroller so all elements are viewable

            ScrollViewer scroller = new ScrollViewer();

            scroller.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            scroller.VerticalScrollBarVisibility   = ScrollBarVisibility.Disabled;

            airlinersPanel.Children.Add(scroller);

            StackPanel panelScroller = new StackPanel();

            panelScroller.Orientation = Orientation.Vertical;

            scroller.Content = panelScroller;

            ContentControl ccManufacturerHeader = new ContentControl();

            ccManufacturerHeader.ContentTemplate     = this.Resources["ManufacturerHeader"] as DataTemplate;
            ccManufacturerHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            panelScroller.Children.Add(ccManufacturerHeader);

            lbManufacturers = new ListBox();
            lbManufacturers.ItemTemplate = this.Resources["ManufacturerItem"] as DataTemplate;
            lbManufacturers.MaxHeight    = (GraphicsHelpers.GetContentHeight() - 100) / 2;
            lbManufacturers.ItemContainerStyleSelector = new ListBoxItemStyleSelector();

            panelScroller.Children.Add(lbManufacturers);

            TextBlock txtUsedHeader = new TextBlock();

            txtUsedHeader.Uid = "1002";
            txtUsedHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
            txtUsedHeader.SetResourceReference(TextBlock.BackgroundProperty, "HeaderBackgroundBrush2");
            txtUsedHeader.FontWeight = FontWeights.Bold;
            txtUsedHeader.Margin     = new Thickness(0, 10, 0, 0);
            txtUsedHeader.Text       = Translator.GetInstance().GetString("PageAirliners", txtUsedHeader.Uid);

            airlinersPanel.Children.Add(txtUsedHeader);

            WrapPanel airlinerTypePanel = new WrapPanel();

            airlinersPanel.Children.Add(airlinerTypePanel);

            RadioButton rbPassengerAirliner = new RadioButton();

            rbPassengerAirliner.GroupName = "AirlinerRouteType";
            rbPassengerAirliner.IsChecked = true;
            rbPassengerAirliner.Tag       = AirlinerType.TypeOfAirliner.Passenger;
            rbPassengerAirliner.Checked  += rbRouteType_Checked;
            rbPassengerAirliner.Content   = Translator.GetInstance().GetString("PageAirliners", "1003");

            airlinerTypePanel.Children.Add(rbPassengerAirliner);

            RadioButton rbCargoAirliner = new RadioButton();

            rbCargoAirliner.GroupName = "AirlinerRouteType";
            rbCargoAirliner.Margin    = new Thickness(5, 0, 0, 0);
            rbCargoAirliner.Tag       = AirlinerType.TypeOfAirliner.Cargo;
            rbCargoAirliner.Checked  += rbRouteType_Checked;
            rbCargoAirliner.Content   = Translator.GetInstance().GetString("PageAirliners", "1004");

            airlinerTypePanel.Children.Add(rbCargoAirliner);

            ContentControl lblUsedHeader = new ContentControl();

            lblUsedHeader.ContentTemplate     = this.Resources["AirlinersUsedHeader"] as DataTemplate;
            lblUsedHeader.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;

            airlinersPanel.Children.Add(lblUsedHeader);

            lbUsedAirliners = new ListBox();
            lbUsedAirliners.ItemTemplate = this.Resources["AirlinerUsedItem"] as DataTemplate;
            lbUsedAirliners.Height       = (GraphicsHelpers.GetContentHeight() - 150) / 2;
            lbUsedAirliners.ItemContainerStyleSelector = new ListBoxItemStyleSelector();

            airlinersPanel.Children.Add(lbUsedAirliners);

            Button btnSearch = new Button();

            btnSearch.Uid = "109";
            btnSearch.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnSearch.Height    = Double.NaN;
            btnSearch.Width     = Double.NaN;
            btnSearch.IsDefault = true;
            btnSearch.Content   = Translator.GetInstance().GetString("General", btnSearch.Uid);
            btnSearch.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnSearch.Margin = new Thickness(0, 5, 0, 0);
            btnSearch.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            btnSearch.Click += new RoutedEventHandler(btnSearch_Click);

            airlinersPanel.Children.Add(btnSearch);

            showUsedAirliners(Airliners.GetAirlinersForSale());

            StandardContentPanel panelContent = new StandardContentPanel();

            panelContent.setContentPage(airlinersPanel, StandardContentPanel.ContentLocation.Left);

            sideFrame = new Frame();

            panelContent.setContentPage(sideFrame, StandardContentPanel.ContentLocation.Right);

            base.setContent(panelContent);

            base.setHeaderContent(this.Title);


            showPage(this);

            showManufacturers();
        }
        private void rbRouteType_Checked(object sender, RoutedEventArgs e)
        {
            airlinerType = (AirlinerType.TypeOfAirliner)((RadioButton)sender).Tag;

            showUsedAirliners();
        }
        private void rbRouteType_Checked(object sender, RoutedEventArgs e)
        {
            airlinerType = (AirlinerType.TypeOfAirliner)((RadioButton)sender).Tag;

            showUsedAirliners();
        }