Extract Databinding info from DataContext Property

If DataContext Property is defined in XAML codes, you can refer to the following way to extract the specified Databinding info.

{
BindingExpression be = SomeUIElment.GetBindingExpression(FrameworkElement.DataContextProperty);
if(be != null)
{
Binding b = be.ParentBinding;
// then you take the info out, such as, Source, XPath and Mode
}
}

Advertisements

~ by Martin on August 8, 2007.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: