<p>Say I have an interface like this:</p>

<pre><code>public interface ISomeInterface
{
...
}
</code></pre>

<p>I also have a couple of classes implementing this interface;</p>

<pre><code>public class SomeClass : ISomeInterface
{
...
}
</code></pre>

<p>Now I have a WPF ListBox listing items of ISomeInterface, using a custom DataTemplate.</p>

<p>The databinding engine will apparently not (that I have been able to figure out) allow me to bind to interface properties - it sees that the object is a SomeClass object, and data only shows up if SomeClass should happen to have the bound property available as a non-interface property. </p>

<p>How can I tell the DataTemplate to act as if every object is an ISomeInterface, and not a SomeClass etc.?</p>

<p>Thanks!</p>

The short answer is DataTemplate's do not support interfaces (think about multiple inheritance, explicit v. implicit, etc). The way we tend to get around this is to have a base class things extend to allow the DataTemplate specialization/generalization. This means a decent, but not necessarily optimal, solution would be:
```
```
public abstract class SomeClassBase
{

}

public class SomeClass : SomeClassBase
{

}

<DataTemplate DataType="{x:Type local:SomeClassBase}">
    <!-- ... -->
</DataTemplate>
```
```