wpf - How to retrieve a specific dataBinding from MultiBindingExpression? -
in application retrieve binding 1 object , assign another. , objects has multibinding instead. , want retrieve specific binding. how do that?
for non multi-bindings use following code:
label lbl = (label)sender; bindingexpression bindingexpression = lbl.getbindingexpression.(label.contentproperty); binding parentbinding = bindingexpression.parentbinding; path = parentbinding.xpath.tostring(); label.setbinding(label.contentproperty, parentbinding);
i have figured out. couldn't binding directly label, able use bindingoperations.getmultibindingexpression static method retrieve multibindingexpression , getting right binding.
here code that:
multibindingexpression multibindingexpression = bindingoperations.getmultibindingexpression(lbl, label.contentproperty); binding parentbinding = ((bindingexpression)multibindingexpression.bindingexpressions[1]).parentbinding;
Comments
Post a Comment