Question: Is it possible to instantiate a template class at runtime for example:

```
Type type = Type.GetType("iTry.Workflow.Person");
WorkflowPropertyViewModel<type> propViewModel = new WorkflowPropertyViewModel<type>();

```

This obviously does not work. Is there some other way to do it?

The Generic class looks like the following:

```
public class WorkflowPropertyViewModel<T> : IProperty<T>  
{
    public Task<T> ValueAsync
    {
        get;
        set;
    }

    public T Value
    {
        get;
        set;
    }

    public IQueryable<T> PossibleItems
    {
        get;
        set;
    }
}

```

Answer: 
You can create an object of any type given a Type object:

```
object o = Activator.CreateInstance(type);

```

This assumes the type has a default constructor. There are other Activator methods for passing constructor parameters:

<http://msdn.microsoft.com/en-us/library/wccyzw83.aspx>

In order to get a specific generic type you can call MakeGenericType on your generic type definition

<http://msdn.microsoft.com/en-us/library/system.type.makegenerictype.aspx>

So putting it altogether it looks something like:

```
var type = Type.GetType("iTry.Workflow.Person");
var genericType = typeof(WorkflowPropertyViewModel<>).MakeGenericType(type);
var o = Activator.CreateInstance(genericType);

```
Try this:

```
object o = Activator.CreateInstance(typeof(WorkflowPropertyViewModel<>).MakeGenericType(new Type[] {type}));

```

Note that in code you cannot easily reference that type, unless it implements another non-generic interface - so you have to use object instead or make use of more reflection.