TextBlock.GetBindingExpression returning NULL
.net, c#, wpf
Solution
This method is really just a convenience wrapper around the BindingOperations.GetBindingExpression method. GetBindingExpression passes the current instance and the dp parameter to BindingOperations.GetBindingExpression.
If your binding is a MultiBinding, use BindingOperations.GetMultiBinding.
See "Remarks" section and notes in "Examples" section here.
Problem
The following is returning NULL for me, any idea why? ``` MultiBinding collectionRange = new MultiBinding(); collectionRange.Bindings.Add(new Binding("CurrentPosition") { Source = View }); collectionRange.Bindings.Add(new Binding("Count") { Source = View }); collectionRange.StringFormat = "{0} of {1}"; tbFooter.SetBinding(TextBlock.TextProperty, collectionRange); var x = tbFooter.GetBindingExpression(TextBlock.TextProperty); ``` The MultiBinding is fine - the properties are valid and it renders on the UI ..I just can't seem to grab the binding expression (x is always NULL) Am I using this method wrong?