Aks
Aks

Reputation: 5236

WPF: How do I know if Binding RelativeSource found an ancestor

I'm using the binding RelativeSource with the FindAncestor Mode but the binding is not working. How do I debug and see if It is able to find the ancestor?

Upvotes: 5

Views: 1300

Answers (3)

Markus Hütter
Markus Hütter

Reputation: 7906

use Snoop

EDIT: you can of course use the usual debugging mechanisms, but I like Snoop the best. You can navigate to your control and if your binding failed it tells you so

Upvotes: 7

Krimson
Krimson

Reputation: 772

Or you can set PresentationTraceSources.TraceLevel on the binding. If you are using VS2010 remember to set the Data binding value in Options->Debugging->Output Window

Upvotes: 4

Jacob
Jacob

Reputation: 3698

I use WPF Inspector, it's a nice free tools for debugging WPF application in XAML level.

Upvotes: 1

Related Questions