Add a component to the dropdown that handles this.
You initialize MyDropdown instance with desired type, for example a List of instances of class Animal. They containList contains your custom class instances: horse, cat, dog (your class, not string). The component sets the values as strings to built in DropDown.does two things then:
- sets the values as strings to built in DropDown.
- remembers the List
You can then later ask MyDropdown for 2nd value and receive your own type Animal instance Cat.
Under the hood MyComponent remembered the references your list and gives you the 2nd value from that list. This way you only have to do this once (per custom type that you want in dropdown) and can later use it semi seamlessly.
This is probably not perfect but a step in the right direction?