What you're going to need to do is extend your view model so that it exposes a collection of type B. Internally it will look something like:
public ObservableCollection<TypeA> ItemsOfTypeA { get; set; }
private ObservableCollection<TypeB> _ItemsOfTypeB;
public ObservableCollection<TypeB> ItemsOfTypeB
{
get
{
if (_ItemsOfTypeB == null)
{
var converted = ItemsOfTypeA.Select(ConvertTypeAToTypeB);
_ItemsOfTypeB = new ObservableCollection<TypeB>(converted);
}
return _ItemsOfTypeB;
}
}
private TypeB ConvertTypeAToTypeB(TypeA a)...
I've made the collections observable in this example under the assumption that the TypeA collection will be changing, and you need those changes to propagate to the UI - you'll need to handle the CollectionChanged
event on that property and deal with adding items, removing items, and refreshing the TypeB collection when it's raised. This does mean that you'll also need a way of knowing which TypeA object created a given TypeB object, so that you'll know which object to remove from the TypeB collection when a TypeA object gets removed.