You can get DependencyPropertyDescriptor using DependencyPropertyDescriptor.FromName method and then get dependency property identifier from this descriptor.
var descriptor = DependencyPropertyDescriptor.FromName(
propertyName,
dependencyObject.GetType(),
dependencyObject.GetType());
// now you can set property value with
descriptor.SetValue(dependencyObject, value);
// also, you can use the dependency property itself
var property = descriptor.DependencyProperty;
dependencyObject.SetValue(property, value);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…