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 }); } }
private void cbCompare_Unchecked(object sender, RoutedEventArgs e) { AirlinerMVVM airliner = (AirlinerMVVM)((CheckBox)sender).Tag; airliner.IsSelected = false; this.SelectedAirliners.Remove(airliner); }
private void cbCompare_Checked(object sender, RoutedEventArgs e) { AirlinerMVVM airliner = (AirlinerMVVM)((CheckBox)sender).Tag; airliner.IsSelected = true; this.SelectedAirliners.Add(airliner); }
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(); }
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(); }