I have a bunch of textblock objects in my program, and the foreground color of all of these is white. I want to find out what causes it to be this way.
Is there any means in Visual Studio of tracing back the origin of a property value, whether by template or containing object?
EDIT: After issuing a bounty, this question got a lot of interesting responses with a variety of proposed approaches. I think there's something there, but so far I have not been able to figure out how to apply any of these more effectively than just trial and error hunting through the code. If anybody wants to take up the charge and advance one of the responses as useful, I'm watching.
I tend to use Snoop to poke around the visual tree when I need to understand where bound values are coming from. You can use it to look at your control properties and follow either bindings back to DataContexts or walk up and down the tree to see where a value might be inherited from.
Fire up Snoop, drag the crosshairs over your WPF application (or refresh the process list and select from the dropdown), then position your mouse pointer over your TextBlock control and Ctrl-Shift-LeftClick. Snoop will zoom the visual tree in on your control and allow you to look at or edit your control properties.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With