How to get a list of objects that inherits the same interface?
<p>Let's say I have an interface called <code>ICar</code> and it is implemented by two classes; <code>BMW</code> and <code>Audi</code>. They contain the name and the content (visualisation of the car). I want to get the names "BMW" and "Audi" and listed them in Combo Box. So once the user selects the name the object content should appear. This what I've done so far.</p>

<pre><code>interface ICar{
    String Name {get;}
    object Content{get;}
}
</code></pre>

<p>It is inherited by two classes, <code>Audi</code> and <code>BMW</code>.</p>

<pre><code>class Audi : ICar{
    AudiCar audi = new AudiCar();

    String Name{get {return"Audi";}}
    object Content{get {return audi;}}
}


class BMW : ICar{
    BMWCar bmw = new BMWCar();

    String Name{get {return"BMW";}}
    object Content{get {return bmw;}}
}
</code></pre>

<p><code>BMWCar</code> and <code>AudiCar</code> have the visualisation of BMW and Audi car.</p>

<p>In <code>MainModel</code> class,</p>

<pre><code>Class MainModel{
    List&lt;ICar&gt; cars;
    ICar selectedCar;

    MainModel(IEnumerable&lt;ICar&gt; cars){
        this.cars = new List&lt;ICar&gt;(cars);
        this.selectedCar = this.cars.FirstOrDefault();
    } 

    IList&lt;ICar&gt; Cars {get{return this.cars;}}

    public object Car{
        get{ return this.selectedCar.Content;}
    }
}
</code></pre>

<p>In the XAML,</p>

<pre><code>xmlns:local="clr-namespace:WpfApplication1"

&lt;ComboBox ItemsSource="{Binding Cars}" DisplayMemberPath="Name" SelectedItem="{Binding SelectedCar, Mode=TwoWay}" /&gt;
</code></pre>

<p>But I'm not getting the two values "Audi" and "BMW" inside the combo box. Please tell if I've done something wrong.</p>