0

Is it possible to locate UIElement(s) on the visual tree in silverlight by inspecting the databinding somehow for a business object being bound. What I want to do is locate elements using a lambda expression (or any other means) from the element being bound something like:

var uielements = FindAllUIElements ( (businessObject)=> { businessObject.Firstname; } );

Can anyone point me in the right direction please.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
almog.ori
  • 7,839
  • 1
  • 35
  • 49

1 Answers1

0

Spoke to the guys at microsoft Hammids suggestion was to: Walk the visual tree and call FrameworkElement.GetBindingExpression(DP) for all DPs on that element. The resulting BindingExpression class has a property called DataItem that you could use to see if you’re interested in that binding.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
almog.ori
  • 7,839
  • 1
  • 35
  • 49