[Solved] How to store reference to Class’ property and access an instance’s property by that? [closed]


It looks like you’re looking for Reflection

Example:

public class A
{
  int integer{get; set;}
}

PropertyInfo prop = typeof(A).GetProperty("integer");
A a = new A();
prop.GetValue(a, null);
prop.SetValue(a, 1234, null);

You still need a reference to set/get values, but this seems about what you’re wanting.

1

solved How to store reference to Class’ property and access an instance’s property by that? [closed]