BamlLocalization.BamlLocalizabilityByReflection.DependencyPropertyFromName C# (CSharp) Method

DependencyPropertyFromName() private method

private DependencyPropertyFromName ( string propertyName, Type propertyType ) : DependencyProperty
propertyName string
propertyType System.Type
return System.Windows.DependencyProperty
        private DependencyProperty DependencyPropertyFromName(string propertyName, Type propertyType)
        {
            FieldInfo fi = propertyType.GetField(propertyName + "Property", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy);
            return (fi != null)?fi.GetValue(null) as DependencyProperty:null;
        }