Testing wpf binding

I am involved in a WPF learning process where data binding is supposed to be one of the strong suits. When I make a win forms application because I don't trust data binding, I use what Fowler called assembler and just do it by hand, which makes testing easier as well.

I've read Jeremy Miller's blog enough to see that he has data binding issues (even with wpf) and gets around it, but I've never seen a clear example of how he does it.

I like what I see so far with the rendering and layout capabilities of wpf, but I'm just not sure about MS data binding technology. My question is, does anyone have any reasons why data binding is so good in wpf that you can easily separate concerns and test them, and if not, what is the main idea you are using as an alternative?

+2


source to share


1 answer


I don't want to speak for Jeremy, but I find his beef with data binding is less about the binding itself, and more about how it leads to tricky debugging / testing / saving code. This is certainly the case in WPF / SL when you include your bindings in XAML, because they can break without knowing it prior to execution (and maybe not even then). A good fluent interface can become a must for an absolute pleasure to write, debug, and maintain. This was one of my motives for writing Truss .

However, doing data binding in your code can break designer and developer collaboration. Blend doesn't execute code when designers open UserControl

or whatever. Therefore, any bindings written as code will not be included.



In an ideal world, we wouldn't be forced to choose between maintainability and design collaboration. But this is similar to what is happening now.

+2


source







All Articles