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?