If I understand the problem correctly, one way to go would be to introduce an interface like the following:
interface IItemLinkProvider
{
string GetTitle();
string GetSubtitle();
string GetImage();
}
You can implement this interface with all the classes you'd like to support. Thus you can modify the constructor of your LinkSet like this:
public class LinkSet
{
public List<ItemLink> Links { get; set; }
public LinkSet(IEnumerable<IItemLinkProvider> items)
{
Links = items.Select(i => new ItemLink
{
Title = i.GetTitle(),
Subtitle= i.GetSubtitle(),
Image = i.GetImage()
}).ToList();
}
}
This way you can decouple your LinkSet view model from the concrete model types, and can make it only depend on the abstraction (the IItemLinkProvider
interface), which is always a good thing.
(Note that you are going to need C# 4.0 to use this constructor properly because covariance of generic interfaces has been introduced in C# 4.0)