
{"id":925,"date":"2012-02-28T18:27:35","date_gmt":"2012-02-28T23:27:35","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=925"},"modified":"2012-02-28T18:27:35","modified_gmt":"2012-02-28T23:27:35","slug":"onewaytosource-road-to-hell-paved-with-good-intentions","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=925","title":{"rendered":"OneWayToSource: Road to Hell Paved with Good Intentions"},"content":{"rendered":"<p>Eager to fix one thing, Microsoft broke another. In .NET 3.5- <b>OneWayToSource<\/b> bindings did not require source property to have a getter. After all, it is one way from destination to source, no?<\/p>\n<p>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 <a href=\"http:\/\/karlshifflett.wordpress.com\/2009\/05\/27\/wpf-4-0-data-binding-change-great-feature\/\">here<\/a>. <a style=\"display:none\" href=\"http:\/\/www.codeproject.com\/script\/Articles\/BlogFeedList.aspx?amid=1181663\" rel=\"tag\">CodeProject<\/a><\/p>\n<p>However, while doing so they forgot that <code>OneWayToSource<\/code> is a little different. So, now it requires a getter and <a href=\"http:\/\/stackoverflow.com\/questions\/4875751\/onewaytosource-binding-seems-broken-in-net-4-0\">it is not one way anymore<\/a>.<\/p>\n<p>Why am I writing about this? This little &#8220;feature&#8221; just caused a very nasty bug in my application. Thanks to our great QA team, it had been caught before it slipped into production.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 <a href=\"https:\/\/ikriv.com\/blog\/?p=925\" class=\"more-link\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"Layout":"","footnotes":""},"categories":[4,12],"tags":[],"class_list":["entry","author-ikriv","post-925","post","type-post","status-publish","format-standard","category-hack","category-wpf"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=925"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/925\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}