
{"id":273,"date":"2009-09-01T17:11:48","date_gmt":"2009-09-01T21:11:48","guid":{"rendered":"http:\/\/www.ikriv.com\/blog\/?p=273"},"modified":"2009-09-01T17:11:48","modified_gmt":"2009-09-01T21:11:48","slug":"wpf-cannot-combine-bindings-and-other-text","status":"publish","type":"post","link":"https:\/\/ikriv.com\/blog\/?p=273","title":{"rendered":"WPF: Cannot Combine Bindings and Other Text"},"content":{"rendered":"<p>It is not a big deal, but still unpleasant. It is not possible to do something like<\/p>\n<p>&lt;TextBlock Text=&#8221;Speed: {Binding Path=Speed} mph&#8221; \/&gt;<\/p>\n<p>The text in the squiggles appears verbatim on screen, the binding does not occur. Instead, one needs to write<\/p>\n<p>&lt;TextBlock&gt;Speed: &lt;TextBlock Text=&#8221;{Binding Path=Speed}&#8221; \/&gt; mph&lt;\/TextBlock&gt;<\/p>\n<p>This requires significant amount of extra typing when writing, and creates serious clutter when reading. Not a big deal, but disappointing. A better solution would be to parse expressions like this and do the bindings. Of course, there will be implications: if one really wants a squiggle, they will have to escape it, just like in <code>String.Format<\/code>. Also, when looking for bindings and other extensions, WPF will have to scan the whole text instead of just checking the first character. I am not sure how serious this is, but it does not sound very ominous. I suspect WPF authors just did not have time to implement this advanced parsing.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It is not a big deal, but still unpleasant. It is not possible to do something like &lt;TextBlock Text=&#8221;Speed: {Binding Path=Speed} mph&#8221; \/&gt; The text in the squiggles appears verbatim <a href=\"https:\/\/ikriv.com\/blog\/?p=273\" 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-273","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\/273","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=273"}],"version-history":[{"count":0,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/273\/revisions"}],"wp:attachment":[{"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ikriv.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}