{"id":116,"date":"2013-03-28T10:37:39","date_gmt":"2013-03-28T10:37:39","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=116"},"modified":"2013-03-28T11:05:11","modified_gmt":"2013-03-28T11:05:11","slug":"embedding-code-in-your-xaml","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/embedding-code-in-your-xaml\/","title":{"rendered":"Embedding code in your XAML"},"content":{"rendered":"<p>First off a disclaimer. Just because you <strong>can<\/strong> do this doesn&#8217;t mean you should :)<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;x:Code&gt;\r\n   &lt;!&#x5B;CDATA&#x5B;\r\n   private void OKButton_Click(object sender, RoutedEventArgs e)\r\n   {\r\n      MessageBox.Show(&quot;OK Clicked&quot;);\r\n   }\r\n   ]]&gt;            \r\n&lt;\/x:Code&gt;\r\n\r\n&lt;Button Content=&quot;OK&quot; Width=&quot;80&quot; Margin=&quot;3&quot; Click=&quot;OKButton_Click&quot; \/&gt;\r\n<\/pre>\n<p>There&#8217;s not a lot to say about this one except that it&#8217;s possible to embed code in XAML. Obviously it&#8217;s easier to code it, generally speaking, in the code behind and better still in the view model. But the option is there :)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>First off a disclaimer. Just because you can do this doesn&#8217;t mean you should :) &lt;x:Code&gt; &lt;!&#x5B;CDATA&#x5B; private void OKButton_Click(object sender, RoutedEventArgs e) { MessageBox.Show(&quot;OK Clicked&quot;); } ]]&gt; &lt;\/x:Code&gt; &lt;Button Content=&quot;OK&quot; Width=&quot;80&quot; Margin=&quot;3&quot; Click=&quot;OKButton_Click&quot; \/&gt; There&#8217;s not a lot to say about this one except that it&#8217;s possible to embed code in XAML. Obviously it&#8217;s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,2,13],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","hentry","category-c","category-programming","category-wpf"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":2,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/116\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}