public SelectRankWindow() { InitializeComponent(); var service = new TaxaService(PluginManager.Instance.User); _map = service.GetTaxonRankMap(); var kingdoms = service.GetKingdomList().Where((kingdom) => { return(!string.IsNullOrWhiteSpace(kingdom.KingdomCode)); }); cmbKingdom.SelectionChanged += new SelectionChangedEventHandler(cmbKingdom_SelectionChanged); cmbKingdom.ItemsSource = kingdoms; if (kingdoms.Count() > 0) { cmbKingdom.SelectedIndex = 0; } this.DataContext = this; }