I have some WPF control. For example, TextBox. How to enumerate all dependency properties of that control (like XAML editor does)?
If you want name of the DependencyProperties of an element then you can do this:
var results = from prop in typeof(element).GetFields()
where prop.FieldType == typeof(DependencyProperty)
select prop.Name.Substring(0, prop.Name.Length - 8);
where 8 is length of the string "Property" which appears at the end of a dependency property!