0

I have a line of code behaving weirdly.

objectType = ((DependencyObject)obj).GetValue(FrameworkElementExtensions.IdProperty) as string;

The above line returns "" when i run the code or even when i debug the code. But when i execute the same statement in the immediate window it returns me the proper string. I tried executing the statement twice but still it didn't work.

Any idea why this could be happening?

Anee
  • 463
  • 9
  • 26
  • Can you please paste the code where you are displaying the value... – Muhammad Saad Sep 16 '13 at 04:19
  • @Saad khatri This particular piece of code is inside a 'if' block and this is the only statement inside the block. I execute the statement inside the immediate window at the end of the if block. Does that answer your question? – Anee Sep 16 '13 at 04:31
  • That property which i am referring to is an attached property. I suspect there could be some problem with the loading of a dll. But i am not able to figure out which one it is. Does this help anyone in answering my question? Have i provided enough information? – Anee Sep 19 '13 at 04:41

0 Answers0