WPF Bindings

I am kinda tired of this MVVM/bindings crap. I feel like my hands are tied, for variety of reasons:

1. Bindings don’t work with properties of properties, because they rely on visual tree to find the data context. E.g. if you have a “Settings” object, binding its properties to anything but static resources is problematic. Infragistics field settings is the most annoying example of that.

2. Binding tend to fail in peculiar ways, and this sends you to a wild goose chase.

3. Bindings timing is a mystery. There is no guarantee when exactly the binding will actually fire. This may and will lead to funky race conditions if your logic depends on more than one binding.

4. MVVM isolates you from the view. To do simple things like play an animation or change focus you must jump through ridiculous hoops and write loads of indirect code known as “attached behaviors”.

All this makes me wish to return to the good old passive view model. Encapsulation – yes. Crippling – no. A little bit more code, but at least you can do whatever you want. The only thing that leaves a shadow of a doubt in my head is data templates for item controls. These do need bindings, but I am sure complex templates can be easily converted to passive view, I just need to think of a way to do it.

Posted in

Leave a Reply

Your email address will not be published. Required fields are marked *