Propagate properties to parent control C#
- by Martin Ch
Is there any way how to propagate properties from child control into parent - so I can access property like - Parent.Property1 instead of Parent.Child.Property1 ? I cant use inheritance - my parent cant be extended child type - its inherited from different class.
Also I dont wanna add code for each property from child to parent like:
public object Property1
{
get{ return Child.Property1; }
set{ ChildProperty1 = value; }
}
Maybe using reflection - something like this?
public PropertyInfo[] Properties
{
get{ return Child.GetType().GetProperties(); }
set{ Child.GetType().GetProperties().SetValue() = value.GetValue()}
}
Thanks