public PanelAlliance(StandardPage parent, Alliance alliance)
        {
            this.ParentPage = parent;
            this.Alliance = alliance;

            InitializeComponent();

            createPanel();
        }
        public PageAirlineSubsidiaries(Airline airline, StandardPage parent)
        {
            this.PageParent = parent;
            this.Airline = airline;

            InitializeComponent();

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

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

            panelSubsidiaries.Children.Add(txtSubsidiariesHeader);

            lbSubsidiaryAirline = new ListBox();
            lbSubsidiaryAirline.ItemTemplate = this.Resources["SubsidiaryItem"] as DataTemplate;
            lbSubsidiaryAirline.ItemContainerStyleSelector = new ListBoxItemStyleSelector();
            lbSubsidiaryAirline.MaxHeight = GraphicsHelpers.GetContentHeight() - 100;

            showSubsidiaries();

            panelSubsidiaries.Children.Add(lbSubsidiaryAirline);

            WrapPanel panelButtons = new WrapPanel();
            panelButtons.Visibility = this.Airline.IsHuman && !(this.Airline is SubsidiaryAirline) && this.Airline.Money>100000 ? Visibility.Visible : Visibility.Collapsed;
            panelButtons.Margin = new Thickness(0,5,0,0);

            panelSubsidiaries.Children.Add(panelButtons);

            Button btnCreate = new Button();
            btnCreate.Uid = "200";
            btnCreate.SetResourceReference(Button.StyleProperty, "RoundedButton");
            btnCreate.Height = Double.NaN;
            btnCreate.Width = Double.NaN;
            btnCreate.Content = Translator.GetInstance().GetString("PageAirlineSubsidiaries",btnCreate.Uid);
            btnCreate.Click+=new RoutedEventHandler(btnCreate_Click);
            btnCreate.SetResourceReference(Button.BackgroundProperty, "ButtonBrush");

            panelButtons.Children.Add(btnCreate);

            if (this.Airline.IsHuman)
                panelSubsidiaries.Children.Add(createTransferFundsPanel());

            this.Content = panelSubsidiaries;
        }
示例#3
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);
        }