Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight UpdateTarget() workaround for BindingExpression

Can anyone suggest a way to create in Silverlight a workaround for UpdateTarget() method that exists in WPF? Removing the existing binding that exists on the DP and setting the value manually is not an option for me. Thanks

like image 587
Stefan Szasz Avatar asked Aug 04 '10 15:08

Stefan Szasz


1 Answers

Try something like this. Replace ImageBlobMember with your XAML control's x:Name/Name and replace Image.SourceProperty with the appropriate value depending on the type of control.

BindingExpression bindExp =
 ImageBlobMember.GetBindingExpression(System.Windows.Controls.Image.SourceProperty);
Binding bind = bindExp.ParentBinding;
ImageBlobMember.SetBinding(System.Windows.Controls.Image.SourceProperty, bind);
like image 199
Art Dumas Avatar answered Sep 28 '22 05:09

Art Dumas