
{"id":581,"date":"2010-08-24T23:07:04","date_gmt":"2010-08-25T03:07:04","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=581"},"modified":"2010-08-24T23:07:04","modified_gmt":"2010-08-25T03:07:04","slug":"cant-have-a-binding-to-binding","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=581","title":{"rendered":"Can\u2019t have a binding to binding"},"content":{"rendered":"<p>Let&#8217;s say we want to display a list of countries, and depending on the user input we want to show either the capital city, population, or the language spoken in the country alongside the country name, like in the application below:<\/p>\n<p><a href=\"http:\/\/www.ikriv.com\/\/blog\/wp-content\/uploads\/2010\/08\/DynamicBinding.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.ikriv.com\/\/blog\/wp-content\/uploads\/2010\/08\/DynamicBinding.png\" alt=\"Dynamic binding screen shot\" title=\"DynamicBinding\" width=\"525\" height=\"350\" class=\"alignnone size-full wp-image-582\" \/><\/a><\/p>\n<p>The only way to achieve that is to change binding in code. You cannot have something like<\/p>\n<p><code>&lt;Binding Path=\"{Binding SelectedField}\" \/&gt;<\/code><\/p>\n<p>because <code>Path<\/code> is not a dependency property. \ud83d\ude41 <a style=\"display:none\" href=\"http:\/\/www.codeproject.com\/script\/Articles\/BlogFeedList.aspx?amid=1181663\" rel=\"tag\">CodeProject<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s say we want to display a list of countries, and depending on the user input we want to show either the capital city, population, or the language spoken in <a href=\"https:\/\/ikriv.com\/blog\/?p=581\" 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":[12],"tags":[],"class_list":["entry","author-ikriv","post-581","post","type-post","status-publish","format-standard","category-wpf"],"_links":{"self":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/581","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=581"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/581\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=581"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=581"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=581"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}