Use DependencyProperty.GetMetadata
on the DependencyObject
. This will give you a PropertyMetadata
value that will usually be an instance of FrameworkPropertyMetadata
. Cast to that type if possible and check the value of BindsTwoWayByDefault
.
For example:
var metadata = property.GetMetadata(target) as FrameworkPropertyMetadata;
if (metadata != null)
{
var isTwoWay = metadata.BindsTwoWayByDefault;
}