Lets say we have this interface:
interface IVehicle { ... }
And some classes implementing it:
class Car : IVehicle { ... }
class Boat : IVehicle { ... }
class Plane : IVehicle { ... }
In my user interface I have a FlowLayoutPanel
and access to some sort of an IEnumerable<IVehicle>
with a number of various IVehicle
objects.
Now I want to create a UserControl
for each of the vehicles and add it to the FlowLayoutPanel
. The controls will be kind of similar, but since there are vehicles of different types some of the controls might need to look slightly different or work in a different way so that the user can easily work with his vehicles. How can I best solve this without too much clutter?