I\'ve got a class FruitViewModel. It describes ViewModels for ListBox items.
On the ListView in XAML you can declare an ItemTemplateSelector. The value for this will come from a static resource or similar.
The implementation of your template selector should implement DataTemplateSelector and will basically contain the 'if' statement that chooses the correct DataTemplate based on the bound item's type. It will likely find the DataTemplate from the passed in container's resources (probably using the FindResource function).
Edit: Good link perhaps? http://www.switchonthecode.com/tutorials/wpf-tutorial-how-to-use-a-datatemplateselector Dead link.