MSFanboy
asked on
Save a properties name in a string, retrieve it again and execute it ?
Hello,
I have several properties which return a Visibility status like Visible/Collapsed to drive my gui`s usercontrols to be shown or not.
now I have 10 Properties like:
public Visibility ChangeModule1VisibilitySta tus{get;se t;}
public Visibility ChangeModule2VisibilitySta tus{get; set;}
then I have a class variable called
private static string _currentPropertyVisible;
Everytime I set a "ChangeModuleXXVisibilityS tatus" property to Visible I want to save this property in the _currentPropertyVisible variable. So when I next time change a property again I set the last current Property to Collapsed saved/cached in the _currentPropertyVisible property.
How can I achieve that in a generic way -if possible- ?
I have several properties which return a Visibility status like Visible/Collapsed to drive my gui`s usercontrols to be shown or not.
now I have 10 Properties like:
public Visibility ChangeModule1VisibilitySta
public Visibility ChangeModule2VisibilitySta
then I have a class variable called
private static string _currentPropertyVisible;
Everytime I set a "ChangeModuleXXVisibilityS
How can I achieve that in a generic way -if possible- ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That way you can access the property itself by it's index from the array later on.