Inheritance: INotifyPropertyChanged
Example #1
0
        private void lnkAirliner_Click(object sender, RoutedEventArgs e)
        {
            AirlinerMVVM airliner = (AirlinerMVVM)((Hyperlink)sender).Tag;

            TabControl tab_main = UIHelpers.FindChild <TabControl>(this.Tag as Page, "tabMenu");

            if (tab_main != null)
            {
                var matchingItem =
                    tab_main.Items.Cast <TabItem>()
                    .Where(item => item.Tag.ToString() == "Airliner")
                    .FirstOrDefault();

                matchingItem.Header     = airliner.Airliner.TailNumber;
                matchingItem.Visibility = System.Windows.Visibility.Visible;
                tab_main.SelectedItem   = matchingItem;
            }

            Frame frmContent = UIHelpers.FindChild <Frame>(this.Tag as Page, "frmContent");

            if (frmContent != null)
            {
                frmContent.Navigate(new PageUsedAirliner(airliner.Airliner)
                {
                    Tag = this.Tag
                });
            }
        }
Example #2
0
        private void cbCompare_Unchecked(object sender, RoutedEventArgs e)
        {
            AirlinerMVVM airliner = (AirlinerMVVM)((CheckBox)sender).Tag;

            airliner.IsSelected = false;

            this.SelectedAirliners.Remove(airliner);
        }
Example #3
0
        private void cbCompare_Checked(object sender, RoutedEventArgs e)
        {
            AirlinerMVVM airliner = (AirlinerMVVM)((CheckBox)sender).Tag;

            airliner.IsSelected = true;

            this.SelectedAirliners.Add(airliner);
        }
Example #4
0
        private void cbPossibleHomebase_Unchecked(object sender, RoutedEventArgs e)
        {
            var source = this.lvAirliners.Items as ICollectionView;

            source.Filter = o =>
            {
                AirlinerMVVM a = o as AirlinerMVVM;
                return(true);
            };

            this.SelectedAirliners.Clear();
        }
Example #5
0
        private void cbPossibleHomebase_Checked(object sender, RoutedEventArgs e)
        {
            //var homebases = AirlineHelpers.GetHomebases(GameObject.GetInstance().HumanAirline,);
            var source = this.lvAirliners.Items as ICollectionView;

            source.Filter = o =>
            {
                AirlinerMVVM a = o as AirlinerMVVM;

                Boolean isPossible = GameObject.GetInstance().HumanAirline.Airports.FindAll(ai => ai.getCurrentAirportFacility(GameObject.GetInstance().HumanAirline, AirportFacility.FacilityType.Service).TypeLevel > 0 && ai.getMaxRunwayLength() >= a.Airliner.Type.MinRunwaylength).Count > 0;

                return(isPossible);
            };

            this.SelectedAirliners.Clear();
        }