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);
        }
Exemple #2
0
        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);
        }
        public PageExtendedSearchAirports(PageAirports parent)
        {
            this.ParentPage = parent;

            InitializeComponent();

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

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

            panelSearch.Children.Add(txtHeader);

            ListBox lbContent = new ListBox();
            lbContent.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbContent.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");

            panelSearch.Children.Add(lbContent);

            cbAirport = new ComboBox();
            cbAirport.SetResourceReference(ComboBox.ItemTemplateProperty, "AirportCountryItem");
            cbAirport.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbAirport.IsSynchronizedWithCurrentItem = true;
            cbAirport.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbAirport.Width = 200;

            List<Airport> airportsList = Airports.GetAllActiveAirports();

            ICollectionView airportsView = CollectionViewSource.GetDefaultView(airportsList);
            airportsView.SortDescriptions.Add(new SortDescription("Profile.Name", ListSortDirection.Ascending));

            cbAirport.ItemsSource = airportsView;
            cbAirport.SelectedIndex = 0;

            lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageExtendedSearchAirports", "1002"), cbAirport));

            WrapPanel panelDistance = new WrapPanel();

            cbCompareDistance = new ComboBox();
            createCompareComboBox(cbCompareDistance);
            panelDistance.Children.Add(cbCompareDistance);

            txtDistance = new TextBox();
            txtDistance.PreviewTextInput += new TextCompositionEventHandler(txtDistance_PreviewTextInput);
            txtDistance.Width = 100;
            txtDistance.TextAlignment = TextAlignment.Right;
            txtDistance.Background = Brushes.Transparent;
            panelDistance.Children.Add(txtDistance);

            lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageExtendedSearchAirports", "1004"), panelDistance));

            WrapPanel panelButtons = new WrapPanel();
            panelButtons.Margin = new Thickness(0, 5, 0, 0);
            panelButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            panelSearch.Children.Add(panelButtons);

            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.Click += new RoutedEventHandler(btnSearch_Click);

            panelButtons.Children.Add(btnSearch);

            this.Content = panelSearch;
        }
        public PageSearchAirports(PageAirports parent)
        {
            InitializeComponent();

            this.ParentPage = parent;

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

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

            panelSearch.Children.Add(txtHeader);

            ListBox lbSearch = new ListBox();
            lbSearch.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbSearch.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
            panelSearch.Children.Add(lbSearch);

            WrapPanel panelCheckBoxes = new WrapPanel();
            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports","1004"), panelCheckBoxes));

            cbHumanAirports = new CheckBox();
            cbHumanAirports.Uid = "1002";
            cbHumanAirports.Content = Translator.GetInstance().GetString("PageSearchAirports", cbHumanAirports.Uid);
            cbHumanAirports.IsChecked = false;
            cbHumanAirports.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbHumanAirports.FlowDirection = System.Windows.FlowDirection.RightToLeft;

            panelCheckBoxes.Children.Add(cbHumanAirports);

            cbHubs = new CheckBox();
            cbHubs.Uid = "1003";
            cbHubs.Content = Translator.GetInstance().GetString("PageSearchAirports", cbHubs.Uid);
            cbHubs.IsChecked = false;
            cbHubs.FlowDirection = System.Windows.FlowDirection.RightToLeft;
            cbHubs.Margin = new Thickness(5, 0, 0, 0);

            panelCheckBoxes.Children.Add(cbHubs);

            cbRegion = new ComboBox();
            cbRegion.DisplayMemberPath = "Name";
            cbRegion.SelectedValuePath = "Name";
            cbRegion.Width = 250;
            cbRegion.Background = Brushes.Transparent;
            cbRegion.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbRegion.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbRegion.SelectionChanged += new SelectionChangedEventHandler(cbRegions_SelectionChanged);

            List<Region> regions = Regions.GetRegions();
            regions.Sort(delegate(Region r1, Region r2){return r1.Name.CompareTo(r2.Name);});

            // 100 is the predefined Uid for "All Regions"
            Region regionAll = Regions.GetRegion("100");
            cbRegion.Items.Add(regionAll);

            foreach (Region region in regions)
                cbRegion.Items.Add(region);

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1005"), cbRegion));

            cbCountry = new ComboBox();
            cbCountry.SetResourceReference(ComboBox.ItemTemplateProperty, "CountryFlagLongItem");
            cbCountry.Width = 250;
            //cbCountries.Style = this.Resources["ComboBoxStyle"] as Style;
            cbCountry.Background = Brushes.Transparent;
            cbCountry.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbCountry.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            List<Country> countries = Countries.GetCountries();
            countries.Sort(delegate(Country c1, Country c2) { return c1.Name.CompareTo(c2.Name); });

            // 100 is the predefined Uid for "All Countries"
            Country countryAll = Countries.GetCountry("100");
            cbCountry.Items.Add(countryAll);

            foreach (Country country in countries)
                cbCountry.Items.Add(country);

            cbCountry.SelectedItem = countryAll;
            cbRegion.SelectedItem = regionAll;

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1006"), cbCountry));

            WrapPanel panelSizes = new WrapPanel();

            cbCompareSize = new ComboBox();
            createCompareComboBox(cbCompareSize);
            panelSizes.Children.Add(cbCompareSize);

            cbSize = new ComboBox();
            cbSize.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbSize.Background = Brushes.Transparent;
            cbSize.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbSize.SetResourceReference(ComboBox.ItemTemplateProperty, "TextUnderscoreTextBlock");
            cbSize.Width = 100;

            foreach (GeneralHelpers.Size type in Enum.GetValues(typeof(GeneralHelpers.Size)))
                cbSize.Items.Add(type);

            cbSize.SelectedIndex = 0;

            panelSizes.Children.Add(cbSize);

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1007"), panelSizes));

            txtTextSearch = new TextBox();
            txtTextSearch.Width = 300;
            txtTextSearch.Background = Brushes.Transparent;
            txtTextSearch.Foreground = Brushes.White;
            txtTextSearch.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1008"), txtTextSearch));

            WrapPanel panelButtons = new WrapPanel();
            panelButtons.Margin = new Thickness(0, 5, 0, 0);
            panelButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            panelSearch.Children.Add(panelButtons);

            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.Click += new RoutedEventHandler(btnSearch_Click);

            panelButtons.Children.Add(btnSearch);

            Button btnClear = new Button();
            btnClear.Uid = "110";
            btnClear.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnClear.Width = Double.NaN;
            btnClear.Height = Double.NaN;
            btnClear.Margin = new Thickness(10, 0, 0, 0);
            btnClear.Content = Translator.GetInstance().GetString("General", btnClear.Uid);
            btnClear.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnClear.Click += new RoutedEventHandler(btnClear_Click);

            panelButtons.Children.Add(btnClear);

            this.Content = panelSearch;
        }
        public PageSearchAirports(PageAirports parent)
        {
            InitializeComponent();

            this.ParentPage = parent;

            StackPanel panelSearch = new StackPanel();

            panelSearch.Margin = new Thickness(0, 10, 50, 0);

            TextBlock txtHeader = new TextBlock();

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

            panelSearch.Children.Add(txtHeader);

            ListBox lbSearch = new ListBox();

            lbSearch.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbSearch.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");
            panelSearch.Children.Add(lbSearch);

            WrapPanel panelCheckBoxes = new WrapPanel();

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1004"), panelCheckBoxes));

            cbHumanAirports                     = new CheckBox();
            cbHumanAirports.Uid                 = "1002";
            cbHumanAirports.Content             = Translator.GetInstance().GetString("PageSearchAirports", cbHumanAirports.Uid);
            cbHumanAirports.IsChecked           = false;
            cbHumanAirports.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbHumanAirports.FlowDirection       = System.Windows.FlowDirection.RightToLeft;

            panelCheckBoxes.Children.Add(cbHumanAirports);

            cbHubs               = new CheckBox();
            cbHubs.Uid           = "1003";
            cbHubs.Content       = Translator.GetInstance().GetString("PageSearchAirports", cbHubs.Uid);
            cbHubs.IsChecked     = false;
            cbHubs.FlowDirection = System.Windows.FlowDirection.RightToLeft;
            cbHubs.Margin        = new Thickness(5, 0, 0, 0);

            panelCheckBoxes.Children.Add(cbHubs);

            cbRegion = new ComboBox();
            cbRegion.DisplayMemberPath = "Name";
            cbRegion.SelectedValuePath = "Name";
            cbRegion.Width             = 250;
            cbRegion.Background        = Brushes.Transparent;
            cbRegion.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbRegion.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbRegion.SelectionChanged   += new SelectionChangedEventHandler(cbRegions_SelectionChanged);

            List <Region> regions = Regions.GetRegions();

            regions.Sort(delegate(Region r1, Region r2){ return(r1.Name.CompareTo(r2.Name)); });

            // 100 is the predefined Uid for "All Regions"
            Region regionAll = Regions.GetRegion("100");

            cbRegion.Items.Add(regionAll);

            foreach (Region region in regions)
            {
                cbRegion.Items.Add(region);
            }

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1005"), cbRegion));

            cbCountry = new ComboBox();
            cbCountry.SetResourceReference(ComboBox.ItemTemplateProperty, "CountryFlagLongItem");
            cbCountry.Width = 250;
            //cbCountries.Style = this.Resources["ComboBoxStyle"] as Style;
            cbCountry.Background = Brushes.Transparent;
            cbCountry.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbCountry.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;


            List <Country> countries = Countries.GetCountries();

            countries.Sort(delegate(Country c1, Country c2) { return(c1.Name.CompareTo(c2.Name)); });

            // 100 is the predefined Uid for "All Countries"
            Country countryAll = Countries.GetCountry("100");

            cbCountry.Items.Add(countryAll);

            foreach (Country country in countries)
            {
                cbCountry.Items.Add(country);
            }

            cbCountry.SelectedItem = countryAll;
            cbRegion.SelectedItem  = regionAll;

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1006"), cbCountry));



            WrapPanel panelSizes = new WrapPanel();

            cbCompareSize = new ComboBox();
            createCompareComboBox(cbCompareSize);
            panelSizes.Children.Add(cbCompareSize);

            cbSize = new ComboBox();
            cbSize.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbSize.Background          = Brushes.Transparent;
            cbSize.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            cbSize.SetResourceReference(ComboBox.ItemTemplateProperty, "TextUnderscoreTextBlock");
            cbSize.Width = 100;

            foreach (GeneralHelpers.Size type in Enum.GetValues(typeof(GeneralHelpers.Size)))
            {
                cbSize.Items.Add(type);
            }

            cbSize.SelectedIndex = 0;

            panelSizes.Children.Add(cbSize);

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1007"), panelSizes));

            txtTextSearch                     = new TextBox();
            txtTextSearch.Width               = 300;
            txtTextSearch.Background          = Brushes.Transparent;
            txtTextSearch.Foreground          = Brushes.White;
            txtTextSearch.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            lbSearch.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageSearchAirports", "1008"), txtTextSearch));

            WrapPanel panelButtons = new WrapPanel();

            panelButtons.Margin = new Thickness(0, 5, 0, 0);
            panelButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            panelSearch.Children.Add(panelButtons);

            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.Click += new RoutedEventHandler(btnSearch_Click);

            panelButtons.Children.Add(btnSearch);

            Button btnClear = new Button();

            btnClear.Uid = "110";
            btnClear.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnClear.Width   = Double.NaN;
            btnClear.Height  = Double.NaN;
            btnClear.Margin  = new Thickness(10, 0, 0, 0);
            btnClear.Content = Translator.GetInstance().GetString("General", btnClear.Uid);
            btnClear.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");
            btnClear.Click += new RoutedEventHandler(btnClear_Click);

            panelButtons.Children.Add(btnClear);

            this.Content = panelSearch;
        }
        public PageExtendedSearchAirports(PageAirports parent)
        {
            this.ParentPage = parent;

            InitializeComponent();

            StackPanel panelSearch = new StackPanel();

            panelSearch.Margin = new Thickness(0, 10, 50, 0);

            TextBlock txtHeader = new TextBlock();

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

            panelSearch.Children.Add(txtHeader);

            ListBox lbContent = new ListBox();

            lbContent.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbContent.SetResourceReference(ListBox.ItemTemplateProperty, "QuickInfoItem");

            panelSearch.Children.Add(lbContent);


            cbAirport = new ComboBox();
            cbAirport.SetResourceReference(ComboBox.ItemTemplateProperty, "AirportCountryItem");
            cbAirport.SetResourceReference(ComboBox.StyleProperty, "ComboBoxTransparentStyle");
            cbAirport.IsSynchronizedWithCurrentItem = true;
            cbAirport.HorizontalAlignment           = System.Windows.HorizontalAlignment.Left;
            cbAirport.Width = 200;

            List <Airport> airportsList = Airports.GetAllActiveAirports();

            ICollectionView airportsView = CollectionViewSource.GetDefaultView(airportsList);

            airportsView.SortDescriptions.Add(new SortDescription("Profile.Name", ListSortDirection.Ascending));

            cbAirport.ItemsSource   = airportsView;
            cbAirport.SelectedIndex = 0;

            lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageExtendedSearchAirports", "1002"), cbAirport));

            WrapPanel panelDistance = new WrapPanel();

            cbCompareDistance = new ComboBox();
            createCompareComboBox(cbCompareDistance);
            panelDistance.Children.Add(cbCompareDistance);

            txtDistance = new TextBox();
            txtDistance.PreviewTextInput += new TextCompositionEventHandler(txtDistance_PreviewTextInput);
            txtDistance.Width             = 100;
            txtDistance.TextAlignment     = TextAlignment.Right;
            txtDistance.Background        = Brushes.Transparent;
            panelDistance.Children.Add(txtDistance);

            lbContent.Items.Add(new QuickInfoValue(Translator.GetInstance().GetString("PageExtendedSearchAirports", "1004"), panelDistance));

            WrapPanel panelButtons = new WrapPanel();

            panelButtons.Margin = new Thickness(0, 5, 0, 0);
            panelButtons.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;

            panelSearch.Children.Add(panelButtons);

            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.Click += new RoutedEventHandler(btnSearch_Click);

            panelButtons.Children.Add(btnSearch);


            this.Content = panelSearch;
        }