OneWayToSource: Road to Hell Paved with Good Intentions

Eager to fix one thing, Microsoft broke another. In .NET 3.5- OneWayToSource bindings did not require source property to have a getter. After all, it is one way from destination to source, no?

As many people complained that their properties are not getting re-read by the UI after setting (to give business logic a chance to fix user input on the fly), Microsoft listened and implemented this feature in .NET 4, as described here.

However, while doing so they forgot that OneWayToSource is a little different. So, now it requires a getter and it is not one way anymore.

Why am I writing about this? This little “feature” just caused a very nasty bug in my application. Thanks to our great QA team, it had been caught before it slipped into production.

Leave a Reply

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