I have a ViewModel defined like this:
public class LocationTreeViewModel :
ObservableCollection, INotifyPropertyChanged
The only way i could do this is to use MarkupExtensions.
public class GenericType : MarkupExtension
{
private readonly Type _of;
public GenericType(Type of)
{
_of = of;
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return typeof(LocationTreeViewModel<>).MakeGenericType(_of);
}
}
And to use it i just need to do this: