Reputation: 21251
I am wiring up a binding in code (NOT in XAML).
Is there any way of determining whether the binding path is valid? The obvious candidate is IsDataBound property, but this is always true even if the path is wrong.
Currently I am fudging it by supplying a fallback value and testing for that, but is there a better way?
Upvotes: 0
Views: 116
Reputation: 747
If you don't mind upgrading your project to Silverlight 5, check out the Silverlight 5 RC. With SL5 debugging databinding has become a breeze since it enables you to set breakpoints inside your XAML code where the binding happens.
Check out this article for a full overview how this works.
Upvotes: 1
Reputation: 2947
I guess you could use a ValueConverter, which you can add pretty easily in code to your binding and will let you evaluate what is going on between the source and target properties.
Upvotes: 1
Reputation: 184607
The Output-window of Visual Studio is a good place to start, for a more indepth guide on debugging bindings see this MSDN article.
Upvotes: 1