Is there a way to get the source object in the Convert method of a Converter class. I know how to get the converted property but is it possible to get the object that the property belongs to?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As Darin says, this isn’t possible with an IValueConverter. You can’t assign it to ConverterParameter either because it’s not a dependency property. However it is possible if you go down the route of MultiBinding. That way, you can actually bind to your calling object, and the IMultiValueConverter will receive the object in the binding value array. This MSDN thread has a quick example…
http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/9f3e4f6d-20d2-4c13-90a2-7c157ed4f8c3/