WPF: How to find out if Binding RelativeSource found its ancestor

I use RelativeSource binding with FindAncestor mode, but the binding does not work. How to debug and see if he can find his ancestor?

+4
source share
3 answers

use snoop

EDIT: You can, of course, use the usual debugging mechanisms , but I like Snoop. You can go to your control, and if your binding failed, he informs you about it

+5
source

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

+4
source

I use WPF Inspector , these are good free tools for debugging a WPF application at the XAML level.

+1
source

Source: https://habr.com/ru/post/1342101/


All Articles