I got a custom Type that as a couple of fields, and I’d like to only get Dependency Properties.
Here is the code that returns all properties :
propertyInfos = myType.GetProperties();
foreach (PropertyInfo propertyInfo in propertyInfos)
{
Console.WriteLine(propertyInfo.Name);
}
I know I have to add something in parameter for GetProperties, somethg with BindingFlags.XXX but I check everything that is possible as XX and didn’t find something that sounds good to me…
Dependency properties are static fields of type DependencyProperty
If you want to get dependency properties of parents of that control too then you can use the following method: