G
Guest
I am new to Reflection. I am building a windows app that navigates the
control tree of a Windows form and creates XAML representing the form. I am
using reflection to get the properties of each control to create the
XmlAttributes for the Control's XAML node. The problem is, regardless of how
I set the 'Visible' property for a control in the form, its value is always
read as "False" through reflection.
Here is a snippet of my code:
Type temptype = temp.GetType();
PropertyInfo[] propinfo = temptype.GetProperties();
foreach (PropertyInfo info in propinfo)
{
object val = info.GetValue(temp, null);
....
}
where temp is the source form Control.
When info is "Visible", val = "False". This is always the case even when I
specifically set the controls Visible property to True.
Is this a bug with C#? Or is my inexperience with Reflection coming through?
Your help is appreciated.
control tree of a Windows form and creates XAML representing the form. I am
using reflection to get the properties of each control to create the
XmlAttributes for the Control's XAML node. The problem is, regardless of how
I set the 'Visible' property for a control in the form, its value is always
read as "False" through reflection.
Here is a snippet of my code:
Type temptype = temp.GetType();
PropertyInfo[] propinfo = temptype.GetProperties();
foreach (PropertyInfo info in propinfo)
{
object val = info.GetValue(temp, null);
....
}
where temp is the source form Control.
When info is "Visible", val = "False". This is always the case even when I
specifically set the controls Visible property to True.
Is this a bug with C#? Or is my inexperience with Reflection coming through?
Your help is appreciated.