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

3

5

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?

Bearnard answered 3/3, 2011 at 10:25 Comment(0)
F
7

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

Feu answered 3/3, 2011 at 10:27 Comment(0)
Q
4

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

Quadrennium answered 3/3, 2011 at 10:33 Comment(0)
A
1

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

Acanthus answered 17/4, 2016 at 20:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.