I want to build a generic Observable Collection, that load values from the database to its items. In order to assign the values to the property of the item, I want to create an instance of the object. However, I get an error for the Activator.CreateInstance Command: "'T' is a type, which is not valid in the given context"
public class ListBase<T> : ObservableCollection<T>
{
    private DbTable tab;
    public ListBase()
    {
        tab = DbCatalog.Tables.Where(x => x.ModelObjectType == typeof(T).Name).First();
        LoadValues();
    }
    private void LoadValues()
    {
        foreach (DataRow r in tab.GetValues.Rows)
        {
            T o = (T)Activator.CreateInstance(T); //<-- The (T) at the end throws the error
            var p = o.GetType().GetProperty("xyz_property");
            if (p.PropertyType == typeof(int))
            {
                p.SetValue(o, Convert.ToInt32(r["xyz_fromDB"]));
            }
        }
    }
}



CreateInstance(typeof(T))