<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-19528557</id><updated>2024-09-09T07:32:44.560-07:00</updated><title type='text'>X-SOFT</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>13</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-19528557.post-6203172463907183768</id><published>2009-12-09T14:32:00.001-08:00</published><updated>2009-12-11T13:48:21.768-08:00</updated><title type='text'>One More Reason To Hate DOS Command</title><content type='html'>&lt;p&gt;Today one of my command script starts to fail mysteriously. I had run it many times before. The failing fragment seems to be like this:&lt;/p&gt;  &lt;p class=&quot;code&quot;&gt;if Exist &amp;quot;%ProgramFiles(x86)%\Microsoft Visual Studio 10.0&amp;quot; (    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Set VS10=%ProgramFiles(x86)%\Microsoft Visual Studio 10.0     &lt;br /&gt;)&lt;/p&gt;  &lt;p&gt;At a glance this looks perfectly fine. I can even run the individual commands on the command line. The “if” statement runs fine, the “set” statement also runs ok. However, running them together like above results in this:&lt;/p&gt;  &lt;p class=&quot;code&quot;&gt;\Microsoft was unexpected at this time.&lt;/p&gt;  &lt;p&gt;I scratched my head for quite a while. Looking for help in “if”, “cmd”, or searching online did not help either. Is this a Windows 7 incompatibility?&lt;/p&gt;  &lt;p&gt;It was just by luck that I suddenly noticed the “(“ and “)”. Apparently the “set” statement contains “(“ and “)”, which likely confused the command host. More experiments reveal that even if only the variable value contains “(“ / “)”, this problem still happens. The command host expands the variables upon “if” statement being seen. As a result, the script below still won’t run:&lt;/p&gt;  &lt;p class=&quot;code&quot;&gt;Set ProgramFilesX86=%ProgramFiles(x86)%    &lt;br /&gt;if Exist &amp;quot;%ProgramFilesX86%\Microsoft Visual Studio 10.0&amp;quot; (     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Set VS10=%ProgramFilesX86%\Microsoft Visual Studio 10.0     &lt;br /&gt;) &lt;/p&gt;  &lt;p&gt;To work around this issue, the final solution I come up with is to combine “delayed variable expansion”:&lt;/p&gt;  &lt;p class=&quot;code&quot;&gt;&lt;strong&gt;setlocal ENABLEDELAYEDEXPANSION&lt;/strong&gt;    &lt;br /&gt;    &lt;br /&gt;Set ProgramFilesX86=%ProgramFiles(x86)%     &lt;br /&gt;if Exist &amp;quot;%ProgramFilesX86%\Microsoft Visual Studio 10.0&amp;quot; (     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Set VS10=&lt;strong&gt;!ProgramFilesX86!&lt;/strong&gt;\Microsoft Visual Studio 10.0     &lt;br /&gt;) &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:eed3a9a9-53ea-4864-aa50-985e79135c77&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/DOS&quot; rel=&quot;tag&quot;&gt;DOS&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/command&quot; rel=&quot;tag&quot;&gt;command&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/x86&quot; rel=&quot;tag&quot;&gt;x86&lt;/a&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/6203172463907183768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/6203172463907183768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/6203172463907183768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/6203172463907183768'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2009/12/one-more-reason-to-hate-dos-command.html' title='One More Reason To Hate DOS Command'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-6781213957407789</id><published>2009-12-06T08:49:00.001-08:00</published><updated>2009-12-06T08:51:39.759-08:00</updated><title type='text'>PowerShell Splat Operator</title><content type='html'>&lt;p&gt;There is a new “splat” operator in PowerShell v2 which is quite useful but not well documented. The best info I can find is from &lt;a href=&quot;http://bartdesmet.net/blogs/bart/archive/2008/03/24/windows-powershell-2-0-feature-focus-splat-split-and-join.aspx&quot;&gt;this blog&lt;/a&gt;. From a PowerShell console I can see help content of “about_Split” and “about_Join”, but not “about_Splat”, or anything mentioned in “about_Operators”.&lt;/p&gt;  &lt;p&gt;It is described that this new splat operator “@” can be used to pass a collection as parameters to a function. It’s easy to find out the details by experiments. First, draft a test function:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 9pt&quot;&gt;&lt;span&gt;PS&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;function&lt;/span&gt;&lt;span&gt; Echo-Args&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;gt;&amp;gt;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;gt;&amp;gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; echo &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;=== Args: ($($args.Length)) ===&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;gt;&amp;gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; echo $args&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;gt;&amp;gt;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;}&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; &lt;/span&gt;    &lt;br /&gt;&lt;span&gt;PS&amp;gt; Echo-Args a b c 1 2 3&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;=== Args: (6) ===&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;a&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;b&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;c&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;1&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;2&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;3&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Try it out with an array:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 9pt&quot;&gt;&lt;span&gt;PS&amp;gt; $a &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;@(&lt;/span&gt;&lt;span&gt;1&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;,&lt;/span&gt;&lt;span&gt;2&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;,&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; Echo-Args $a&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;=== Args: (1) ===&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;1&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;2&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;3&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; Echo-Args @a&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;=== Args: (3) ===&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;1&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;2&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;3&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;See the difference of passing “$a” and “@a”? “$a” passes the whole array as one parameter. “@a” passes the elements as parameters.&lt;/p&gt;  &lt;p&gt;To admit it, I was testing this for several days, but every time I ran into an “invalid operator” kind of error, because I was using “@$a”.&lt;/p&gt;  &lt;p&gt;Now try it out with a hash table:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 9pt&quot;&gt;&lt;span&gt;PS&amp;gt; $a &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;@{&lt;/span&gt;&lt;span&gt;a&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;1;b&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;2;c&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;}&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; Echo-Args @a&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;=== Args: (6) ===&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;c&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;3&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;b&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;2&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;a&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;1&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;function&lt;/span&gt;&lt;span&gt; f&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;(&lt;/span&gt;&lt;span&gt;$A&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;,&lt;/span&gt;&lt;span&gt; $B&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;,&lt;/span&gt;&lt;span&gt; $C&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;)&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;{&lt;/span&gt;&lt;span&gt; $PSBoundParameters &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;}&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; f @a&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;Key&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Value&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;---&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -----&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;C&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;B&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;PS&amp;gt; $a &lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;@{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;-a&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;1;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;-b&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;2;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;-c&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;=&lt;/span&gt;&lt;span&gt;3&lt;/span&gt;&lt;span style=&quot;color: rgb(0,128,128)&quot;&gt;}&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;PS&amp;gt; f @a&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;Key&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Value&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;---&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; -----&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;A&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 1&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;C&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 3&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;B&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; 2&lt;/span&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Now this is interesting. So you can splat and pass a hash table of parameters to a function, and PowerShell will always try to “do it right”. When the function is expecting named parameters, PowerShell can match them with or without leading “-“.&lt;/p&gt;  &lt;p&gt;In summary, this splat operator is quite useful when you just want to pass some collection of parameters to another function, e.g. the current “$args” or “$PSBoundParameters”, with or without modification.&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style=&quot;padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px&quot; id=&quot;scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1349787a-f0fc-47fa-9e63-fa8921c2195c&quot; class=&quot;wlWriterEditableSmartContent&quot;&gt;Technorati Tags: &lt;a href=&quot;http://technorati.com/tags/PowerShell&quot; rel=&quot;tag&quot;&gt;PowerShell&lt;/a&gt;,&lt;a href=&quot;http://technorati.com/tags/splat&quot; rel=&quot;tag&quot;&gt;splat&lt;/a&gt;&lt;/div&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/6781213957407789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/6781213957407789' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/6781213957407789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/6781213957407789'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2009/12/powershell-splat-operator.html' title='PowerShell Splat Operator'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-2196742169592254485</id><published>2009-11-28T08:56:00.001-08:00</published><updated>2009-11-28T08:56:48.733-08:00</updated><title type='text'>WPF Command</title><content type='html'>&lt;p&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://wwcuea.bay.livefilestore.com/y1mZBzImFvRAyZlIHHnx3sKVV3KJMLlvx-oE7colxaEkXeMDNRKguFAoGiU7UsvGt7XIjjbhgXA03XCbtULGZKgS-krKSOZAZXg8wBkn25Q6r96icOBKZb_tjCQenE1q2h2CFM1MeStzloUEmsG8_8KGw/image6.png&quot; width=&quot;303&quot; height=&quot;303&quot; /&gt; &lt;/p&gt;  &lt;p&gt;In WPF Skinning, I was using old school MenuItem_Click event handling. WPF has a more powerful commanding system. To implement the same functionality with WPF command, first create a command in Window1:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;readonly&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedCommand&lt;/span&gt;&lt;span&gt; ChangeSkin = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedCommand&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;ChangeSkin&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Window1&lt;/span&gt;&lt;span&gt;));&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Bind the menu items to be sources of this command. Each binds to the same command with a different parameter. Now MenuItem_Click event handling can be removed and IsChecked binding can be one-way. I’ll use the command to change skin and only need menu items to display correct check marks.&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Default&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Default&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Default}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Green&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Green&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Green}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Red&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Red&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Red}&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The command will bubble up until being handled. Create a command binding at the main window:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;CommandBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Executed&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;ChangeSkin_Executed&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Fill the command handling code:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;private&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;void&lt;/span&gt;&lt;span&gt; ChangeSkin_Executed(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; sender, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ExecutedRoutedEventArgs&lt;/span&gt;&lt;span&gt; e)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; Skin = (&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt;)e.Parameter;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; e.Handled = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;true&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Now this should work the same as previous version.&lt;/p&gt;  &lt;p&gt;The menu items do not have keyboard short-cuts (KeyGestures) yet. To make keyboard inputs invoke this command, add key bindings:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.InputBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;KeyBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Default&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;D&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Modifiers&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Ctrl&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;KeyBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Green&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;G&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Modifiers&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Ctrl&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;KeyBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Red&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;R&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Modifiers&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Ctrl&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.InputBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;This makes the key gestures work, but they don’t show up in the menu items. They need to be specified in menu items, e.g.:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Green&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.ChangeSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; CommandParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Green&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;InputGestureText&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Ctrl+G&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Green}&amp;quot;/&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Alternatively, I can create 3 different commands and omit the above InputGestureText and even Header text:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;readonly&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedCommand&lt;/span&gt;&lt;span&gt; DefaultSkin = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedUICommand&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;_Default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Default&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Window1&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;InputGestureCollection&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;[] { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Key&lt;/span&gt;&lt;span&gt;.D, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ModifierKeys&lt;/span&gt;&lt;span&gt;.Control) }));&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;readonly&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedCommand&lt;/span&gt;&lt;span&gt; GreenSkin = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedUICommand&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;_Green&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Green&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Window1&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;InputGestureCollection&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;[] { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Key&lt;/span&gt;&lt;span&gt;.G, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ModifierKeys&lt;/span&gt;&lt;span&gt;.Control) }));&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;readonly&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedCommand&lt;/span&gt;&lt;span&gt; RedSkin = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedUICommand&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;_Red&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Red&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Window1&lt;/span&gt;&lt;span&gt;),&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;InputGestureCollection&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;[] { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;KeyGesture&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Key&lt;/span&gt;&lt;span&gt;.R, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ModifierKeys&lt;/span&gt;&lt;span&gt;.Control) }));&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;private&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;void&lt;/span&gt;&lt;span&gt; ChangeSkin_Executed(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; sender, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ExecutedRoutedEventArgs&lt;/span&gt;&lt;span&gt; e)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; Skin = ((&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedUICommand&lt;/span&gt;&lt;span&gt;)e.Command).Name;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; e.Handled = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;true&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;This time UI xaml is much cleaner:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;CommandBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.DefaultSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Executed&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;ChangeSkin_Executed&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;CommandBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.GreenSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Executed&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;ChangeSkin_Executed&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;CommandBinding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.RedSkin&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Executed&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;ChangeSkin_Executed&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.CommandBindings&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;framePanel&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; LastChildFill&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;True&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Menu&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; IsMainMenu&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; DockPanel.Dock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Top&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Skins&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.DefaultSkin&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Default}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.GreenSkin&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Green}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Command&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;local:Window1.RedSkin&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Mode&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=OneWay,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Red}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Menu&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Background&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DynamicResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; bgbrush&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;}&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin}&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Center&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/2196742169592254485/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/2196742169592254485' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/2196742169592254485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/2196742169592254485'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2009/11/wpf-command.html' title='WPF Command'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-409055018330637333</id><published>2009-11-28T08:55:00.001-08:00</published><updated>2009-11-28T08:55:56.994-08:00</updated><title type='text'>WPF Skinning</title><content type='html'>&lt;p&gt;I was planning to learn about WPF skinning for this week. Here we go.&lt;/p&gt;  &lt;p&gt;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://wwcuea.bay.livefilestore.com/y1mHIQcT5MjGU-zUcZLu-QNqT8omykm11zjgT1IlEPWvo5OvkRenV_O-6dfs765xogb2pnxRfittZAjDG37z1HkNKyVv5Ele--goG666BWE8M4KHTBqiXoY1yxst61PPWX-os_SFeyQKxsmtpNp949Q9Q/image[8].png&quot; width=&quot;303&quot; height=&quot;303&quot; /&gt;&amp;#160;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://wwcuea.bay.livefilestore.com/y1mUU6mHc_olgjySb61JcjSO31nQYflxU824oGg-RusYhrnkl5x-ee5s0ujfz1CRgDWm6KC6lHtV1Chv1mR_J1dFt8Dvm78Pqhat8E1E5h34DbImSRwKS_cLbN7RBJT2RINuJcJWUOMe4dTxpornWTFKA/image[12].png&quot; width=&quot;196&quot; height=&quot;184&quot; /&gt; &lt;/p&gt;  &lt;p&gt;Create 3 sets of “skin” – WPF resource dictionaries:&lt;/p&gt;  &lt;p&gt;Default:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;bgbrush&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;White&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;0&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Blue&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;1&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Green:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;bgbrush&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;White&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;0&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Green&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;1&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Red:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;bgbrush&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Cyan&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;0&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;GradientStop&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Color&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Red&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Offset&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;1&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;LinearGradientBrush&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;In App.xaml, use the default skin:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Application.Resources&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Source&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Skins\Default.xaml&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Application.Resources&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I want to use a menu to switch the skins, and put a check mark at the current skin. This sounds like a property binding. So create a dependency property on the main window class and perform the skin switching when property changed:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;readonly&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;DependencyProperty&lt;/span&gt;&lt;span&gt; SkinProperty = &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;DependencyProperty&lt;/span&gt;&lt;span&gt;.Register(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Skin&amp;quot;&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt;), &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;typeof&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Window1&lt;/span&gt;&lt;span&gt;), &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;PropertyMetadata&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Default&amp;quot;&lt;/span&gt;&lt;span&gt;, OnSkinChanged));&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt; Skin&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;get&lt;/span&gt;&lt;span&gt; { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;return&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt;)GetValue(SkinProperty); }&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;set&lt;/span&gt;&lt;span&gt; { SetValue(SkinProperty, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;value&lt;/span&gt;&lt;span&gt;); }&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;private&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;void&lt;/span&gt;&lt;span&gt; OnSkinChanged(&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;DependencyObject&lt;/span&gt;&lt;span&gt; d, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;DependencyPropertyChangedEventArgs&lt;/span&gt;&lt;span&gt; e)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt; skin = e.NewValue &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;as&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span&gt; res = (&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;ResourceDictionary&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Application&lt;/span&gt;&lt;span&gt;.LoadComponent(&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Uri&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt;.Format(&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;@&amp;quot;Skins\{0}.xaml&amp;quot;&lt;/span&gt;&lt;span&gt;, skin), &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;UriKind&lt;/span&gt;&lt;span&gt;.Relative));&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Application&lt;/span&gt;&lt;span&gt;.Current.Resources = res;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;I want a menu item to be checked if the current Skin matches the menu item. Looks like I need a value converter check Equals… I can’t find an existing one. On the other hand, when a menu item becomes checked, I want to update the Skin property. I end up creating a value converter:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;class&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;SkinEqualsConverter&lt;/span&gt;&lt;span&gt; : &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;IValueConverter&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; #region&lt;/span&gt;&lt;span&gt; IValueConverter Members&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; Convert(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; value, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Type&lt;/span&gt;&lt;span&gt; targetType, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; parameter,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;CultureInfo&lt;/span&gt;&lt;span&gt; culture)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;return&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt;.Equals(value, parameter);&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; ConvertBack(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; value, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Type&lt;/span&gt;&lt;span&gt; targetType, &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; parameter,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;CultureInfo&lt;/span&gt;&lt;span&gt; culture)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; {&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;return&lt;/span&gt;&lt;span&gt; (&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;bool&lt;/span&gt;&lt;span&gt;)value ? parameter : &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;DependencyProperty&lt;/span&gt;&lt;span&gt;.UnsetValue;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; #endregion&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Now if a menu item is clicked, we only need to set its IsChecked to true and let data binding update the Skin. Setting MenuItem.IsCheckable to true almost satisfies my requirements. When clicked and IsChecked is turned on, everything works. However, I can’t prevent a user to click it again and uncheck the menu item. In that case Skin is not changed, but the check mark is gone. Finally I decide to handle the click manually:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;private&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;void&lt;/span&gt;&lt;span&gt; SkinItem_Click(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; sender, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedEventArgs&lt;/span&gt;&lt;span&gt; e)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;MenuItem&lt;/span&gt;&lt;span&gt; menu = (&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;MenuItem&lt;/span&gt;&lt;span&gt;)sender;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; menu.IsChecked = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;true&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;The main window xaml is like the following. When a menu item is clicked, the above handler would turn on IsChecked, the binding will invoke the converter to get the parameter skin name, and bind that name to the above Skin property, causing the skin switch. Other menu items will uncheck because the binding invokes the converter and check if the current Skin equals to the converter parameter skin. In the UI I use DynamicResource to refer to skin resources so that UI refreshes dynamically when skin resources are replaced at runtime.&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Class&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;SkinApp.Window1&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;clr-namespace:SkinApp&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;mainWindow&amp;quot;&lt;/span&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;    &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Window1&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Height&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;300&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Width&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;300&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.Resources&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;local&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;SkinEqualsConverter&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;skinEquals&amp;quot; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.Resources&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; x&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;framePanel&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; LastChildFill&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;True&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Menu&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; IsMainMenu&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; DockPanel.Dock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Top&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Skins&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Default&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;SkinItem_Click&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Default}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Green&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;SkinItem_Click&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Green}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Header&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;_Red&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Click&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;SkinItem_Click&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;IsChecked&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin,&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Converter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;={&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StaticResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; skinEquals&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;},&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ConverterParameter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Red}&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;MenuItem&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Menu&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Background&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DynamicResource&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; bgbrush&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;}&amp;quot;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;{&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Binding&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; ElementName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=mainWindow,&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt; Path&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=Skin}&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;HorizontalAlignment&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;VerticalAlignment&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&amp;quot;Center&amp;quot;/&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DockPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/409055018330637333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/409055018330637333' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/409055018330637333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/409055018330637333'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2009/11/wpf-skinning.html' title='WPF Skinning'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-742780770514938660</id><published>2009-11-27T16:02:00.001-08:00</published><updated>2009-11-27T17:03:59.596-08:00</updated><title type='text'>WPF Data Binding: Objects and XML Data</title><content type='html'>&lt;p&gt;&amp;#160;&lt;img style=&quot;border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px&quot; title=&quot;image&quot; border=&quot;0&quot; alt=&quot;image&quot; src=&quot;https://wwcuea.bay.livefilestore.com/y1m-KE4pkll9fkMEt-2VqfH166H79wc9EQ5WVjhm2Ggvs-8XfeBUL7aP0gde5vw3QuxBG8dEd6mIpyBWlflVOv5E3rHnYUcAtGXUi8JJ7L9SBVbYOhQSpdqfWBS5s3JTiZtPw58Z98OPZ35Cj0iwdCx0Q/image20.png&quot; width=&quot;398&quot; height=&quot;232&quot; /&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;ObjectDataProvider can be used to create new objects directly in xaml. However, typically objects are created in code and in such cases the binding needs to be set in code. Assuming we have these objects:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;class&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt; FirstName { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;get&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;set&lt;/span&gt;&lt;span&gt;; }&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;string&lt;/span&gt;&lt;span&gt; LastName { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;get&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;set&lt;/span&gt;&lt;span&gt;; }&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;int&lt;/span&gt;&lt;span&gt; Age { &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;get&lt;/span&gt;&lt;span&gt;; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;set&lt;/span&gt;&lt;span&gt;; }&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;public&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;static&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;[] Friends = &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;[] {&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;() { FirstName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Michael&amp;quot;&lt;/span&gt;&lt;span&gt;, LastName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Xu&amp;quot;&lt;/span&gt;&lt;span&gt;, Age=9 },&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;() { FirstName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Michael&amp;quot;&lt;/span&gt;&lt;span&gt;, LastName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Xu&amp;quot;&lt;/span&gt;&lt;span&gt;, Age=9 },&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;() { FirstName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Michael&amp;quot;&lt;/span&gt;&lt;span&gt;, LastName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Xu&amp;quot;&lt;/span&gt;&lt;span&gt;, Age=9 },&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;() { FirstName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Michael&amp;quot;&lt;/span&gt;&lt;span&gt;, LastName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Xu&amp;quot;&lt;/span&gt;&lt;span&gt;, Age=9 },&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;new&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;() { FirstName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Michael&amp;quot;&lt;/span&gt;&lt;span&gt;, LastName=&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;&amp;quot;Xu&amp;quot;&lt;/span&gt;&lt;span&gt;, Age=9 },&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; };&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;To bind these to a ListView, create a ListView style with a data template:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Window.Resources&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x:Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;personList&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;TargetType&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{x:Type ListView}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter.Value&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Orientation&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Horizontal&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding Path=FirstName}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FontWeight&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Bold&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding Path=LastName}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FontWeight&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Bold&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;8,0,0,0&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding Path=Age}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter.Value&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Create a ListView control with the style:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ListView&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;friendsListView&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{StaticResource personList}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://11011.net/software/vspaste&quot;&gt;&lt;/a&gt;Then create the binding in code:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;private&lt;/span&gt;&lt;span&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;void&lt;/span&gt;&lt;span&gt; Window_Loaded(&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;object&lt;/span&gt;&lt;span&gt; sender, &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;RoutedEventArgs&lt;/span&gt;&lt;span&gt; e)&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;{&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;&amp;#160;&amp;#160;&amp;#160; friendsListView.ItemsSource = &lt;/span&gt;&lt;span style=&quot;color: rgb(43,145,175)&quot;&gt;Person&lt;/span&gt;&lt;span&gt;.Friends;&lt;/span&gt;     &lt;br /&gt;&lt;span&gt;}&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://11011.net/software/vspaste&quot;&gt;&lt;/a&gt;To achieve similar results with an embeded XmlDataProvider, we can directly supply data and use XPath binding (note the xmlns).&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;XmlDataProvider&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x:Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;xmlFriends&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;x:XData&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Friends&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Person&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FirstName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Michael&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;LastName&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Xu&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;10&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Friends&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;x:XData&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;XmlDataProvider&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;    &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;x:Key&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;xmlPersonList&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;TargetType&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{x:Type ListView}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Property&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;ItemTemplate&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter.Value&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Orientation&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Horizontal&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding XPath=@FirstName}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FontWeight&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Bold&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding XPath=@LastName}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;FontWeight&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;Bold&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Margin&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;8,0,0,0&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;TextBlock&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding XPath=@Age}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;DataTemplate&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter.Value&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Setter&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Bind to a ListView:&lt;/p&gt;  &lt;p style=&quot;font-family: consolas; background: white; color: black; font-size: 11pt&quot;&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: rgb(163,21,21)&quot;&gt;ListView&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;Style&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{StaticResource xmlPersonList}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;     &lt;br /&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style=&quot;color: rgb(255,0,0)&quot;&gt;ItemsSource&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;=&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt;{Binding Source={StaticResource xmlFriends}, XPath=/Friends/Person}&lt;/span&gt;&lt;span&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0,0,255)&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/742780770514938660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/742780770514938660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/742780770514938660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/742780770514938660'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2009/11/wpf-data-binding-objects-and-xml-data.html' title='WPF Data Binding: Objects and XML Data'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-4563206272196183770</id><published>2007-01-08T13:06:00.001-08:00</published><updated>2007-01-08T13:06:47.473-08:00</updated><title type='text'>Update Windows desktop icons</title><content type='html'>&lt;p&gt;When Windows desktop icons&amp;nbsp;seem out of sync, try changing display depth (display settings/colors). This will rebuild&amp;nbsp;Windows icon cache.&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/4563206272196183770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/4563206272196183770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/4563206272196183770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/4563206272196183770'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2007/01/update-windows-desktop-icons.html' title='Update Windows desktop icons'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-4992358914766816691</id><published>2006-12-30T19:41:00.000-08:00</published><updated>2006-12-30T19:44:59.835-08:00</updated><title type='text'>Convert Between Polygon Shape File and Arc/Info Coverage</title><content type='html'>Sometimes you want to take advantage of the old Arc/Info command lines... e.g., you want to run CLEAN, or you have many files to process and you want to run a simple script.&lt;br /&gt;&lt;br /&gt;However, when converting between a shape file and arc/info coverage,  you usually lose attribute data. To preserve attribute data, follow this example:&lt;br /&gt;&lt;p class=&quot;code&quot;&gt;# import as region&lt;br /&gt;shapearc oxbld.shp oxr REGION&lt;br /&gt;&lt;br /&gt;# clean poly&lt;br /&gt;clean oxr oxrc # # POLY&lt;br /&gt;&lt;br /&gt;# export region&lt;br /&gt;arcshape oxrc REGIONS.REGION oxr&lt;br /&gt;&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/4992358914766816691/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/4992358914766816691' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/4992358914766816691'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/4992358914766816691'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2006/12/convert-between-polygon-shape-file-and.html' title='Convert Between Polygon Shape File and Arc/Info Coverage'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-1493345431341911022</id><published>2006-12-01T19:10:00.000-08:00</published><updated>2006-12-01T19:17:39.838-08:00</updated><title type='text'>javascript in href</title><content type='html'>There are two ways to use javascript in a href tag, e. g.,&lt;br /&gt;&lt;p class=&quot;code&quot;&gt;1. &amp;lt;a href=&quot;javascript:doSomething()&quot;&amp;gt;...&amp;lt;/a&amp;gt;&lt;br /&gt;2. &amp;lt;a href=&quot;#&quot; onclick=&quot;doSomething(); return false&quot;&amp;gt;...&amp;lt;/a&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;When using Microsoft HTA, however, only the second approach works. The first one will pop up a new window when the link is clicked, even under IE7.</content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/1493345431341911022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/1493345431341911022' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/1493345431341911022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/1493345431341911022'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2006/12/there-are-two-ways-to-use-javascript-in.html' title='javascript in href'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-114600784747797213</id><published>2006-04-25T16:27:00.000-07:00</published><updated>2009-11-27T16:51:30.723-08:00</updated><title type='text'>Request Encoding</title><content type='html'>In JSP you have to manually set request encoding otherwise it will default to iso-8859-1. With the default you won&#39;t access any param whose value is not in iso-8859-1 encoding correctly. e.g., the copyright character &amp;quot;©&amp;quot;.   &lt;br /&gt;  &lt;br /&gt;To set request encoding, use jstl:   &lt;br /&gt;  &lt;p class=&quot;code&quot;&gt;xmlns:fmt=&lt;a href=&quot;http://java.sun.com/jsp/jstl/fmt&quot;&gt;http://java.sun.com/jsp/jstl/fmt&lt;/a&gt;     &lt;br /&gt;    &lt;br /&gt;&amp;lt;fmt:requestencoding value=&amp;quot;utf-8&amp;quot;&amp;gt;     &lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/114600784747797213/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/114600784747797213' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114600784747797213'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114600784747797213'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2006/04/request-encoding.html' title='Request Encoding'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-114599704593184017</id><published>2006-04-25T13:26:00.000-07:00</published><updated>2006-12-30T19:49:58.409-08:00</updated><title type='text'>Paste High DPI Image from Clipboard into Photoshop</title><content type='html'>You want to convert a MS Word graph into image, using Photoshop.&lt;br /&gt;&lt;br /&gt;Copy to clipboard in Word.&lt;br /&gt;New file in Photoshop.&lt;br /&gt;&lt;br /&gt;When you New file from clipboard, the initial settings is 72DPI. Change the units to inch, dpi to 300. New. Paste. Result is incorrect.&lt;br /&gt;&lt;br /&gt;Do not close the window. New file again. This time the pixel settings are much larger. Change the DPI to 300, and units to inch. The dimensions should match Word. Now paste.</content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/114599704593184017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/114599704593184017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114599704593184017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114599704593184017'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2006/04/paste-high-dpi-image-from-clipboard.html' title='Paste High DPI Image from Clipboard into Photoshop'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-114598840988159482</id><published>2006-04-25T11:01:00.000-07:00</published><updated>2006-04-25T11:06:49.903-07:00</updated><title type='text'>cvs server on cygwin</title><content type='html'>If you want to connect from eclipse to a cvs running on cygwin, cygwin version 1.5.19 won&#39;t suffix. It has a bug that returns an unexpected errorno when cvs attempts to create &quot;/tmp/cvs-serv???/.&quot;. The latest cygwin snapshort solved it.&lt;br /&gt;&lt;br /&gt;With that bug corrected, in eclipse select extssh method.</content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/114598840988159482/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/114598840988159482' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114598840988159482'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/114598840988159482'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2006/04/cvs-server-on-cygwin.html' title='cvs server on cygwin'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-113357312859702727</id><published>2005-12-02T17:23:00.000-08:00</published><updated>2009-11-27T16:55:35.899-08:00</updated><title type='text'>JavaScript XmlHttp</title><content type='html'>A simple cross-platform XmlHttp code snippet:   &lt;br /&gt;  &lt;p class=&quot;code&quot;&gt;function newXmlHttp() {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (window.XMLHttpRequest) {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return new XMLHttpRequest();     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } else if (window.ActiveXObject) {&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return new ActiveXObject(&amp;quot;Msxml2.XMLHttp&amp;quot;);     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return null;     &lt;br /&gt;}&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/113357312859702727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/113357312859702727' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/113357312859702727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/113357312859702727'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2005/12/javascript-xmlhttp.html' title='JavaScript XmlHttp'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-19528557.post-113356446660928422</id><published>2005-12-02T14:59:00.000-08:00</published><updated>2009-11-27T17:00:48.770-08:00</updated><title type='text'>javascript Drag</title><content type='html'>Have you seen cool drag&amp;amp;drop features in some websites, with which you can dynamicly arrange web contents? If not, check out google personal or msn space.   &lt;br /&gt;  &lt;br /&gt;It turns out not that difficult to implement your own drag and drop. Below is a very lightweight and customizable web Drag&amp;amp;Drop support using javascript and dhtml. Supports both IE and Firefox.   &lt;br /&gt;  &lt;p class=&quot;code&quot;&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;   &lt;br /&gt;&amp;#160; function getEvent(e) {    &lt;br /&gt;&amp;#160; return e ? e : window.event;    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;function moveElem(elem, left, top) {    &lt;br /&gt;&amp;#160; var style = elem.style;    &lt;br /&gt;&amp;#160; style.left = left;    &lt;br /&gt;&amp;#160; style.top = top;    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;function Drag(elem) {    &lt;br /&gt;&amp;#160; var self = this;    &lt;br /&gt;&amp;#160; this.elem = elem;    &lt;br /&gt;    &lt;br /&gt;&amp;#160; elem.onmousedown = function(e) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; e = getEvent(e);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; self.onBeginDrag(e.clientX, e.clientY);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; saveLast(e.clientX, e.clientY);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.onmousemove = onmousemove;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.onmouseup = onmouseup;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return false;    &lt;br /&gt;&amp;#160; }    &lt;br /&gt;    &lt;br /&gt;&amp;#160; function onmousemove(e) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; e = getEvent(e);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; self.onDrag(e.clientX, e.clientY);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; saveLast(e.clientX, e.clientY);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return false;    &lt;br /&gt;&amp;#160; }    &lt;br /&gt;    &lt;br /&gt;&amp;#160; function onmouseup(e) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; e = getEvent(e);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.onmousemove = null;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; document.onmouseup = null;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; self.onEndDrag(e.clientX, e.clientY);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return false;    &lt;br /&gt;&amp;#160; }    &lt;br /&gt;    &lt;br /&gt;&amp;#160; function saveLast(x, y) {    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; self.x0 = x;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; self.y0 = y;    &lt;br /&gt;&amp;#160; }     &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;Drag.prototype.move = function(dx, dy) {    &lt;br /&gt;&amp;#160; var style = this.elem.style;    &lt;br /&gt;&amp;#160; var x = parseInt(style.left);    &lt;br /&gt;&amp;#160; var y = parseInt(style.top);    &lt;br /&gt;&amp;#160; style.left = x + dx;    &lt;br /&gt;&amp;#160; style.top = y + dy;    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;Drag.prototype.moveTo = function(x, y) {    &lt;br /&gt;&amp;#160; moveElem(this.elem, x, y);    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;Drag.prototype.drag = function(x, y) {    &lt;br /&gt;&amp;#160; this.move(x - this.x0, y - this.y0);    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;Drag.prototype.onDrag = function(x, y) {    &lt;br /&gt;&amp;#160; this.drag(x, y);    &lt;br /&gt;}    &lt;br /&gt;    &lt;br /&gt;Drag.prototype.onBeginDrag = function(x, y) {}    &lt;br /&gt;Drag.prototype.onEndDrag = function(x, y) {}    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  &lt;br /&gt;To make an element draggable, simply call &amp;quot;new Drag(elem)&amp;quot; for the element, e.g.,   &lt;br /&gt;  &lt;p class=&quot;code&quot;&gt;&amp;lt;img id=&amp;quot;dragimg&amp;quot; src=&amp;quot;...&amp;quot;&amp;gt;   &lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;    &lt;br /&gt;&amp;#160; new Drag(document.getElementById(&amp;quot;dragimg&amp;quot;));    &lt;br /&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;  </content><link rel='replies' type='application/atom+xml' href='http://x-soft.blogspot.com/feeds/113356446660928422/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/19528557/113356446660928422' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/113356446660928422'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/19528557/posts/default/113356446660928422'/><link rel='alternate' type='text/html' href='http://x-soft.blogspot.com/2005/12/javascript-drag.html' title='javascript Drag'/><author><name>Jianchun Xu</name><uri>http://www.blogger.com/profile/10072318535404322174</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>