Answer the question
In order to leave comments, you need to log in
How to create a common property for two classes?
Bottom line:
There is a room. The room has windows, doors, cutouts in the wall, etc. (let's call them elements).
Created two classes respectively:
class Room{}
class Element{}
class Room { public Dictionary<string,double> Params {get;set;} }
class Element { public Dictionary<string,double> Params {get;set;} }
Room room = new Room();
Element element = new Element();
room.Params["Width"];
element.Params["Width"];
public List<Element> Elements {get;set;};
element.Elements[0]["Width"]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question