BindingExpression的Silverlight UpdateTarget()变通方法

Ste*_*asz 5 silverlight binding

任何人都可以建议在Silverlight中创建WPF中存在的UpdateTarget()方法的解决方法吗?删除DP上存在的现有绑定并手动设置值不是我的选择.谢谢

Art*_*mas 7

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);
Run Code Online (Sandbox Code Playgroud)