private Animal AddAnimal()
string name = txtName.Text;
double age = Convert.ToDouble(txtAge.Text);
CategoryType animalCategory = (CategoryType)lstCategory.SelectedIndex;
Animal animalItem = null;
Bird.BirdSpecies birdSpecie = (Bird.BirdSpecies)Enum.Parse(typeof(Bird.BirdSpecies), lstCategory.SelectedItem.ToString());
animalItem = Bird.BirdFactory.CreateBird(birdSpecie);
My problem mainly revolves around trying to bind the "new" datasource for my second list depending on the choice in the first list. For instance if the bird category is chosen, how would I go about to bind the specific enums (e.g. bee, butterfly) to the second list? Do I need to use the eventhandler SelectedIndexChanged, if so, how would that be done most plausible?
Having the method run under SelectedIndexChanged seems to work. However, the binding part is more troublesome, I can't figure it out. It seems abundant to have "lstCategory.SelectedItem" go off as the string value in Enum.Parse, or am I out in the dark?