I would suggest creating an interface that both the dogs and cats implement. Then bind to a collection of these objects and use xaml to change the appearance based on the type of object it is.
public enum AnimalType
{
Dog,
Cat
}
public interface Animal
{
AnimalType animal { get; set; }
string Name { get; set; }
}
public class Cat : Animal
{
public AnimalType animal { get; set; }
public string Name { get; set; }
public Cat()
{
animal = AnimalType.Cat;
}
}
public class Dog : Animal
{
public AnimalType animal { get; set; }
public string Name { get; set; }
public Dog()
{
animal = AnimalType.Dog;
}
}
public class MyViewModel
{
public List<Animal> MyAnimals { get; set; }
public MyViewModel()
{
MyAnimals = new List<Animal>();
var a = new Dog();
var b = new Cat();
MyAnimals.Add(a);
MyAnimals.Add(b);
}
}
Then in your XAML bind to the List (or use observable collection for auto prop updating)
<ComboBox ItemsSource="{Binding Path=MyAnimals}" Style="{StaticResource MyCombo}">
And then create a style to change the look based on your data.
<Style TargetType="ComboBox" x:Key="MyCombo">
<Style.Triggers>
<DataTrigger Binding="AnimalType" Value="Dog">
<Setter Property = "Foreground" Value="Green"/>
</DataTrigger>
</Style.Triggers>
</Style>