I have some WPF control. For example, TextBox. How to enumerate all dependency properties of that control (like XAML editor does)?
Try
var fieldInfos = typeof(TextBox).GetFields( BindingFlags.Public | BindingFlags.Static).Where(x=>x.FieldType == typeof(DependencyProperty)); foreach (var fieldInfo in fieldInfos) { Console.WriteLine(fieldInfo.Name); }