It really depends, and as HB points out, but it would be very intense even in “mild” cases.
In your example, assuming you can get into Bindings, you can check the Path property and see if it refers to your Foo property. But there are times when it does not work. For example, binding, for example {Binding Path=DataContext.Foo}. A path can be much more complicated than individual property names.
, DataContext , . , DataTemplate, . , :
<UserControl>
<ContextControl Content="Test">
<ContextControl.ContentTemplate>
<DataTemplate>
<TextBox Text="{Binding Path=Foo, Mode=TwoWay}"/>
</DataTemplate>
</ContextControl.ContentTemplate>
</ContextControl>
</UserControl>
Foo "Test", . , Source, ElementName RelativeSource Binding.
, DataContext , , , .
-, VisualTreeHelper, . .
. DependencyProperty.
, GetBindingExpression, BindingExpression. , ParentBinding.
.