private void researchList_SelectionChanged(object sender, SelectionChangedEventArgs e) { capital_city_research_data data = researchList.SelectedItem as capital_city_research_data; if (data == null) // set filter changed { return; } _SelectedResearchData = data; researchGrid.DataContext = data; if (data.Description != 0) { npc_text t = WorldWorker.GetNpcText(data.Description); _SelectedNpcText = t; if (t != null) { broadcast_text b = WorldWorker.GetBroadCastText(t.BroadcastTextID0); _SelectedBroadcastText = b; if (b != null) { Binding binding = new Binding(); binding.Source = b; binding.Path = new PropertyPath("MaleText"); descriptionText.SetBinding(TextBox.TextProperty, binding); } } } else { _SelectedNpcText = null; _SelectedBroadcastText = null; descriptionText.Text = ""; } if (data.Spell != 0) { capital_city_research_trainer_data t = WorldWorker.GetResearchSpell(data.Spell); _SelectedResearchSpell = t; } else { _SelectedResearchSpell = null; } if (data.Item != 0) { capital_city_research_vendor_data t = WorldWorker.GetResearchItem(data.Item); _SelectedResearchItem = t; } else { _SelectedResearchItem = null; } researchSpellGrid.DataContext = _SelectedResearchSpell; researchItemGrid.DataContext = _SelectedResearchItem; _ResearchQuest = WorldWorker.GetResearchQuests(_SelectedResearchData.QuestSet); researchQuestList.ItemsSource = _ResearchQuest; }