<?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: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-6938791</id><updated>2012-02-16T06:46:07.564Z</updated><category term='Printing'/><category term='designer'/><category term='Visual Studio'/><category term='Rotation'/><category term='MVVM'/><category term='Desktop'/><category term='Binding'/><category term='IDataErrorInfo'/><category term='DataTemplate'/><category term='Windows 7 beta'/><category term='WebCam'/><category term='MSCUI'/><category term='object initializers'/><category term='Windows'/><category term='Silverlight 4 Beta'/><category term='IDE'/><category term='XAML'/><category term='punctuation'/><category term='attributes'/><category term='Drag and Drop'/><category term='ClickCount'/><category term='Scale'/><category term='Animation'/><category term='WinForms'/><category term='property browser'/><category term='Style'/><category term='Clipboard'/><category term='apostrophe'/><category term='wallpaper'/><category term='PhotoCube'/><category term='Chord'/><category term='TechEd 2007'/><category term='auto properties'/><category term='Plane Projection'/><category term='Music'/><category term='Silverlight 5 Beta'/><category term='WP7'/><category term='AjaxControlToolkit'/><category term='Right Mouse Event'/><category term='RichTextArea'/><category term='C#'/><category term='collection initializers'/><category term='Windows Phone 7'/><category term='Out of Browser'/><category term='silverlight 3'/><category term='3D'/><category term='NHS'/><category term='Silverlight 3 Beta'/><category term='Petzold'/><category term='Piano'/><category term='CodePlex'/><category term='.NET'/><category term='Silverlight'/><title type='text'>El color dels somnis</title><subtitle type='html'>Primarily thoughts on Silverlight and other Microsoft UI Technologies, plus personal rants</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>47</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6938791.post-5271707314769948232</id><published>2011-04-21T18:34:00.001+01:00</published><updated>2011-04-21T18:34:41.394+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 5 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='ClickCount'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Five Minute Silverlight 5 Aides-Memoire #4 – Mouse Click Count</title><content type='html'>&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:b1101028-989a-496c-9e30-3b7aeb75118e" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Rainbow Rectangle&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Rectangle&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Width&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;154&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;          &lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;77&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          &lt;span style="color:#ff0000"&gt; MouseLeftButtonDown&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;RectangleMouseLeftButtonDown&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;GradientFill&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; StartPoint&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0,0&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; EndPoint&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;1,1&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Red&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.1667&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Orange&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.334&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Yellow&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.5001&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Green&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.6668&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Blue&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.8335&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Indigo&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;GradientStop&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Offset&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Color&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Violet&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Rectangle&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ClickCountTextBlock&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          &lt;span style="color:#ff0000"&gt; Foreground&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;White&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;          &lt;span style="color:#ff0000"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          &lt;span style="color:#ff0000"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;          &lt;span style="color:#ff0000"&gt; FontSize&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;40&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;          &lt;span style="color:#ff0000"&gt; Opacity&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.4&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;          &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:245085ea-4646-4ee3-8f86-1ccb74aec7dc" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Click Count in MouseEventArgs&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; RectangleMouseLeftButtonDown(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;MouseButtonEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.ClickCountTextBlock.Text = e.ClickCount.ToString();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; topLeft = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Point&lt;/span&gt;(0, 0);&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; topRight = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Point&lt;/span&gt;(1, 0);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; bottomLeft = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Point&lt;/span&gt;(0, 1);&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; bottomRight = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Point&lt;/span&gt;(1, 1);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;switch&lt;/span&gt; (e.ClickCount)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;case&lt;/span&gt; 2:&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.StartPoint = topRight;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.EndPoint = bottomLeft;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;break&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;case&lt;/span&gt; 3:&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.StartPoint = bottomRight;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.EndPoint = topLeft;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;break&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;case&lt;/span&gt; 4:&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.StartPoint = bottomLeft;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.EndPoint = topRight;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;break&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;default&lt;/span&gt;:&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.StartPoint = topLeft;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;this&lt;/span&gt;.GradientFill.EndPoint = bottomRight;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;break&lt;/span&gt;;&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/TbBqoUlSjmI/AAAAAAAAAGg/BOCFhi7xPoI/s1600-h/DoubleTripleClick%5B5%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="DoubleTripleClick" border="0" alt="DoubleTripleClick" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/TbBqrslTskI/AAAAAAAAAGk/Xy-vAfMFv_8/DoubleTripleClick_thumb%5B3%5D.png?imgmax=800" width="531" height="537" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:ed13fb44-5a64-4886-8690-410a47e617fd" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight+5+Beta" rel="tag"&gt;Silverlight 5 Beta&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Double-Click" rel="tag"&gt;Double-Click&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Triple-Click" rel="tag"&gt;Triple-Click&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ClickCount" rel="tag"&gt;ClickCount&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-5271707314769948232?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/5271707314769948232/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=5271707314769948232' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5271707314769948232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5271707314769948232'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2011/04/five-minute-silverlight-5-aides-memoire_2604.html' title='Five Minute Silverlight 5 Aides-Memoire #4 – Mouse Click Count'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/TbBqrslTskI/AAAAAAAAAGk/Xy-vAfMFv_8/s72-c/DoubleTripleClick_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-3483803798484941941</id><published>2011-04-21T17:34:00.001+01:00</published><updated>2011-04-21T18:31:09.488+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 5 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Out of Browser'/><title type='text'>Five Minute Silverlight 5 Aides-Memoire #3 – Out-of-Browser Native Windows</title><content type='html'>&lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:ce6693c7-fd95-4cfa-853b-8b28365b7b29" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Native Window creation in code&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; ButtonClick(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color:#2b91af"&gt;Application&lt;/span&gt;.Current.IsRunningOutOfBrowser)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; newGrid = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Grid&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        Background = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;SolidColorBrush&lt;/span&gt;(&lt;span style="color:#2b91af"&gt;Colors&lt;/span&gt;.White),&lt;/li&gt; &lt;li&gt;        HorizontalAlignment = &lt;span style="color:#2b91af"&gt;HorizontalAlignment&lt;/span&gt;.Stretch,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        VerticalAlignment = &lt;span style="color:#2b91af"&gt;VerticalAlignment&lt;/span&gt;.Stretch&lt;/li&gt; &lt;li&gt;    };&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;var&lt;/span&gt; newTextBlock = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;TextBlock&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        HorizontalAlignment = &lt;span style="color:#2b91af"&gt;HorizontalAlignment&lt;/span&gt;.Center,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        VerticalAlignment = &lt;span style="color:#2b91af"&gt;VerticalAlignment&lt;/span&gt;.Center,&lt;/li&gt; &lt;li&gt;        Text = &lt;span style="color:#a31515"&gt;&amp;quot;New TextBlock in a new Window...&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    };&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    newGrid.Children.Add(newTextBlock);&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Window&lt;/span&gt; { Content = newGrid, Visibility = &lt;span style="color:#2b91af"&gt;Visibility&lt;/span&gt;.Visible, Width = 300, Height = 300 };&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/TbBceAzKiLI/AAAAAAAAAGY/wqFdesRlFGE/s1600-h/NativeWindows%5B6%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="NativeWindows" border="0" alt="NativeWindows" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/TbBcgRURDSI/AAAAAAAAAGc/SvoDuW2uf3c/NativeWindows_thumb%5B4%5D.png?imgmax=800" width="821" height="632" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d56fba12-99f6-4d20-a520-42206d6690b4" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight+5+Beta" rel="tag"&gt;Silverlight 5 Beta&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Native+Window" rel="tag"&gt;Native Window&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-3483803798484941941?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/3483803798484941941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=3483803798484941941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3483803798484941941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3483803798484941941'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2011/04/five-minute-silverlight-5-aides-memoire_21.html' title='Five Minute Silverlight 5 Aides-Memoire #3 – Out-of-Browser Native Windows'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_E_ZM9Y7o2Ow/TbBcgRURDSI/AAAAAAAAAGc/SvoDuW2uf3c/s72-c/NativeWindows_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-862479069980813000</id><published>2011-04-20T10:13:00.001+01:00</published><updated>2011-04-20T10:15:20.005+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 5 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Style'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Binding'/><category scheme='http://www.blogger.com/atom/ns#' term='DataTemplate'/><title type='text'>Five Minute Silverlight 5 Aides-Memoire #2 – Implicit DataTemplates</title><content type='html'>&lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:65c7ca12-a398-419d-83ea-c8a53cc54a5b" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Data Classes&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; The cartoon character.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CartoonCharacter&lt;/span&gt;&lt;/li&gt; &lt;li&gt;{&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; Gets or sets the forename.&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;value&amp;gt;&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt;The forename.&lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/value&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;string&lt;/span&gt; Forename { &lt;span style="color:#0000ff"&gt;get&lt;/span&gt;; &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;; }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; The flintstone.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Flintstone&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;CartoonCharacter&lt;/span&gt; { }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; The griffin.&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Griffin&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;CartoonCharacter&lt;/span&gt; { }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; The simpson.&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;///&lt;/span&gt;&lt;span style="background:#ffff9a;color:#008000"&gt; &lt;/span&gt;&lt;span style="background:#ffff9a;color:#808080"&gt;&amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Simpson&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;CartoonCharacter&lt;/span&gt; { }&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:4f19e6d3-4976-4aac-8ed4-844595638c6b" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;XAML&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px; white-space: nowrap"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;     &lt;span style="color:#ff0000"&gt; Background&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;White&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Style&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Key&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;SimpsonStyle&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;              &lt;span style="color:#ff0000"&gt; TargetType&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;TextBlock&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontFamily&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Comic Sans MS&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontSize&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;16&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Foreground&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Blue&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontStyle&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Italic&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DataType&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;this:Simpson&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Background&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Yellow&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Orientation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; SimpsonStyle}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                              &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Forename}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;5,0,0,0&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                              &lt;span style="color:#ff0000"&gt; Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; SimpsonStyle}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                              &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Simpson&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DataType&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;this:Flintstone&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Background&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Orange&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border.RenderTransform&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TransformGroup&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;SkewTransform&lt;/span&gt;&lt;span style="color:#ff0000"&gt; AngleX&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;-20&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ScaleTransform&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ScaleX&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                       &lt;span style="color:#ff0000"&gt; ScaleY&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0.75&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TranslateTransform&lt;/span&gt;&lt;span style="color:#ff0000"&gt; X&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TransformGroup&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border.RenderTransform&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Orientation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Forename}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;5,0,0,0&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                              &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Flintstone&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DataType&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;this:Griffin&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#ff0000"&gt; BorderBrush&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;DarkSlateBlue&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; BorderThickness&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;2&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Orientation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Forename}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; FontSize&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;18&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock.Effect&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;BlurEffect&lt;/span&gt;&lt;span style="color:#0000ff"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock.Effect&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;5,0,0,0&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                              &lt;span style="color:#ff0000"&gt; FontSize&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;22&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; CharacterSpacing&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;5&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                              &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Griffin&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock.Effect&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;DropShadowEffect&lt;/span&gt;&lt;span style="color:#0000ff"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock.Effect&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Border&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ListBox&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;CartoonCharactersListBox&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;50,20&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#ff0000"&gt; BorderBrush&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Blue&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#ff0000"&gt; BorderThickness&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Ta6jo1z3hVI/AAAAAAAAAGQ/DGTwYCzN7Ho/s1600-h/SL5AM2%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SL5AM2" border="0" alt="SL5AM2" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/Ta6jpikuSSI/AAAAAAAAAGU/K_tIW4eILJQ/SL5AM2_thumb%5B2%5D.png?imgmax=800" width="392" height="604" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Yeugh!!&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6da8762b-83af-47bc-bc74-9d3b0faeb4a0" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight+5+Beta" rel="tag"&gt;Silverlight 5 Beta&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Style" rel="tag"&gt;Style&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Binding" rel="tag"&gt;Binding&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DataTemplate" rel="tag"&gt;DataTemplate&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-862479069980813000?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/862479069980813000/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=862479069980813000' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/862479069980813000'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/862479069980813000'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2011/04/five-minute-silverlight-5-aides-memoire_20.html' title='Five Minute Silverlight 5 Aides-Memoire #2 – Implicit DataTemplates'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_E_ZM9Y7o2Ow/Ta6jpikuSSI/AAAAAAAAAGU/K_tIW4eILJQ/s72-c/SL5AM2_thumb%5B2%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-3111875972056683152</id><published>2011-04-20T06:39:00.001+01:00</published><updated>2011-04-20T06:39:22.340+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 5 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Style'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Binding'/><title type='text'>Five Minute Silverlight 5 Aides-Memoire #1 – Style Setter Binding</title><content type='html'>&lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:140bc98c-8cfa-4deb-b7d9-a2fe4be52811" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;Code Snippet&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;     &lt;span style="color:#ff0000"&gt; Background&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;White&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="color:#0000ff"&gt; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;RowDefinition&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Height&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Style&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Key&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;VariableFontTextBlockStyle&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;              &lt;span style="color:#ff0000"&gt; TargetType&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;TextBlock&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Foreground&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;DarkOrange&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontWeight&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Bold&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Setter&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Property&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontSize&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ElementName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=FontSizeSlider,&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Path&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=Value}&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;SampleTextBlock&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;              &lt;span style="color:#ff0000"&gt; Grid.Row&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;0&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;              &lt;span style="color:#ff0000"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;              &lt;span style="color:#ff0000"&gt; VerticalAlignment&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Center&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;              &lt;span style="color:#ff0000"&gt; Style&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;StaticResource&lt;/span&gt;&lt;span style="color:#ff0000"&gt; VariableFontTextBlockStyle}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;              &lt;span style="color:#ff0000"&gt; Text&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;No Mr Bond - I expect you to die&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;Slider&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;FontSizeSlider&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;           &lt;span style="color:#ff0000"&gt; Grid.Row&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;           &lt;span style="color:#ff0000"&gt; MaxWidth&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;500&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;           &lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;100,30&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;           &lt;span style="color:#ff0000"&gt; Maximum&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;64&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;           &lt;span style="color:#ff0000"&gt; Minimum&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;8&amp;quot;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;           &lt;span style="color:#ff0000"&gt; Value&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;12&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/Ta5xhRDgB_I/AAAAAAAAAGI/uDXZhqiwTYM/s1600-h/SL5AM1%5B6%5D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SL5AM1" border="0" alt="SL5AM1" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/Ta5xiGlb32I/AAAAAAAAAGM/Y7jpThLYy5I/SL5AM1_thumb%5B4%5D.png?imgmax=800" width="689" height="490" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9ee20414-7310-44da-b847-b4d908dc46ae" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight+5+Beta" rel="tag"&gt;Silverlight 5 Beta&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Style" rel="tag"&gt;Style&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Binding" rel="tag"&gt;Binding&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-3111875972056683152?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/3111875972056683152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=3111875972056683152' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3111875972056683152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3111875972056683152'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2011/04/five-minute-silverlight-5-aides-memoire.html' title='Five Minute Silverlight 5 Aides-Memoire #1 – Style Setter Binding'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/Ta5xiGlb32I/AAAAAAAAAGM/Y7jpThLYy5I/s72-c/SL5AM1_thumb%5B4%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1943809209520197284</id><published>2011-04-15T13:49:00.001+01:00</published><updated>2011-04-15T14:07:30.294+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Music'/><category scheme='http://www.blogger.com/atom/ns#' term='Scale'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Chord'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows Phone 7'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='WP7'/><category scheme='http://www.blogger.com/atom/ns#' term='Piano'/><title type='text'>Building Silverlight Chord Factory: Part 3 – The View and Windows Phone 7</title><content type='html'>&lt;p&gt;Despite my good intentions, it’s been a year since I posted the second part of my set of posts on Building Silverlight Chord Factory (see &lt;a href="http://joanmiro.blogspot.com/2010_03_01_archive.html"&gt;Part 1&lt;/a&gt; and &lt;a href="http://joanmiro.blogspot.com/2010/04/building-silverlight-chord-factory-part.html"&gt;Part 2&lt;/a&gt;). The third part – on the View in the Model-View-ViewModel (MVVM) triptych has been a bit delayed, mainly by work and other pressures, but also by my attention being diverted by the arrival of Windows Phone 7 (WP7).&lt;/p&gt;  &lt;p&gt;My practice of exploring new development platforms and languages by converting my hobby project – the Openfeature Chord Factory – kicked in and the application got yet another transformation. Which worked out quite well as it illustrated some of the power and benefits of the MVVM pattern. Converting the Silverlight Chord Factory code to WP7 Silverlight code was pretty simple and the main area of change – the View – was nicely isolated from the remaining code allowing the XAML markup to be adapted to the WP7 Control Toolkit easily and the custom controls in the app to work with virtually no modifications for the new platform.&lt;/p&gt;  &lt;p&gt;So now this belated post can be both a look at the original View and at the adaptions involved in moving the app to the WP7 platform.&lt;/p&gt;  &lt;p&gt;Here are a few screenshots of the Silverlight application in a couple of incarnations, running in a browser:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Tag-jhdKs7I/AAAAAAAAAFc/VDO--ZjebFc/s1600-h/SilverlightChordFactory3.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="SilverlightChordFactory" border="0" alt="SilverlightChordFactory" src="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Tag-l-aNj_I/AAAAAAAAAFg/xkqaskUbqbY/SilverlightChordFactory_thumb1.png?imgmax=800" width="654" height="448" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note the unfinished musical stave controls…&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/Tag-oGhhreI/AAAAAAAAAFk/8JOebBBcaWc/s1600-h/OpenfeatureChordFactory%5B4%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="OpenfeatureChordFactory" border="0" alt="OpenfeatureChordFactory" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/Tag-p7CzkjI/AAAAAAAAAFo/rgH0EQch41w/OpenfeatureChordFactory_thumb%5B2%5D.png?imgmax=800" width="654" height="358" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Screenshots of Silverlight ChordFactory application&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;And here are screenshots of the Wp7 application:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/Tag-r0SqpTI/AAAAAAAAAFs/gsccx0EfDNQ/s1600-h/WP7ChordFactory4.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="WP7ChordFactory" border="0" alt="WP7ChordFactory" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/Tag-u_ewDUI/AAAAAAAAAFw/NtcDwWSHark/WP7ChordFactory_thumb2.png?imgmax=800" width="654" height="380" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/Tag-wdHIvBI/AAAAAAAAAF0/CzFNtgHWuB4/s1600-h/WP7ChordFactorySettings%5B13%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP7ChordFactorySettings" border="0" alt="WP7ChordFactorySettings" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/Tag-yD8OhhI/AAAAAAAAAF4/pMoQtx70qiw/WP7ChordFactorySettings_thumb%5B11%5D.png?imgmax=800" width="653" height="393" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;s&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Tag-0VZ_7RI/AAAAAAAAAF8/7P6peWifcgA/s1600-h/WP7ChordFactoryOptions%5B3%5D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP7ChordFactoryOptions" border="0" alt="WP7ChordFactoryOptions" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/Tag-3lqAPrI/AAAAAAAAAGA/7_vaRWJIZc4/WP7ChordFactoryOptions_thumb%5B1%5D.png?imgmax=800" width="654" height="356" /&gt;&lt;/a&gt;&lt;em&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;Screenshots of WP7 app&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;          &lt;p&gt;Leaving aside my relative lack of UI/UX design capability, you can see that basically the User Experience is the same for both versions of the ChordFactory app. And in some of the UI itself the styling is exactly the same – the keyboard keys for example.&lt;/p&gt;  &lt;p&gt;In fact I was able to reuse large chunks of the Openfeature Silverlight music controls (Keyboard, Octave and PianoKey controls) that I developed for the browser app because they consist of generic, compatible XAML markup and C# code. The Views in either case are of course nothing more than the markup/styling with bindings to the appropriate data sources in the ViewModel.&amp;#160; With the Model and ViewModel classes being completely platform independent, they needed no redevelopment at all.&lt;/p&gt;  &lt;p&gt;So I was able to get the WP7 ChordFactory app up and running in not much more than an easy afternoon of working on it. The majority of the work required lay in adding XNA code to play piano note samples added to the app so that the user can hear the selected chord or scale. Something I couldn’t do as easily with the browser version and hadn’t got around to implementing with MediaElements. Registering with the App Hub and submitting the app took a few trips back and forth to cross all the ‘Ts’ and dot all the ‘Is’, but the app is now live here:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=089b2c6a-4a34-e011-854c-00237de2db9e" target="_blank"&gt;&lt;font color="#0000ff" size="4"&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=089b2c6a-4a34-e011-854c-00237de2db9e" target="_blank"&gt;&lt;img style="display: inline" title="ZuneDownload" alt="ZuneDownload" src="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Tag-4gxGt3I/AAAAAAAAAGE/gw5qtKrQAA0/ZuneDownload%5B15%5D.png?imgmax=800" width="649" height="483" /&gt;&lt;/a&gt;&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#0000ff" size="4"&gt;&lt;u&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=089b2c6a-4a34-e011-854c-00237de2db9e" target="_blank"&gt;Openfeature ChordFactory&lt;/a&gt;&lt;/u&gt;&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;   &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6c8b7b3d-80ba-470c-aea9-e15c48ed229a" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/WP7" rel="tag"&gt;WP7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Window+Phone+7" rel="tag"&gt;Window Phone 7&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Chord" rel="tag"&gt;Chord&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Music" rel="tag"&gt;Music&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Piano" rel="tag"&gt;Piano&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;&lt;/div&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1943809209520197284?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1943809209520197284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1943809209520197284' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1943809209520197284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1943809209520197284'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2011/04/building-silverlight-chord-factory-part.html' title='Building Silverlight Chord Factory: Part 3 – The View and Windows Phone 7'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_E_ZM9Y7o2Ow/Tag-l-aNj_I/AAAAAAAAAFg/xkqaskUbqbY/s72-c/SilverlightChordFactory_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-6661288697768761555</id><published>2010-04-13T15:54:00.001+01:00</published><updated>2010-04-13T15:54:21.462+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Music'/><category scheme='http://www.blogger.com/atom/ns#' term='Scale'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='CodePlex'/><category scheme='http://www.blogger.com/atom/ns#' term='Chord'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Piano'/><title type='text'>Building Silverlight Chord Factory: Part 2 – The ViewModel</title><content type='html'>&lt;p&gt;This is part 2 in my series of posts on building the latest MVVM incarnation of my ChordFactory hobby project; in &lt;a href="http://joanmiro.blogspot.com/2010/03/building-silverlight-chord-factory-part.html" target="_blank"&gt;Part 1&lt;/a&gt; I discussed modelling musical chord and scale data in XML – the Model in the MVVM (Model-View-ViewModel) pattern. In this post I will look at the next part of the pattern – the ViewModel.&lt;/p&gt;  &lt;h4&gt;Loading the data&lt;/h4&gt;  &lt;p&gt;In the MVVM pattern, data is held in properties of the ViewModel to allow the Views to data-bind UI elements directly onto those properties. In the ChordFactory application, the mechanics of loading the data from the XML and building the Chords and Scales collections to supply the View-Model are implemented using the Repository pattern with individual repository classes, deriving from a repository base class, for the Chords and the Scales collections. These classes implement private static methods to load their respective data and then surface the collections retrieved via public methods that return ObservableCollections of Chords and Scales respectively. &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:bdf25e36-db0f-4a78-b6cd-089d4b30b84f" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;REPOSITORY BASE CLASS&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;RepositoryBase&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;protected&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Stream&lt;/span&gt; GetResourceStream(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; resourceFile)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt; uri = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Uri&lt;/span&gt;(resourceFile, &lt;span style="color:#2b91af"&gt;UriKind&lt;/span&gt;.RelativeOrAbsolute);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#2b91af"&gt;StreamResourceInfo&lt;/span&gt; info = &lt;span style="color:#2b91af"&gt;Application&lt;/span&gt;.GetResourceStream(uri);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (info == &lt;span style="color:#0000ff"&gt;null&lt;/span&gt; || info.Stream == &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#0000ff"&gt;throw&lt;/span&gt; &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;Missing resource file: &amp;quot;&lt;/span&gt; + resourceFile);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; info.Stream;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:ddc2bdd4-331d-4dad-9a74-1cc6aa50b823" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;CHORD REPOSITORY&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ChordRepository&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;RepositoryBase&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt; observableChords = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt;();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; ChordRepository(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; chordDataFile)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        LoadChords(chordDataFile).ForEach(observableChords.Add);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt; LoadChords(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; chordDataFile)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;Stream&lt;/span&gt; stream = GetResourceStream(chordDataFile))&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;XmlReader&lt;/span&gt; xmlRdr = &lt;span style="color:#2b91af"&gt;XmlReader&lt;/span&gt;.Create(stream))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;from&lt;/span&gt; chordElem &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; &lt;span style="color:#2b91af"&gt;XDocument&lt;/span&gt;.Load(xmlRdr).Element(&lt;span style="color:#a31515"&gt;&amp;quot;Chords&amp;quot;&lt;/span&gt;).Elements(&lt;span style="color:#a31515"&gt;&amp;quot;Chord&amp;quot;&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#0000ff"&gt;select&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;.CreateChord((&lt;span style="color:#0000ff"&gt;string&lt;/span&gt;) chordElem.Element(&lt;span style="color:#a31515"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;),&lt;/li&gt; &lt;li&gt;                                          chordElem.Element(&lt;span style="color:#a31515"&gt;&amp;quot;NoteList&amp;quot;&lt;/span&gt;).Elements(&lt;span style="color:#a31515"&gt;&amp;quot;NoteIndex&amp;quot;&lt;/span&gt;).Select(&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                              x =&amp;gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(x.Value)).ToList())).ToList();&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt; GetChords()&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; observableChords;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:dac41f02-1748-4360-8e6f-f7ba823099ee" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;SCALE REPOSITORY&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ScaleRepository&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;RepositoryBase&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt; observableScales = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt;();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; ScaleRepository(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; scaleDataFile)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        LoadScales(scaleDataFile).ForEach(observableScales.Add);&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;static&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt; LoadScales(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; scaleDataFile)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;Stream&lt;/span&gt; stream = GetResourceStream(scaleDataFile))&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;using&lt;/span&gt; (&lt;span style="color:#2b91af"&gt;XmlReader&lt;/span&gt; xmlRdr = &lt;span style="color:#2b91af"&gt;XmlReader&lt;/span&gt;.Create(stream))&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; (&lt;span style="color:#0000ff"&gt;from&lt;/span&gt; ScaleElem &lt;span style="color:#0000ff"&gt;in&lt;/span&gt; &lt;span style="color:#2b91af"&gt;XDocument&lt;/span&gt;.Load(xmlRdr).Element(&lt;span style="color:#a31515"&gt;&amp;quot;Scales&amp;quot;&lt;/span&gt;).Elements(&lt;span style="color:#a31515"&gt;&amp;quot;Scale&amp;quot;&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;                    &lt;span style="color:#0000ff"&gt;select&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                        &lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;.CreateScale((&lt;span style="color:#0000ff"&gt;string&lt;/span&gt;)ScaleElem.Element(&lt;span style="color:#a31515"&gt;&amp;quot;Description&amp;quot;&lt;/span&gt;),&lt;/li&gt; &lt;li&gt;                                          ScaleElem.Element(&lt;span style="color:#a31515"&gt;&amp;quot;NoteList&amp;quot;&lt;/span&gt;).Elements(&lt;span style="color:#a31515"&gt;&amp;quot;NoteIndex&amp;quot;&lt;/span&gt;).Select(&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                              x =&amp;gt; &lt;span style="color:#0000ff"&gt;int&lt;/span&gt;.Parse(x.Value)).ToList())).ToList();&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt; GetScales()&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; observableScales;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;h4&gt;Data in the ViewModel&lt;/h4&gt;  &lt;p&gt;The ViewModel uses the Repositories to load the data and provides it as bindable collections together with other bindable properties such as the currently selected items in the collections and implementation of change notification so that bound UI can respond to updates in the ViewModel.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:9ac814e0-60c8-4610-a693-5e776cbfab0d" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;CHORDS VIEW-MODEL&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 3em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ChordsViewModel&lt;/span&gt; : &lt;span style="color:#2b91af"&gt;INotifyPropertyChanged&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;{&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt; chords;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt; scales;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt; selectedChord;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt; selectedScale;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af"&gt;RootNotes&lt;/span&gt; rootNote;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt; inversion;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;event&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PropertyChangedEventHandler&lt;/span&gt; PropertyChanged;&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;readonly&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;&amp;gt; inversions = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;&amp;gt;&lt;/li&gt; &lt;li&gt;                                                      {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                                          &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;.Basic,&lt;/li&gt; &lt;li&gt;                                                          &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;.First,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                                          &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;.Second,&lt;/li&gt; &lt;li&gt;                                                          &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;.Third,&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                                                          &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;.Fouth&lt;/li&gt; &lt;li&gt;                                                      };&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; ChordsViewModel()&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        chords = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ChordRepository&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;/Openfeature.ChordFactory;component/Data/chords.xml&amp;quot;&lt;/span&gt;).GetChords();&lt;/li&gt; &lt;li&gt;        scales = &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ScaleRepository&lt;/span&gt;(&lt;span style="color:#a31515"&gt;&amp;quot;/Openfeature.ChordFactory;component/Data/scales.xml&amp;quot;&lt;/span&gt;).GetScales();&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;&amp;gt; Chords&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; chords; }&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ObservableCollection&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;&amp;gt; Scales&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; scales; }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;&amp;gt; Inversions { &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; inversions; } }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt; SelectedChord&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; selectedChord; }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            selectedChord = &lt;span style="color:#0000ff"&gt;value&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            OnPropertyChanged(&lt;span style="color:#a31515"&gt;&amp;quot;SelectedChord&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#0000ff"&gt;int&lt;/span&gt;&amp;gt; SelectedScale&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; selectedScale; }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            selectedScale = &lt;span style="color:#0000ff"&gt;value&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            OnPropertyChanged(&lt;span style="color:#a31515"&gt;&amp;quot;SelectedScale&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt; Inversion&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; inversion; }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            inversion = &lt;span style="color:#0000ff"&gt;value&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            OnPropertyChanged(&lt;span style="color:#a31515"&gt;&amp;quot;Inversion&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#2b91af"&gt;RootNotes&lt;/span&gt; RootNote&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;get&lt;/span&gt; { &lt;span style="color:#0000ff"&gt;return&lt;/span&gt; rootNote; }&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#0000ff"&gt;set&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        {&lt;/li&gt; &lt;li&gt;            rootNote = &lt;span style="color:#0000ff"&gt;value&lt;/span&gt;;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            OnPropertyChanged(&lt;span style="color:#a31515"&gt;&amp;quot;RootNote&amp;quot;&lt;/span&gt;);&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; ChordSelectionChanged(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;SelectionChangedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        SelectedChord = ((&lt;span style="color:#2b91af"&gt;Chord&lt;/span&gt;)e.AddedItems[0]).Notes;&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; InversionSelectionChanged(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;SelectionChangedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        Inversion = (&lt;span style="color:#2b91af"&gt;Inversion&lt;/span&gt;)e.AddedItems[0];&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; RootNoteChanged(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;SelectionChangedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        RootNote = (&lt;span style="color:#2b91af"&gt;RootNotes&lt;/span&gt;)e.AddedItems[0];&lt;/li&gt; &lt;li&gt;    }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;&amp;nbsp;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#0000ff"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; ScaleSelectionChanged(&lt;span style="color:#0000ff"&gt;object&lt;/span&gt; sender, &lt;span style="color:#2b91af"&gt;SelectionChangedEventArgs&lt;/span&gt; e)&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    {&lt;/li&gt; &lt;li&gt;        SelectedScale = ((&lt;span style="color:#2b91af"&gt;Scale&lt;/span&gt;)e.AddedItems[0]).Notes;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;&amp;nbsp;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#0000ff"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff"&gt;void&lt;/span&gt; OnPropertyChanged(&lt;span style="color:#0000ff"&gt;string&lt;/span&gt; propertyName)&lt;/li&gt; &lt;li&gt;    {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#0000ff"&gt;if&lt;/span&gt; (PropertyChanged != &lt;span style="color:#0000ff"&gt;null&lt;/span&gt;)&lt;/li&gt; &lt;li&gt;        {&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            PropertyChanged(&lt;span style="color:#0000ff"&gt;this&lt;/span&gt;, &lt;span style="color:#0000ff"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;PropertyChangedEventArgs&lt;/span&gt;(propertyName));&lt;/li&gt; &lt;li&gt;        }&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    }&lt;/li&gt; &lt;li&gt;}&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c1f1dc20-ad6f-476a-b64e-05a37afc944d" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/.NET" rel="tag"&gt;.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/C%23" rel="tag"&gt;C#&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Chord" rel="tag"&gt;Chord&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CodePlex" rel="tag"&gt;CodePlex&lt;/a&gt;,&lt;a href="http://technorati.com/tags/MVVM" rel="tag"&gt;MVVM&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Music" rel="tag"&gt;Music&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Piano" rel="tag"&gt;Piano&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Scale" rel="tag"&gt;Scale&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;&lt;/div&gt;  &lt;p&gt;The Chords and Scales collection properties of the ViewModel are bound to UI elements, (initially ComboBoxes – UI/UX enhancement will have to come later), and their SelectionChanged events wired back to the ViewModel using the CallDataMethod behaviour from the excellent &lt;a href="http://expressionblend.codeplex.com/"&gt;Expression Blend Samples&lt;/a&gt; on Codeplex:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:cd142289-e98f-42cf-91d8-8e89cbdc8efa" class="wlWriterEditableSmartContent"&gt; &lt;div style="border: #000080 1px solid; color: #000; font-family: 'Courier New', Courier, Monospace; font-size: 10pt"&gt; &lt;div style="background: #000080; color: #fff; font-family: Verdana, Tahoma, Arial, sans-serif; font-weight: bold; padding: 2px 5px"&gt;COLLECTION PROPERTIES BINDINGS&lt;/div&gt; &lt;div style="background: #ddd; overflow: auto"&gt; &lt;ol style="background: #ffffff; margin: 0 0 0 2.5em; padding: 0 0 0 5px;"&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;BoundData&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Orientation&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Horizontal&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;10,10,10,20&amp;quot; &amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ChordsList&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Chords}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DisplayMemberPath&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Description&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;10,0&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#ff0000"&gt; EventName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;SelectionChanged&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;si&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;CallDataMethod&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Method&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ChordSelectionChanged&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ScalesList&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Scales}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; DisplayMemberPath&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;Description&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;10,0&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#ff0000"&gt; EventName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;SelectionChanged&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;si&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;CallDataMethod&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Method&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;ScaleSelectionChanged&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#ff0000"&gt; x&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#ff0000"&gt;Name&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;InversionsList&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Margin&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;10,0&amp;quot;&lt;/span&gt;&lt;span style="color:#ff0000"&gt; ItemsSource&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515"&gt;Binding&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Inversions}&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#ff0000"&gt; EventName&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;SelectionChanged&amp;quot;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;                &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;si&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;CallDataMethod&lt;/span&gt;&lt;span style="color:#ff0000"&gt; Method&lt;/span&gt;&lt;span style="color:#0000ff"&gt;=&amp;quot;InversionSelectionChanged&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;            &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;EventTrigger&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;        &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;i&lt;/span&gt;&lt;span style="color:#0000ff"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;Interaction.Triggers&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li style="background: #f3f3f3"&gt;    &lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;li&gt;&lt;span style="color:#a31515"&gt;&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color:#0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/li&gt; &lt;/ol&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;The ViewModel handles selection changes and sets its SelectedChord and SelectedScale properties appropriately. The piano keyboard which displays the notes from the selected chord and scale is written as a Silverlight Control and it too has SelectedChord and SelectedScale properties; these bind to the properties on the ViewModel with the same name. The keyboard control also responds to left-mouse clicks in order to allow the selection of the root note of the chord or scale.&lt;/p&gt;  &lt;p&gt;So now I have my data loaded and in a bindable ViewModel, creating a user interface in XAML to represent it to the user of the Silverlight ChordFactory is next, together with some stuff about testing. That’s for part 3.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-6661288697768761555?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/6661288697768761555/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=6661288697768761555' title='37 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6661288697768761555'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6661288697768761555'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2010/04/building-silverlight-chord-factory-part.html' title='Building Silverlight Chord Factory: Part 2 – The ViewModel'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>37</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8672871128333035058</id><published>2010-03-05T07:25:00.024Z</published><updated>2010-03-12T07:37:59.809Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='Music'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Chord'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight 3'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Piano'/><title type='text'>Building Silverlight Chord Factory: Part 1 – The Data Model</title><content type='html'>Back in November 2008 I posted about &lt;a href="http://joanmiro.blogspot.com/2008/11/creating-chord-factory-in-silverlight-2.html" target="_blank"&gt;converting my reference app Chord Factory to Silverlight&lt;/a&gt; – Chord Factory is a piano chord finder utility that I wrote years ago and I have been porting from one development platform to the next as a series of protracted learning exercises ever since. It started out as a &lt;a href="http://www.openfeature.co.uk/download/chord.zip" target="_blank"&gt;VB6 WinForms app&lt;/a&gt; and has been through various .NET incarnations since. The Silverlight version went through partially complete Silverlight 2.0 and 3.0 versions in a fairly monolithic architecture and I always meant to produce a few posts about the code once I had it complete and had a &lt;a href="http://www.openfeature.co.uk/Silverlight/SilverlightChordFactory.html" target="_blank"&gt;published version&lt;/a&gt; on my website.   &lt;br /&gt;But before I had managed that (see the most recent incomplete version &lt;a href="http://www.openfeature.co.uk/Silverlight/SilverlightChordFactory.html" target="_blank"&gt;here&lt;/a&gt;) I became interested in overhauling the component design and re-architecting it as another learning exercise, this time to help me work through the concepts of producing loosely-coupled component designs using MVC/MVVM patterns and looking at concerns like unit testing &amp;amp; testability together with an attempt at expressing the data structures involved in XML.   &lt;br /&gt;I long since gave up trying to make the UI pretty – whilst I think I can distinguish good UI/UX from bad I am no designer, but I have managed to produce something that fits some of the MVVM principles and allowed me to understand how MVVM works and makes for testable components and clean data-binding. And before I get distracted again and feel the urge to overhaul the code again and douse everything in MEF, it is time for those long-delayed posts.   &lt;br /&gt;  &lt;h4&gt;Representing note sequences as data&lt;/h4&gt;  &lt;p&gt;Without straying too much into music theory, chords and musical scales are basically sequences of notes – the 8 notes in a scale (e.g. the scale of C Major: C-D-E-F-G-A-B-C) or the 3, 4 or more notes in a chord (e.g. the chord of C Major: C-E-G) can be stored and positions or offsets in a sequence. However the progressive sequence is measured in pitch-steps of semitones from the starting note i.e. including the black notes (looking at the piano keyboard, the semitone sequence starting from the note C is: C, C#, D, Eb, E, F, F#, G, Ab, A, B, C, C#, D, Eb… and so on up the keyboard). So to store the sequence for the scale of C Major we need to store offsets for the 1st, 3rd, 5th, 6th, 8th, 10th, 11th and 12th semitones, and for the chord of C Major we need to store the offsets for the 1st, 5th and 7th. With this information for a scale or a chord we have the means to select or highlight on the UI representation of our piano keyboard the notes that make it up, starting at the base or &lt;i&gt;root note&lt;/i&gt; – C in the previous examples.     &lt;br /&gt;We can now store these sequences of offsets for all the standard scales and chords that musicians have come up with and use them to produce representations of any variation from a particular root note. An XML schema for these sequences is simple to produce:&amp;#160; &lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:dadc6654-366b-4b95-a274-41219002d0ea" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;CHORD DATA SCHEMA&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="color: #a31515"&gt;xml&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;version&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1.0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;encoding&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;utf-8&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;?&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:schema&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;targetNamespace&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;http://tempuri.org/XMLSchema.xsd&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;elementFormDefault&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;qualified&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;http://tempuri.org/XMLSchema.xsd&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xmlns:mstns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;http://tempuri.org/XMLSchema.xsd&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;span style="color: #ff0000"&gt;xmlns:xs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;http://www.w3.org/2001/XMLSchema&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;ChordFactoryData&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Chords&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Chords&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Scales&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Scales&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Chords&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Chord&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteSequence&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Scales&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Scale&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteSequence&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteSequence&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;SequenceType&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;SequenceType&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Description&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteList&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteList&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteList&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:element&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NoteIndex&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;type&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;xs:int&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;minOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;maxOccurs&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;unbounded&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:sequence&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:complexType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;SequenceType&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:restriction&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;base&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;xs:string&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:enumeration&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Chord&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:enumeration&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Scale&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:restriction&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:simpleType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt; &lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;xs:schema&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The XML for a Major Chord would then look like this: &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:bf20ecf6-642e-4115-b6f1-636fba153152" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;MAJOR CHORD&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;chords&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;chord&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;sequencetype&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Chord&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;sequencetype&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Major&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;notelist&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;0&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;4&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;7&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;notelist&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;chord&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; ...more chords... &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;chords&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;and a Major Scale would look like this:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f0075c05-9da4-4678-9b44-bd4291e60839" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;MAJOR SCALE&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;scales&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;scale&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;sequencetype&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Scale&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;sequencetype&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;Major&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;description&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;notelist&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;0&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;2&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;4&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;5&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;7&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;9&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;11&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;12&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;noteindex&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;notelist&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;scale&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&lt;/span&gt;&lt;/li&gt;          &lt;li&gt;&amp;#160; ...more scales... &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;/li&gt;          &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;scales&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h4&gt;&amp;#160;&lt;/h4&gt;  &lt;h4&gt;Data Classes&lt;/h4&gt;  &lt;p&gt;In my MVVM implementation this Chord and Scale data is loaded into models that represent the Chord or the Scale and I can then produce collections of instances of all the Chords and Scales. Here are the simple models in C#: &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f4cf5632-b7e3-470d-b75a-c2e84a067d1b" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;DATA MODEL CLASSES&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;abstract&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;NoteSequence&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;{ &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; Notes { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Description { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; } &lt;/li&gt;          &lt;li&gt;} &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;/li&gt;          &lt;li&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Chord&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;NoteSequence&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;{ &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Chord&lt;/span&gt; CreateNewChord() &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Chord&lt;/span&gt;(); &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Chord&lt;/span&gt; CreateChord(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; description, &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; notes) &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Chord&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Notes = notes, &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Description = description &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; Chord() { } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;} &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Scale&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;NoteSequence&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;{ &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Scale&lt;/span&gt; CreateNewScale() &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Scale&lt;/span&gt;(); &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Scale&lt;/span&gt; CreateScale(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; description, &lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt; notes) &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Scale&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Notes = notes, &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Description = description &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; Scale() { } &lt;/li&gt;          &lt;li&gt;} &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;In implementation, the Chord and Scale classes are no different and it could be argued that the respective data could be loaded into two collections of the more general NoteSequence class (which would have to be changed from its current abstract incarnation of course); but I prefer to keep them as separate classes as they are logically different and might diverge in the future.     &lt;br /&gt;    &lt;br /&gt;So I now represent my chord and scale data as XML and I have a straightforward model for instantiating it in data objects. The next stage is to load that data into a ViewModel using data access code that will deserialize the XML into the objects. That will be in part 2. &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8672871128333035058?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8672871128333035058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8672871128333035058' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8672871128333035058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8672871128333035058'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2010/03/building-silverlight-chord-factory-part.html' title='Building Silverlight Chord Factory: Part 1 – The Data Model'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-7584797473848834843</id><published>2009-12-14T16:01:00.005Z</published><updated>2010-03-15T07:40:00.638Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='IDataErrorInfo'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #7 – IDataErrorInfo</title><content type='html'>&lt;p&gt;The XAML:&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:f5dbcb01-5856-4529-954c-5d287fce6d8a" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;DATA INPUT&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;LayoutRoot&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;local:Person&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;x:Key&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;NewJoiner&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Age&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;49&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Forename&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Fred&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Surname&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Flintstone&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;DataContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color: #0000ff"&gt;StaticResource NewJoiner}&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;columndefinition&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1*&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;columndefinition&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Width&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;5*&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;rowdefinition&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;50&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;rowdefinition&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;50&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;rowdefinition&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Height&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;50&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;TargetType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;TextBlock&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Margin&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;10&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;HorizontalAlignment&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Right&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;VerticalAlignment&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Center&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;TargetType&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;TextBox&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Margin&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;10&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Width&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;154&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;HorizontalAlignment&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Left&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;setter&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Property&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;VerticalAlignment&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Value&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Center&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;First Name&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Last Name&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Age&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;2&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;textbox&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Forename&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;0&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color: #0000ff"&gt;Binding Forename, Mode=TwoWay, ValidatesOnDataErrors=True}&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;textbox&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Surname&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color: #0000ff"&gt;Binding Surname, Mode=TwoWay, ValidatesOnDataErrors=True}&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;textbox&lt;/span&gt;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;Age&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;2&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt;1&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; &lt;/span&gt;&lt;span style="color: #ff0000"&gt;Text&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&lt;/span&gt;&amp;quot;{&lt;span style="color: #0000ff"&gt;Binding Age, Mode=TwoWay, ValidatesOnDataErrors=True}&lt;/span&gt;&amp;quot;&lt;span style="color: #0000ff"&gt; /&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160; &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;br /&gt;  &lt;p&gt;The code:&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9ce6104f-a9aa-4a17-a79f-3a39532ebf7c:568aaddd-4d61-45e7-80bd-d396badd44db" class="wlWriterSmartContent"&gt;   &lt;div style="border-bottom: #000080 1px solid; border-left: #000080 1px solid; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; color: #000; font-size: 10pt; border-top: #000080 1px solid; border-right: #000080 1px solid"&gt;     &lt;div style="padding-bottom: 2px; padding-left: 5px; padding-right: 5px; font-family: verdana, tahoma, arial, sans-serif; background: #000080; color: #fff; font-weight: bold; padding-top: 2px"&gt;IMPLEMENTATION&lt;/div&gt;      &lt;div style="background: #ddd; overflow: auto"&gt;       &lt;ol style="padding-bottom: 0px; margin: 0px 0px 0px 2.5em; padding-left: 5px; padding-right: 0px; background: #ffffff; padding-top: 0px"&gt;         &lt;li&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af"&gt;Person&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;IDataErrorInfo&lt;/span&gt; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;{ &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Forename { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Surname { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; } &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; Age { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt;; &lt;span style="color: #0000ff"&gt;set&lt;/span&gt;; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Error { &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;; } } &lt;/li&gt;          &lt;li&gt;&amp;#160; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;[&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; columnName] &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #0000ff"&gt;get&lt;/span&gt; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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 style="color: #0000ff"&gt;string&lt;/span&gt; error = &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;; &lt;/li&gt;          &lt;li&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 style="color: #0000ff"&gt;switch&lt;/span&gt; (columnName) &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; { &lt;/li&gt;          &lt;li&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 style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #a31515"&gt;&amp;quot;Forename&amp;quot;&lt;/span&gt;: &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(Forename)) &lt;/li&gt;          &lt;li&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; error = &lt;span style="color: #a31515"&gt;&amp;quot;Forename required&amp;quot;&lt;/span&gt;; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;; &lt;/li&gt;          &lt;li&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 style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #a31515"&gt;&amp;quot;Surname&amp;quot;&lt;/span&gt;: &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Surname)) &lt;/li&gt;          &lt;li&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; error = &lt;span style="color: #a31515"&gt;&amp;quot;Surname required&amp;quot;&lt;/span&gt;; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;; &lt;/li&gt;          &lt;li&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 style="color: #0000ff"&gt;case&lt;/span&gt; &lt;span style="color: #a31515"&gt;&amp;quot;Age&amp;quot;&lt;/span&gt;: &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Age &amp;lt; 0 || &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Age &amp;gt; 130) &lt;/li&gt;          &lt;li&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; error = &lt;span style="color: #a31515"&gt;&amp;quot;Invalid Age&amp;quot;&lt;/span&gt;; &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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; &lt;span style="color: #0000ff"&gt;break&lt;/span&gt;; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&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 style="color: #0000ff"&gt;return&lt;/span&gt; error; &lt;/li&gt;          &lt;li&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li style="background: #f3f3f3"&gt;&amp;#160;&amp;#160;&amp;#160; } &lt;/li&gt;          &lt;li&gt;} &lt;/li&gt;       &lt;/ol&gt;     &lt;/div&gt;   &lt;/div&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;The result:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyZhH1il53I/AAAAAAAAAE0/piD8a5uHDOM/s1600-h/image%5B14%5D.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyZhNoVa87I/AAAAAAAAAE4/2vRUCT6quq0/image_thumb%5B13%5D.png?imgmax=800" width="706" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-7584797473848834843?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/7584797473848834843/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=7584797473848834843' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/7584797473848834843'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/7584797473848834843'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire_9593.html' title='Five Minute Silverlight 4 Aides-Memoire #7 – IDataErrorInfo'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyZhNoVa87I/AAAAAAAAAE4/2vRUCT6quq0/s72-c/image_thumb%5B13%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-282686001008637557</id><published>2009-12-14T12:23:00.003Z</published><updated>2009-12-14T16:00:09.880Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Right Mouse Event'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #6 – Right Mouse Event Support</title><content type='html'>&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Popup &lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="PopupMenu" &lt;/span&gt;&lt;span style="color: red;"&gt;IsOpen&lt;/span&gt;&lt;span style="color: blue;"&gt;="False"&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox &lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="MenuItems"&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBoxItem &lt;/span&gt;&lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Item 1" /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBoxItem &lt;/span&gt;&lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Item 2" /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBoxItem &lt;/span&gt;&lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Item 3" /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBoxItem &lt;/span&gt;&lt;span style="color: red;"&gt;Content&lt;/span&gt;&lt;span style="color: blue;"&gt;="Item 4" /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;ListBox&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Popup&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public &lt;/span&gt;MainPage()&lt;br /&gt;{&lt;br /&gt;    InitializeComponent();&lt;br /&gt;    MouseRightButtonDown += (s, e) =&amp;gt; e.Handled = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;br /&gt;    MouseRightButtonUp += MainPage_MouseRightButtonUp;&lt;br /&gt;    MenuItems.MouseLeftButtonUp += MenuItems_MouseLeftButtonUp;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;void &lt;/span&gt;MainPage_MouseRightButtonUp(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, System.Windows.Input.&lt;span style="color: #2b91af;"&gt;MouseButtonEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.PopupMenu.HorizontalOffset = e.GetPosition(&lt;span style="color: blue;"&gt;this&lt;/span&gt;).X;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.PopupMenu.VerticalOffset = e.GetPosition(&lt;span style="color: blue;"&gt;this&lt;/span&gt;).Y;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.PopupMenu.IsOpen = &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;void &lt;/span&gt;MenuItems_MouseLeftButtonUp(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, System.Windows.Input.&lt;span style="color: #2b91af;"&gt;MouseButtonEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    PopupMenu.IsOpen = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;br /&gt;    System.Diagnostics.&lt;span style="color: #2b91af;"&gt;Debug&lt;/span&gt;.WriteLine(((sender &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ListBox&lt;/span&gt;).SelectedItem &lt;span style="color: blue;"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;ListBoxItem&lt;/span&gt;).Content);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-282686001008637557?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/282686001008637557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=282686001008637557' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/282686001008637557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/282686001008637557'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire_2771.html' title='Five Minute Silverlight 4 Aides-Memoire #6 – Right Mouse Event Support'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-801419346164433365</id><published>2009-12-14T12:07:00.004Z</published><updated>2009-12-14T16:04:16.947Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='RichTextArea'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #5 – Rich Text Area Control</title><content type='html'>&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RichTextArea &lt;/span&gt;&lt;span style="color: red;"&gt;x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="Editor"&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RichTextArea.Blocks&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Paragraph&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Run &lt;/span&gt;&lt;span style="color: red;"&gt;Foreground&lt;/span&gt;&lt;span style="color: blue;"&gt;="Blue" &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="This is "/&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Run &lt;/span&gt;&lt;span style="color: red;"&gt;Foreground&lt;/span&gt;&lt;span style="color: blue;"&gt;="Red" &lt;/span&gt;&lt;span style="color: red;"&gt;FontWeight&lt;/span&gt;&lt;span style="color: blue;"&gt;="Bold" &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="some sample " /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Run &lt;/span&gt;&lt;span style="color: red;"&gt;FontStyle&lt;/span&gt;&lt;span style="color: blue;"&gt;="Italic" &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="text" /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Paragraph&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Paragraph&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Run &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="Here is "/&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Run &lt;/span&gt;&lt;span style="color: red;"&gt;TextDecorations&lt;/span&gt;&lt;span style="color: blue;"&gt;="Underline" &lt;/span&gt;&lt;span style="color: red;"&gt;Text&lt;/span&gt;&lt;span style="color: blue;"&gt;="some more" /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;Paragraph&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RichTextArea.Blocks&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;RichTextArea&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;void &lt;/span&gt;UnderlineSelection_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue;"&gt;    var &lt;/span&gt;currentValue = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Editor.Selection.GetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.TextDecorationsProperty);&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    TextDecorationCollection &lt;/span&gt;setValue = &lt;span style="color: #2b91af;"&gt;TextDecorations&lt;/span&gt;.Underline;&lt;br /&gt;&lt;span style="color: blue;"&gt;    if &lt;/span&gt;(currentValue != &lt;span style="color: #2b91af;"&gt;DependencyProperty&lt;/span&gt;.UnsetValue)&lt;br /&gt;        setValue = (&lt;span style="color: #2b91af;"&gt;TextDecorationCollection&lt;/span&gt;)currentValue == setValue ? &lt;span style="color: blue;"&gt;null &lt;/span&gt;: setValue;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.Editor.Selection.SetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.TextDecorationsProperty, setValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;void &lt;/span&gt;ItalicSelection_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue;"&gt;    var &lt;/span&gt;currentValue = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Editor.Selection.GetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.FontStyleProperty);&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    FontStyle &lt;/span&gt;setValue = &lt;span style="color: #2b91af;"&gt;FontStyles&lt;/span&gt;.Italic;&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    FontStyle &lt;/span&gt;defaultValue = &lt;span style="color: #2b91af;"&gt;FontStyles&lt;/span&gt;.Normal;&lt;br /&gt;&lt;span style="color: blue;"&gt;    if &lt;/span&gt;(currentValue != &lt;span style="color: #2b91af;"&gt;DependencyProperty&lt;/span&gt;.UnsetValue)&lt;br /&gt;        setValue = (&lt;span style="color: #2b91af;"&gt;FontStyle&lt;/span&gt;)currentValue == setValue ? defaultValue : setValue;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.Editor.Selection.SetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.FontStyleProperty, setValue);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;void &lt;/span&gt;BoldSelection_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue;"&gt;    var &lt;/span&gt;currentValue = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.Editor.Selection.GetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.FontWeightProperty);&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    FontWeight &lt;/span&gt;setValue = &lt;span style="color: #2b91af;"&gt;FontWeights&lt;/span&gt;.Bold;&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    FontWeight &lt;/span&gt;defaultValue = &lt;span style="color: #2b91af;"&gt;FontWeights&lt;/span&gt;.Normal;&lt;br /&gt;&lt;span style="color: blue;"&gt;    if &lt;/span&gt;(currentValue != &lt;span style="color: #2b91af;"&gt;DependencyProperty&lt;/span&gt;.UnsetValue)&lt;br /&gt;        setValue = (&lt;span style="color: #2b91af;"&gt;FontWeight&lt;/span&gt;)currentValue == setValue ? defaultValue : setValue;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.Editor.Selection.SetPropertyValue(&lt;span style="color: #2b91af;"&gt;TextElement&lt;/span&gt;.FontWeightProperty, setValue);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyYqS8-VyFI/AAAAAAAAAEs/qr__GaXEGoA/s1600-h/image[7].png"&gt;&lt;img alt="image" border="0" height="231" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyYqXmQOK9I/AAAAAAAAAEw/ShsH1a6RMcc/image_thumb%5B8%5D.png?imgmax=800" style="border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin: 0px 0px 0px 40px;" title="image" width="540" /&gt;&lt;/a&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-801419346164433365?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/801419346164433365/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=801419346164433365' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/801419346164433365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/801419346164433365'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire_14.html' title='Five Minute Silverlight 4 Aides-Memoire #5 – Rich Text Area Control'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SyYqXmQOK9I/AAAAAAAAAEw/ShsH1a6RMcc/s72-c/image_thumb%5B8%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-2135690117408239994</id><published>2009-12-04T07:22:00.002Z</published><updated>2009-12-14T16:05:04.897Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Clipboard'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #4 – Clipboard Access</title><content type='html'>&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;PopButton_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue;"&gt;    var &lt;/span&gt;newPara = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Paragraph&lt;/span&gt;();&lt;br /&gt;&lt;br /&gt;    newPara.Inlines.Add(&lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;Run &lt;/span&gt;{ Text = &lt;span style="color: #2b91af;"&gt;Clipboard&lt;/span&gt;.GetText() });&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;    this&lt;/span&gt;.rightRichTextArea.Blocks.Add(newPara);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;PushButton_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    Clipboard&lt;/span&gt;.SetText(&lt;span style="color: blue;"&gt;this&lt;/span&gt;.leftRichTextArea.Selection.Text);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-2135690117408239994?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/2135690117408239994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=2135690117408239994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2135690117408239994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2135690117408239994'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire_04.html' title='Five Minute Silverlight 4 Aides-Memoire #4 – Clipboard Access'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8969506401868890949</id><published>2009-12-01T21:07:00.005Z</published><updated>2009-12-03T00:22:17.684Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='WebCam'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #3 – WebCam/Microphone Device Support</title><content type='html'>&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ListBoxStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ListBox&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ItemTemplate&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;5&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;UniformToFill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;80&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Center&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ItemsPanel&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Horizontal&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Center&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Center&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ItemsPanelTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Start WebCam&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Click&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;StartWebCam_Click&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot;&lt;/span&gt;&lt;span style="color: red"&gt; &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Snapshot&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Click&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Snapshot_Click&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Rectangle &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CapturedImage&amp;quot; &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ListBox &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.RowSpan&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Snapshots&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ListBoxStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;StartWebCam_Click(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: blue"&gt;    if &lt;/span&gt;(!&lt;span style="color: #2b91af"&gt;CaptureDeviceConfiguration&lt;/span&gt;.AllowedDeviceAccess &amp;amp; !&lt;span style="color: #2b91af"&gt;CaptureDeviceConfiguration&lt;/span&gt;.RequestDeviceAccess())&lt;br /&gt;&lt;span style="color: blue"&gt;        return&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: #2b91af"&gt;    VideoBrush &lt;/span&gt;videoBrush = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;VideoBrush&lt;/span&gt;();&lt;br /&gt;    videoBrush.SetSource(captureSource);&lt;br /&gt;    CapturedImage.Fill = videoBrush;&lt;br /&gt;&lt;span style="color: blue"&gt;    this&lt;/span&gt;.Snapshots.ItemsSource = snaps;&lt;br /&gt;    captureSource.Start();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;Snapshot_Click(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    captureSource.AsyncCaptureImage((image) =&amp;gt; { snaps.Add(image); });&lt;br /&gt;}&lt;/pre&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8969506401868890949?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8969506401868890949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8969506401868890949' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8969506401868890949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8969506401868890949'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire_01.html' title='Five Minute Silverlight 4 Aides-Memoire #3 – WebCam/Microphone Device Support'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8587766097584326710</id><published>2009-12-01T20:45:00.003Z</published><updated>2009-12-02T10:01:15.630Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Printing'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #2 – Printing</title><content type='html'>&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;Print_Click(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;RoutedEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="color: #2b91af;"&gt;    PrintDocument &lt;/span&gt;printDoc = &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;PrintDocument&lt;/span&gt;();&lt;br /&gt;&lt;br /&gt;&lt;span style="background: #caffca; color: green;"&gt;&lt;span style="background-color: white;"&gt;    &lt;/span&gt;// Name that will show in the spooler...&lt;br /&gt;&lt;/span&gt;    printDoc.DocumentName = &lt;span style="color: #a31515;"&gt;"Directory Tree"&lt;/span&gt;;&lt;br /&gt;    printDoc.PrintPage += &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;PrintPageEventArgs&lt;/span&gt;&amp;gt;(printDoc_PrintPage);&lt;br /&gt;    printDoc.Print();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue;"&gt;private void &lt;/span&gt;printDoc_PrintPage(&lt;span style="color: blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af;"&gt;PrintPageEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;&lt;span style="background: #caffca; color: green;"&gt;&lt;span style="background-color: white;"&gt;    &lt;/span&gt;// Needs a UIElement (visual tree)&lt;br /&gt;&lt;/span&gt;    e.PageVisual = DirectoriesTreeView;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="background: #caffca; color: green;"&gt;&lt;span style="background-color: white;"&gt;    &lt;/span&gt;// Setting true will ensure PrintPage is called again for subsequent pages&lt;br /&gt;&lt;/span&gt;    e.HasMorePages = &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8587766097584326710?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8587766097584326710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8587766097584326710' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8587766097584326710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8587766097584326710'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/12/five-minute-silverlight-4-aides-memoire.html' title='Five Minute Silverlight 4 Aides-Memoire #2 – Printing'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-2448785990389520215</id><published>2009-11-30T12:18:00.004Z</published><updated>2009-12-02T09:37:32.258Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='Drag and Drop'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Out of Browser'/><title type='text'>Five Minute Silverlight 4 Aides-Memoire #1 – Drag and Drop</title><content type='html'>&lt;p&gt;Build a hierarchical treeview of files and directories dropped from a Windows Explorer window. Requires elevated trust running out of browser to avoid security exceptions when accessing the directory information in the FileInfo objects returned from the e.Data.GetData call.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SxO32keNczI/AAAAAAAAAEg/Q6YnbgIa91U/s1600-h/image7.png"&gt;&lt;img title="image" style="BORDER-TOP-WIDTH: 0px; DISPLAY: inline; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height="526" alt="image" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SxO39h78hbI/AAAAAAAAAEk/Ck-aNGxspXA/image_thumb5.png?imgmax=800" width="440" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;="LayoutRoot" &lt;/span&gt;&lt;span style="color:red;"&gt;AllowDrop&lt;/span&gt;&lt;span style="color:blue;"&gt;="True" &lt;/span&gt;&lt;span style="color:red;"&gt;Drop&lt;/span&gt;&lt;span style="color:blue;"&gt;="LayoutRoot_Drop"&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;my&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;TreeView &lt;/span&gt;&lt;span style="color:red;"&gt;x&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:red;"&gt;Name&lt;/span&gt;&lt;span style="color:blue;"&gt;="DirectoriesTreeView" &lt;/span&gt;&lt;span style="color:red;"&gt;Margin&lt;/span&gt;&lt;span style="color:blue;"&gt;="50" &lt;/span&gt;&lt;span style="color:red;"&gt;Width&lt;/span&gt;&lt;span style="color:blue;"&gt;="500" /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&lt;/span&gt;&lt;span style="color:blue;"&gt;private void &lt;/span&gt;LayoutRoot_Drop(&lt;span style="color:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="color:#2b91af;"&gt;DragEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(!&lt;span style="color:#2b91af;"&gt;Application&lt;/span&gt;.Current.HasElevatedPermissions  e.Data == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;        &lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt;[] fileInfos = e.Data.GetData(&lt;span style="color:#2b91af;"&gt;DataFormats&lt;/span&gt;.FileDrop) &lt;span style="color:blue;"&gt;as &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt;[];&lt;br /&gt;    &lt;span style="color:blue;"&gt;if &lt;/span&gt;(fileInfos == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;br /&gt;        &lt;span style="color:blue;"&gt;return&lt;/span&gt;;&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt;&amp;gt; sortedList = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color:#2b91af;"&gt;FileInfo&lt;/span&gt;&amp;gt;(fileInfos);&lt;br /&gt;&lt;br /&gt;    sortedList.Sort((x, y) =&amp;gt;&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:blue;"&gt;if &lt;/span&gt;(x.Attributes == &lt;span style="color:#2b91af;"&gt;FileAttributes&lt;/span&gt;.Directory &amp;amp;&amp;amp; y.Attributes != &lt;span style="color:#2b91af;"&gt;FileAttributes&lt;/span&gt;.Directory)&lt;br /&gt;            &lt;span style="color:blue;"&gt;return &lt;/span&gt;-&lt;span style="color:brown;"&gt;1&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color:blue;"&gt;if &lt;/span&gt;(y.Attributes == &lt;span style="color:#2b91af;"&gt;FileAttributes&lt;/span&gt;.Directory &amp;amp;&amp;amp; x.Attributes != &lt;span style="color:#2b91af;"&gt;FileAttributes&lt;/span&gt;.Directory)&lt;br /&gt;            &lt;span style="color:blue;"&gt;return &lt;/span&gt;&lt;span style="color:brown;"&gt;1&lt;/span&gt;;&lt;br /&gt;        &lt;span style="color:blue;"&gt;return &lt;/span&gt;x.Name.CompareTo(y.Name);&lt;br /&gt;    });&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;FileInfo &lt;/span&gt;fileInfo &lt;span style="color:blue;"&gt;in &lt;/span&gt;sortedList)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:blue;"&gt;var &lt;/span&gt;newNode = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;TreeViewItem &lt;/span&gt;{ Header = fileInfo.Name };&lt;br /&gt;        DirectoriesTreeView.Items.Add(newNode);&lt;br /&gt;        &lt;span style="color:blue;"&gt;if &lt;/span&gt;(!fileInfo.Exists)&lt;br /&gt;            ProcessDirectory(fileInfo, newNode);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;private static void &lt;/span&gt;ProcessDirectory(&lt;span style="color:#2b91af;"&gt;FileSystemInfo &lt;/span&gt;fileSystemInfo, &lt;span style="color:#2b91af;"&gt;TreeViewItem &lt;/span&gt;currentNode)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color:#2b91af;"&gt;DirectoryInfo &lt;/span&gt;directoryInfo = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;DirectoryInfo&lt;/span&gt;(fileSystemInfo.FullName);&lt;br /&gt;&lt;br /&gt;    &lt;span style="color:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;FileSystemInfo &lt;/span&gt;childFileSystemInfo &lt;span style="color:blue;"&gt;in &lt;/span&gt;directoryInfo.EnumerateFileSystemInfos())&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color:blue;"&gt;var &lt;/span&gt;newNode = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;TreeViewItem &lt;/span&gt;{ Header = childFileSystemInfo.Name };&lt;br /&gt;        currentNode.Items.Add(newNode);&lt;br /&gt;        &lt;span style="color:blue;"&gt;if &lt;/span&gt;(childFileSystemInfo.Attributes == &lt;span style="color:#2b91af;"&gt;FileAttributes&lt;/span&gt;.Directory)&lt;br /&gt;            ProcessDirectory(childFileSystemInfo, newNode);&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-2448785990389520215?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/2448785990389520215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=2448785990389520215' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2448785990389520215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2448785990389520215'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/11/five-minute-silverlight-4-aides-memoire.html' title='Five Minute Silverlight 4 Aides-Memoire #1 – Drag and Drop'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SxO39h78hbI/AAAAAAAAAEk/Ck-aNGxspXA/s72-c/image_thumb5.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-3769159320234940178</id><published>2009-11-18T23:41:00.003Z</published><updated>2009-12-02T09:55:18.610Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='WebCam'/><category scheme='http://www.blogger.com/atom/ns#' term='MVVM'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 4 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='Drag and Drop'/><category scheme='http://www.blogger.com/atom/ns#' term='RichTextArea'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Printing'/><category scheme='http://www.blogger.com/atom/ns#' term='Out of Browser'/><category scheme='http://www.blogger.com/atom/ns#' term='Clipboard'/><title type='text'>Silverlight 4</title><content type='html'>Quite unexpectedly, at least I wasn’t expecting it, today saw the announcement of the first &lt;a href="http://silverlight.net/getstarted/silverlight-4-beta/"&gt;beta of Silverlight 4&lt;/a&gt; at PDC09 in Los Angeles. Barely has version 3 made it out there, but we have a new beta to play with together with another rev of Blend to support it (and .NET 4 in general).&lt;br /&gt;A quick run through the main features in the beta:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;strong&gt;Printing&lt;/strong&gt; – Full access to the regular print facilities of the host machine – the print dialog and print preview features – so long to all the writable bitmaps and HTML bridge hacks&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Webcam/microphone support&lt;/strong&gt; – Subject to UAC/user confirmation, you can now programmatically get access to connected devices, capture video, stills and audio input streams&lt;/li&gt;&lt;li&gt;&lt;strong&gt;A Rich TextBox control&lt;/strong&gt; – the WPF RTF control makes its appearance in Silverlight – embed other UI Elements, control text Runs and other formatting such as Text Decorations&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Clipboard Access&lt;/strong&gt; – Programmatic access to the clipboard – again subject to UAC&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Right Mouse Context Menus&lt;/strong&gt; – Full control of a customisable context menu – add whatever you want to it and respond to selection events&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Drag-Drop Drop-Target support&lt;/strong&gt; Silverlight apps can now act as drag-drop drop-targets receiving file information for the dropped file object(s)&lt;/li&gt;&lt;li&gt;&lt;strong&gt;MVVM Commanding – &lt;/strong&gt;Finally proper implementation of the ICommand interface – no longer a need to kludge it via bindings to helper classes&lt;/li&gt;&lt;li&gt;&lt;strong&gt;IDataErrorInfo/Validation support – &lt;/strong&gt;Integration of the support for the IDataErrorInfo interface in Silverlight’s DataBinding giving a validation framework for input controls to leverage in consistently surfacing data input errors with asynchronous data validation&lt;/li&gt;&lt;li&gt;&lt;strong&gt;String Formatting in Binding Extensions&lt;/strong&gt; – As with WPF, Silverlight has been retrofitted with improved formatting support in the binding extension to give better control over stuff like date, time and other formatting for locales and long and short formatting&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Out of Browser improvements: &lt;/strong&gt;&lt;strong&gt;HTML content&lt;/strong&gt; - Hosting of HTML content within the Silverlight app; &lt;strong&gt;Notifications &lt;/strong&gt;(aka toast) support; &lt;strong&gt;Elevated Trust &lt;/strong&gt;(again via UAC) access to the My Documents, My Videos, My Pictures special folders; &lt;strong&gt;Cross domain access &lt;/strong&gt;and &lt;strong&gt;Full keyboard access in Full Screen&lt;/strong&gt; mode&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Better tooling and integration of RIA/ADO Services/WCF/MEF&lt;/strong&gt;&lt;/li&gt;&lt;/ul&gt;Lots to check out and try out – exciting stuff!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-3769159320234940178?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/3769159320234940178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=3769159320234940178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3769159320234940178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3769159320234940178'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/11/silverlight-4.html' title='Silverlight 4'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4962737270475995986</id><published>2009-08-11T07:26:00.001+01:00</published><updated>2009-08-11T07:26:35.471+01:00</updated><title type='text'>Five Minute Silverlight 3 Aides-Memoire #5 – Based on Styles</title><content type='html'>&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ColouredContentControlStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ContentControl&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Height&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Width&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Margin&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontFamily&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Verdana&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontSize&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;14&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Italic&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ColouredCheckBoxStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;BasedOn&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ColouredContentControlStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBox&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Width&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;RedButtonStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;BasedOn&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ColouredContentControlStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Red&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;GreenButtonStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;BasedOn&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ColouredContentControlStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Green&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;YellowCheckBoxStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;BasedOn&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ColouredCheckBoxStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBox&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Yellow&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OrangeRadioButtonStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;BasedOn&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;ColouredContentControlStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;RadioButton&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Orange&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Width&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;190&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontWeight&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Bold&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush &lt;/span&gt;&lt;span style="color: red"&gt;EndPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StartPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,0&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Vertical&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;RedButtonStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Red Button&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;CheckBox &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;YellowCheckBoxStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Yellow CheckBox&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RadioButton &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;OrangeRadioButtonStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Orange RadioButton&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;GreenButtonStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Green Button&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/SoEPFRqyF3I/AAAAAAAAAEY/oqAPdmtSGxE/s1600-h/FiveMinuteSilverlight3_53.png"&gt;&lt;img style="border-right-width: 0px; margin: 30px 0px 0px 30px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="FiveMinuteSilverlight3_5" border="0" alt="FiveMinuteSilverlight3_5" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SoEPGSB17LI/AAAAAAAAAEc/gXWp0K09PQ8/FiveMinuteSilverlight3_5_thumb1.png?imgmax=800" width="308" height="284" /&gt;&lt;/a&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4962737270475995986?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4962737270475995986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4962737270475995986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4962737270475995986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4962737270475995986'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/08/five-minute-silverlight-3-aides-memoire_4427.html' title='Five Minute Silverlight 3 Aides-Memoire #5 – Based on Styles'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SoEPGSB17LI/AAAAAAAAAEc/gXWp0K09PQ8/s72-c/FiveMinuteSilverlight3_5_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8941459195946211115</id><published>2009-08-11T07:25:00.001+01:00</published><updated>2009-08-11T07:25:26.976+01:00</updated><title type='text'>Five Minute Silverlight 3 Aides-Memoire #4 – Merged Resource Dictionaries</title><content type='html'>&lt;p&gt;&lt;strong&gt;ButtonStyles.xaml:&lt;/strong&gt;&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonsStyles&amp;quot; &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;br /&gt;    &amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;RedButton&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Red&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Height&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Width&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Margin&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;GreenButton&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Green&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Height&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Width&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Margin&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;CheckBoxStyles.xaml:&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary &lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;xmlns&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;br /&gt;    &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBoxStyles&amp;quot;&lt;br /&gt;    &amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;YellowCheckBox&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBox&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Yellow&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Height&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Margin&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OrangeCheckBox&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBox&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Orange&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Height&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Margin&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;MainPage.xaml:&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ButtonStyles.xaml&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CheckBoxStyles.xaml&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary.MergedDictionaries&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;UserControl.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush &lt;/span&gt;&lt;span style="color: red"&gt;EndPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StartPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,0&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;RedButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Red Button&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;GreenButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Green Button&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;CheckBox &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;YellowCheckBox&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Yellow CheckBox&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;CheckBox &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;OrangeCheckBox&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Orange CheckBox&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/SoEOqr1lMmI/AAAAAAAAAEQ/oXdCYXqRSLQ/s1600-h/FiveMinuteSilverlight3_43.png"&gt;&lt;img style="border-right-width: 0px; margin: 30px 0px 0px 30px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="FiveMinuteSilverlight3_4" border="0" alt="FiveMinuteSilverlight3_4" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SoEOrvc7tbI/AAAAAAAAAEU/zQGXix_qDxs/FiveMinuteSilverlight3_4_thumb1.png?imgmax=800" width="519" height="137" /&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8941459195946211115?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8941459195946211115/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8941459195946211115' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8941459195946211115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8941459195946211115'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/08/five-minute-silverlight-3-aides-memoire_11.html' title='Five Minute Silverlight 3 Aides-Memoire #4 – Merged Resource Dictionaries'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SoEOrvc7tbI/AAAAAAAAAEU/zQGXix_qDxs/s72-c/FiveMinuteSilverlight3_4_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-413714132242065117</id><published>2009-08-06T20:36:00.001+01:00</published><updated>2009-08-06T20:36:39.207+01:00</updated><title type='text'>Five Minute Silverlight 3 Aides-Memoire #3 – Element-to-element binding</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;*&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;40&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush &lt;/span&gt;&lt;span style="color: red"&gt;EndPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StartPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,0&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,50,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OpenfeatureLizardSquare.jpg&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ImagePlaneProjection&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Slider &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;RotationX&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay, &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=ImagePlaneProjection}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;XSlider&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Minimum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-360&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Maximum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;360&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,10&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Slider &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;, &lt;/span&gt;&lt;span style="color: red"&gt;Mode&lt;/span&gt;&lt;span style="color: blue"&gt;=TwoWay, &lt;/span&gt;&lt;span style="color: red"&gt;ElementName&lt;/span&gt;&lt;span style="color: blue"&gt;=ImagePlaneProjection}&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;YSlider&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Minimum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-360&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Maximum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;360&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,10&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SnswxOm3qUI/AAAAAAAAAEI/_evV-7LScTc/s1600-h/FiveMinuteSilverlight3_33.png"&gt;&lt;img style="border-right-width: 0px; margin: 30px 0px 0px 30px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="FiveMinuteSilverlight3_3" border="0" alt="FiveMinuteSilverlight3_3" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SnswxtBEg0I/AAAAAAAAAEM/JeR7xVBKAa4/FiveMinuteSilverlight3_3_thumb1.png?imgmax=800" width="426" height="291" /&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-413714132242065117?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/413714132242065117/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=413714132242065117' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/413714132242065117'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/413714132242065117'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/08/five-minute-silverlight-3-aides-memoire_06.html' title='Five Minute Silverlight 3 Aides-Memoire #3 – Element-to-element binding'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SnswxtBEg0I/AAAAAAAAAEM/JeR7xVBKAa4/s72-c/FiveMinuteSilverlight3_3_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4914674841908019052</id><published>2009-08-05T21:16:00.001+01:00</published><updated>2009-08-05T21:18:04.919+01:00</updated><title type='text'>Five Minute Silverlight 3 Aides-Memoire #2 – Pixel Effects</title><content type='html'>&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush &lt;/span&gt;&lt;span style="color: red"&gt;EndPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StartPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,0&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,50,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OpenfeatureLizardSquare.jpg&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Effect&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;BlurEffect &lt;/span&gt;&lt;span style="color: red"&gt;Radius&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;15&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Effect&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,50,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OpenfeatureLizardSquare.jpg&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Effect&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;DropShadowEffect &lt;/span&gt;&lt;span style="color: red"&gt;ShadowDepth&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;10&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Effect&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SnnohVhfgYI/AAAAAAAAAEA/LPVgHC6hfOg/s1600-h/FiveMinuteSilverlight3_2%5B5%5D.png"&gt;&lt;img style="border-right-width: 0px; margin: 30px 0px 0px 30px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="FiveMinuteSilverlight3_2" border="0" alt="FiveMinuteSilverlight3_2" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SnnojGOar2I/AAAAAAAAAEE/yinmEqpgbW0/FiveMinuteSilverlight3_2_thumb%5B3%5D.png?imgmax=800" width="599" height="279" /&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4914674841908019052?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4914674841908019052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4914674841908019052' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4914674841908019052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4914674841908019052'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/08/five-minute-silverlight-3-aides-memoire_05.html' title='Five Minute Silverlight 3 Aides-Memoire #2 – Pixel Effects'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SnnojGOar2I/AAAAAAAAAEE/yinmEqpgbW0/s72-c/FiveMinuteSilverlight3_2_thumb%5B3%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-3463500769181650436</id><published>2009-08-05T21:04:00.001+01:00</published><updated>2009-08-05T21:04:18.398+01:00</updated><title type='text'>Five Minute Silverlight 3 Aides-Memoire #1 – 3D Projection</title><content type='html'>&lt;p&gt;&lt;/p&gt;  &lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush &lt;/span&gt;&lt;span style="color: red"&gt;EndPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StartPoint&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5,0&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GradientStop &lt;/span&gt;&lt;span style="color: red"&gt;Color&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Offset&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Background&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Left&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;50,50,0,0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;200&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;OpenfeatureLizardSquare.jpg&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;RotationX&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-25&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;45&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/SnnltqHHLOI/AAAAAAAAAD4/WWBMxJWOj8g/s1600-h/FiveMinuteSilverlight3_1%5B2%5D.png"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; margin: 30px 0px 0px 30px; display: inline; border-top: 0px; border-right: 0px" title="FiveMinuteSilverlight3_1" border="0" alt="FiveMinuteSilverlight3_1" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SnnlwLZ0eLI/AAAAAAAAAD8/rhum0NN3ZVE/FiveMinuteSilverlight3_1_thumb.png?imgmax=800" width="244" height="244" /&gt;&lt;/a&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-3463500769181650436?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/3463500769181650436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=3463500769181650436' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3463500769181650436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3463500769181650436'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/08/five-minute-silverlight-3-aides-memoire.html' title='Five Minute Silverlight 3 Aides-Memoire #1 – 3D Projection'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SnnlwLZ0eLI/AAAAAAAAAD8/rhum0NN3ZVE/s72-c/FiveMinuteSilverlight3_1_thumb.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1164631839856251459</id><published>2009-06-10T23:29:00.001+01:00</published><updated>2011-04-22T13:21:38.058+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight 3 Beta'/><category scheme='http://www.blogger.com/atom/ns#' term='Petzold'/><category scheme='http://www.blogger.com/atom/ns#' term='Rotation'/><category scheme='http://www.blogger.com/atom/ns#' term='Plane Projection'/><category scheme='http://www.blogger.com/atom/ns#' term='PhotoCube'/><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>3D projections in Silverlight 3 Beta – part 2</title><content type='html'>&lt;p&gt;In my previous post on &lt;a href="http://joanmiro.blogspot.com/2009/05/3d-projections-in-silverlight-3-beta.html" target="_blank"&gt;3D projections in Silverlight 3 Beta&lt;/a&gt;, I created a basic PhotoCube that had images on the faces of a rotating cube created using the new 2D/3D PlaneProjection capabilities available in Silverlight 3.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SjAzx3KCgzI/AAAAAAAAADo/9gRwzMw9FT0/s1600-h/BasicCube3.png"&gt;&lt;img style="border-right-width: 0px; margin: 5px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BasicCube" border="0" alt="BasicCube" src="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SjAzybqMLjI/AAAAAAAAADs/7ppFxNF3eoI/BasicCube_thumb1.png?imgmax=800" width="382" height="284" /&gt;&lt;/a&gt; &lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SjAzy7YgALI/AAAAAAAAADw/5lIbYjQ76Q4/s1600-h/BasicPhotoCube7.png"&gt;&lt;img style="border-right-width: 0px; margin: 5px 0px 5px 5px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BasicPhotoCube" border="0" alt="BasicPhotoCube" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SjAzzgv17hI/AAAAAAAAAD0/hwpaHZEkq-E/BasicPhotoCube_thumb5.png?imgmax=800" width="389" height="286" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I thought I’d do a bit more and add some animation to the cube’s rotation and also do away with the slider and rotate the cube using the mouse. I thought it would be nice if the cube rotated slowly all the time, regardless of any mouse interaction, so the first thing to do was to set up an animation to do that. Because I want to be able to manipulate this animation whilst the various mouse events are firing to allow me to control of the cube’s rotation independent of the ‘background’ rotation, I need to define it at the page level:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Storyboard &lt;/span&gt;slowStoryboard;&lt;br /&gt;&lt;span style="color: blue"&gt;readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;, &lt;span style="color: blue"&gt;double&lt;/span&gt;&amp;gt; yRotations = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;, &lt;span style="color: blue"&gt;double&lt;/span&gt;&amp;gt;();&lt;br /&gt;&lt;span style="color: blue"&gt;private double &lt;/span&gt;mouseStart;&lt;br /&gt;&lt;span style="color: blue"&gt;private bool &lt;/span&gt;mouseIsDown;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue"&gt;public &lt;/span&gt;PhotoCubePage()&lt;br /&gt;{&lt;br /&gt;    InitializeComponent();&lt;br /&gt;&lt;br /&gt;    SetUpRotations();&lt;br /&gt;    slowStoryboard = CreateSlowRotation();&lt;br /&gt;    slowStoryboard.Begin();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Storyboard &lt;/span&gt;CreateSlowRotation()&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: #2b91af"&gt;Storyboard &lt;/span&gt;newStoryboard = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Storyboard &lt;/span&gt;{ Duration = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Duration&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(15)) };&lt;br /&gt;    newStoryboard.RepeatBehavior = &lt;span style="color: #2b91af"&gt;RepeatBehavior&lt;/span&gt;.Forever; &lt;br /&gt;    &lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;imageRotation &lt;span style="color: blue"&gt;in &lt;/span&gt;yRotations)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;var &lt;/span&gt;animation = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;DoubleAnimation &lt;/span&gt;{ Duration = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Duration&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(15)), BeginTime = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(0) };&lt;br /&gt;        newStoryboard.Children.Add(animation);&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Storyboard&lt;/span&gt;.SetTarget(animation, (imageRotation.Key.Projection &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;));&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(animation, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;(PlaneProjection.RotationY)&amp;quot;&lt;/span&gt;));&lt;br /&gt;        animation.To = imageRotation.Value + 360;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;return &lt;/span&gt;newStoryboard;&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;SetUpRotations()&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Image &lt;/span&gt;image &lt;span style="color: blue"&gt;in &lt;/span&gt;ImageGrid.Children.Cast&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;&amp;gt;())&lt;br /&gt;    {&lt;br /&gt;        yRotations.Add(image, ((&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;)image.Projection).RotationY);&lt;br /&gt;        image.MouseLeftButtonDown += ImageMouseLeftButtonDown;&lt;br /&gt;        image.MouseLeftButtonUp += ImageMouseLeftButtonUp;&lt;br /&gt;        image.MouseMove += ImageMouseMove;&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The animation is performed on each image as it will be for the mouse control, but a 15 second duration makes the cube turn slowly and I want a full rotation of 360 degrees. Setting the RepeatBehavior to Forever ensures that the animation doesn’t stop when it completes a complete rotation. The setup of the Dictionary of Images and their initial RotationY values has been moved to a method to tidy it up, and I now hook up the mouse events here as I need to respond to these on each image surface.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the mouse down event I record the X-position of the mouse, pause the slow-moving animation and capture the mouse. In the mouse move event, I calculate the mouse movement in the Y-direction and do an rough calculation based on the width of a face of the cube and the amount of mouse movement, to decide on the animation of the faces of the cube which I feed into the cube animation method. In the mouse up event I release mouse capture and restart the slow rotation of the cube.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;ImageMouseLeftButtonDown(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;MouseButtonEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    mouseStart = e.GetPosition(&lt;span style="color: blue"&gt;this&lt;/span&gt;).X;&lt;br /&gt;    slowStoryboard.Pause();&lt;br /&gt;    mouseIsDown = ((&lt;span style="color: #2b91af"&gt;UIElement&lt;/span&gt;)sender).CaptureMouse();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;ImageMouseLeftButtonUp(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;MouseButtonEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    mouseIsDown = &lt;span style="color: blue"&gt;false&lt;/span&gt;;&lt;br /&gt;    ReleaseMouseCapture();&lt;br /&gt;    slowStoryboard = CreateSlowRotation();&lt;br /&gt;    slowStoryboard.Begin();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;ImageMouseMove(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;MouseEventArgs &lt;/span&gt;e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue"&gt;if &lt;/span&gt;(mouseIsDown)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;double &lt;/span&gt;mouseMovement = mouseStart - e.GetPosition(&lt;span style="color: blue"&gt;this&lt;/span&gt;).X;&lt;br /&gt;        &lt;span style="color: blue"&gt;double &lt;/span&gt;rotation = mouseMovement / FrontImage.Width * 90;&lt;br /&gt;        AnimateRotation(rotation, 1);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;span style="color: blue"&gt;private void &lt;/span&gt;AnimateRotation(&lt;span style="color: blue"&gt;double &lt;/span&gt;movement, &lt;span style="color: blue"&gt;double &lt;/span&gt;seconds)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: blue"&gt;var &lt;/span&gt;duration = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Duration&lt;/span&gt;(&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(seconds));&lt;br /&gt;    &lt;span style="color: blue"&gt;var &lt;/span&gt;storyboard = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Storyboard &lt;/span&gt;{ Duration = duration };&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;imageRotation &lt;span style="color: blue"&gt;in &lt;/span&gt;yRotations)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;var &lt;/span&gt;animation = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;DoubleAnimation &lt;/span&gt;{ Duration = duration, BeginTime = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;TimeSpan&lt;/span&gt;(10) };&lt;br /&gt;        storyboard.Children.Add(animation);&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Storyboard&lt;/span&gt;.SetTarget(animation, (imageRotation.Key.Projection &lt;span style="color: blue"&gt;as &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;));&lt;br /&gt;        &lt;span style="color: #2b91af"&gt;Storyboard&lt;/span&gt;.SetTargetProperty(animation, &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PropertyPath&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&amp;quot;(PlaneProjection.RotationY)&amp;quot;&lt;/span&gt;));&lt;br /&gt;        animation.To = ((&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;)imageRotation.Key.Projection).RotationX + imageRotation.Value + movement;&lt;br /&gt;        animation.EasingFunction = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;ElasticEase &lt;/span&gt;{ EasingMode = &lt;span style="color: #2b91af"&gt;EasingMode&lt;/span&gt;.EaseOut, Oscillations = 3, Springiness = 6 };&lt;br /&gt;&lt;span style="color: blue"&gt;    &lt;/span&gt;}&lt;br /&gt;&lt;br /&gt;    storyboard.Begin();&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Just so that all the code is shown, here is the fairly simple XAML for the page:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;    &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Background&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;DarkGray&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ImageGrid&amp;quot; &amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FrontImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/silverlight.jpg&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LeftImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/OpenfeatureLizardSquare.jpg&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;90&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BackImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Waterfall.jpg&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;180&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;RightImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Tulip.jpg&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;270&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The result is that the cube turns slowly whilst the mouse is not being used to manipulate it and while the mouse is used to drag it the cube responds with animated movement; I use one of the pre-canned easing functions to give the animation a ‘springy’ feeling at the end of each movement. Notice that the animation method calculates the move-to value for each animation by adding the original position of the image/face to the movement value AND the current value of the RotationY which has been affected by the slow rotation.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;And here’s the result:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:{7D7E1B1B-BB15-44b5-AC22-DF49F6B00FD3}:c28f967a-75a1-405d-8375-5ce809b98af2" class="wlWriterSmartContent"&gt;&lt;iframe style="width: 320px; height: 240px" height="240" src="http://www.openfeature.co.uk/Silverlight/TestPage.html" frameborder="0" width="320" scrolling="no"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You may have noticed that although I have called the thing I am rotating a cube and in the first post there were actually six images, I have done away with the top and bottom of my cube in the latest mark-up. This is because they are not really visible whilst the ‘cube’ is rotating on just the Y-axis; I had intended to make it a proper cube and allow rotation along 2 axes (which would have given me full articulation of the cube, or even 3 – to allow me to move the cube in and out of the screen), but there is a problem when it comes to allowing movement in more that one direction.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The problem lies in the fact that once an image plane has been rotated along one axis, rotation in another one happens in relation to the original position, not the new one, so that the faces that become the sides of the cube, the back of the cube, the top and the bottom all need to be transformed in different ways to maintain the illusion of a solid shape in 3D space. For example, after the original Y-axis rotation to setup the cube’s sides and the X-axis rotation to setup the cube’s top and bottom, to rotate the cube along the X-axis, the sides need to be rotated along the Z-axis (i.e. the one that runs through their centre) and this assumes that they aren’t transformed further in the Y-axis themselves, by a slider or my attempts at animating them with mouse movement. In fact the maths for calculating the positions of the faces of the cube are quite complex; from dipping into Charles Petzold’s book: &lt;a href="http://www.amazon.co.uk/3D-Programming-Windows-Pro-Developer/dp/0735623945/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1244671072&amp;amp;sr=8-1" target="_blank"&gt;3D Programming for Windows&lt;/a&gt; and quickly getting bogged down with quaternions and rotation matrices, it was clear the maths were beyond the scope of this post, so I chickened out and did away with the top and bottom of the cube and abandoned the notion of full articulation (for now). So we have ended up what might be better called a ‘PhotoPrism’ that rotates only along the Y-axis.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This new name did give me the idea for a further refinement of the cube: if the thing is a prism, there is no reason why it can’t have a variable number of faces, from 3 upwards – the maths for calculating the positioning and angles of rotation for the faces would be much easier. &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Hmm, watch this space…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1164631839856251459?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1164631839856251459/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1164631839856251459' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1164631839856251459'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1164631839856251459'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/06/3d-projections-in-silverlight-3-beta.html' title='3D projections in Silverlight 3 Beta – part 2'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SjAzybqMLjI/AAAAAAAAADs/7ppFxNF3eoI/s72-c/BasicCube_thumb1.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8344080794076068512</id><published>2009-05-20T19:16:00.001+01:00</published><updated>2009-05-20T19:16:02.692+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='3D'/><category scheme='http://www.blogger.com/atom/ns#' term='Rotation'/><category scheme='http://www.blogger.com/atom/ns#' term='Plane Projection'/><category scheme='http://www.blogger.com/atom/ns#' term='PhotoCube'/><category scheme='http://www.blogger.com/atom/ns#' term='Animation'/><category scheme='http://www.blogger.com/atom/ns#' term='silverlight 3'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>3D projections in Silverlight 3 Beta</title><content type='html'>&lt;p&gt;I had a quick play with the new Plane Projection feature in the Silverlight 3 beta. Like many others, my first experiments were with taking a rectangular image and flipping it around the X, Y &amp;amp; Z axes (these suffixes will be denoted by * for mentions of properties from now on to save typing the variants). It is useful to think of these as long poles running in the respective directions with objects being transformed around these ‘spindles’ using the &lt;font color="#ff0000"&gt;Rotation*&lt;/font&gt; properties&lt;em&gt;.&lt;/em&gt; The &lt;font color="#ff0000"&gt;CenterOfRotation* &lt;/font&gt;&lt;font color="#000000"&gt;properties allow a displacement from the centre of the axis so that an element traces a circle around an axis when rotated rather than flips on that axis, so:&lt;/font&gt;&lt;/p&gt;  &lt;pre class="code"&gt;        &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Uniform&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;images/Tulip.jpg&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Opacity&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;120&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Uniform&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;images/Leaves.jpg&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Opacity&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0.5&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;240&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Uniform&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;images/Leaves.jpg&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;120&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Uniform&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;images/Tulip.jpg&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;                &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;240&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;100&amp;quot; /&amp;gt;&lt;br /&gt;            &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Path &lt;/span&gt;&lt;span style="color: red"&gt;Data&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;M77,0 L77,154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Fill&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;#FF000000&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;StrokeThickness&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stroke&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;#FF000000&amp;quot; /&amp;gt; &lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Produces the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/ShRIwaM-5gI/AAAAAAAAADQ/f3jWGT6r0hs/s1600-h/PlaneProjectionSample18.png"&gt;&lt;img style="border-right-width: 0px; margin: 20px 0px 0px 70px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="PlaneProjectionSample1" border="0" alt="PlaneProjectionSample1" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/ShRIzBjr1LI/AAAAAAAAADU/4MG5WlJZiZY/PlaneProjectionSample1_thumb6.png?imgmax=800" width="453" height="278" /&gt;&lt;/a&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The first 2 images rotate around the Y axis (I have added a Path line to mark its position and altered their opacity slightly to make things clearer), but the second 2 have had their Z positions (in and out of the screen, as it were) brought forward by 100 before being rotated around the Y axis. The grey background is the Grid that holds the images and you can see that the changes to the images’ projections can take them beyond their containing element.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Armed with this small amount of knowledge, I wanted to see if I could make a photocube and rotate it with animations or sliders so that the photos on all sides of the cube could be seen. Here’s the code:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;30&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;*&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ControlsPanel&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock &lt;/span&gt;&lt;span style="color: red"&gt;Text&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Y Rotation : &amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Center&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Slider &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;YSlider&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Center&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Minimum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Maximum&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;360&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;150&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;ValueChanged&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;YSlider_ValueChanged&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;StackPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ImageGrid&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FrontImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Front.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LeftImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Left.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;90&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BackImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Back.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;180&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;RightImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Right.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;270&amp;quot;/&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TopImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Top.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationX&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;90&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BottomImage&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Visibility&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;154&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Stretch&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fill&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Source&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Images/Bottom.png&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;            &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationZ&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-77&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;RotationX&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;270&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;    &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;public partial class &lt;/span&gt;&lt;span style="color: #2b91af"&gt;PhotoCubePage &lt;/span&gt;: &lt;span style="color: #2b91af"&gt;Page&lt;br /&gt;&lt;/span&gt;{&lt;br /&gt;    &lt;span style="color: blue"&gt;readonly &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;, &lt;span style="color: blue"&gt;double&lt;/span&gt;&amp;gt; yRotations = &lt;span style="color: blue"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af"&gt;Dictionary&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;, &lt;span style="color: blue"&gt;double&lt;/span&gt;&amp;gt;(6);&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: blue"&gt;public &lt;/span&gt;PhotoCubePage()&lt;br /&gt;    {&lt;br /&gt;        InitializeComponent();&lt;br /&gt;&lt;br /&gt;        &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: #2b91af"&gt;Image &lt;/span&gt;image &lt;span style="color: blue"&gt;in &lt;/span&gt;ImageGrid.Children.Cast&amp;lt;&lt;span style="color: #2b91af"&gt;Image&lt;/span&gt;&amp;gt;())&lt;br /&gt;        {&lt;br /&gt;            yRotations.Add(image, ((&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;)image.Projection).RotationY);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    &lt;span style="color: blue"&gt;private void &lt;/span&gt;YSlider_ValueChanged(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;span style="color: #2b91af"&gt;RoutedPropertyChangedEventArgs&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;double&lt;/span&gt;&amp;gt; e)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: blue"&gt;foreach &lt;/span&gt;(&lt;span style="color: blue"&gt;var &lt;/span&gt;imageRotation &lt;span style="color: blue"&gt;in &lt;/span&gt;yRotations)&lt;br /&gt;        {&lt;br /&gt;            ((&lt;span style="color: #2b91af"&gt;PlaneProjection&lt;/span&gt;) imageRotation.Key.Projection).RotationY = imageRotation.Value + ((&lt;span style="color: #2b91af"&gt;Slider&lt;/span&gt;) sender).Value;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Produces the following:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/ShRIzxEtEMI/AAAAAAAAADY/SoW-2a2PRzE/s1600-h/BasicCube3.png"&gt;&lt;img style="border-right-width: 0px; margin: 20px 0px 0px 70px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BasicCube" border="0" alt="BasicCube" src="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/ShRI0x3rC4I/AAAAAAAAADc/fA4jUC3UOzc/BasicCube_thumb1.png?imgmax=800" width="393" height="293" /&gt;&lt;/a&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;I used basic images with text on them so I could verify the positioning and rotation of the cube’s sides, but it looks nicer with some images:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/ShRI2ZZC83I/AAAAAAAAADg/Advr7aIQ5l0/s1600-h/BasicPhotoCube3.png"&gt;&lt;img style="border-right-width: 0px; margin: 20px 0px 0px 70px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BasicPhotoCube" border="0" alt="BasicPhotoCube" src="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/ShRI4N0o_MI/AAAAAAAAADk/jkQOhIa7mDk/BasicPhotoCube_thumb1.png?imgmax=800" width="386" height="284" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Next time – some mouse handling to rotate the cube, some animation easing for the cube’s movement and why it is much harder to rotate the cube along more than one axis…&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8344080794076068512?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8344080794076068512/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8344080794076068512' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8344080794076068512'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8344080794076068512'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/05/3d-projections-in-silverlight-3-beta.html' title='3D projections in Silverlight 3 Beta'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_E_ZM9Y7o2Ow/ShRIzBjr1LI/AAAAAAAAADU/4MG5WlJZiZY/s72-c/PlaneProjectionSample1_thumb6.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1879095322853169870</id><published>2009-03-19T21:52:00.001Z</published><updated>2009-03-19T22:25:24.958Z</updated><title type='text'>The new features in Silverlight 3 – 3D Projections</title><content type='html'>&lt;p&gt;Lots of interesting new stuff in the beta of Silverlight 3 – the 2D plane into 3D projection property that has been added to the UIElement class is obviously going to provide lots of opportunity to enhance control templates with mouse over and selected states in VSM. It is pretty easy to knock up a poor-man’s carousel type effect with a few buttons and a template with PlaneProjection transitions:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://lh3.ggpht.com/_E_ZM9Y7o2Ow/ScK-qp-6rmI/AAAAAAAAADI/qJF2hWZCDQI/s1600-h/QuickCarousel%5B8%5D.png"&gt;&lt;img style="border-right-width: 0px; margin: 20px 20px 20px 2px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="QuickCarousel" border="0" alt="QuickCarousel" src="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/ScK-rO_GC4I/AAAAAAAAADM/5mRkYhYu1pw/QuickCarousel_thumb%5B6%5D.png?imgmax=800" width="457" height="111" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ControlTemplate &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;      &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;grid&amp;quot;&amp;gt;      &lt;br /&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="color: #a31515"&gt;Grid.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;PlaneProjection &lt;/span&gt;&lt;span style="color: red"&gt;CenterOfRotationY&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; /&amp;gt;      &lt;br /&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="color: #a31515"&gt;Grid.Projection&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualStateGroup &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;CommonStates&amp;quot;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualTransition &lt;/span&gt;&lt;span style="color: red"&gt;GeneratedDuration&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;00:00:00.2000000&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;To&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;MouseOver&amp;quot;/&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualTransition &lt;/span&gt;&lt;span style="color: red"&gt;From&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;MouseOver&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;GeneratedDuration&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;00:00:00.5000000&amp;quot;/&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualStateGroup.Transitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualState &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Normal&amp;quot;&amp;gt;      &lt;br /&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="color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;DoubleAnimationUsingKeyFrames &lt;/span&gt;&lt;span style="color: red"&gt;BeginTime&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;00:00:00&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Duration&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;00:00:00.0010000&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Storyboard.TargetName&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;grid&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Storyboard.TargetProperty&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;(UIElement.Projection).(PlaneProjection.RotationX)&amp;quot;&amp;gt;      &lt;br /&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;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;EasingDoubleKeyFrame &lt;/span&gt;&lt;span style="color: red"&gt;KeyTime&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;00:00:00&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;-85&amp;quot;/&amp;gt;      &lt;br /&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="color: #a31515"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualState&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&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="color: #a31515"&gt;vsm&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;VisualState &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;MouseOver&amp;quot;&amp;gt;      &lt;br /&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="color: #a31515"&gt;Storyboard&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color: blue"&gt;etc...      &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;     &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;LayoutRoot&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Background&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;White&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;400&amp;quot;&amp;gt;      &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.Resources&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;RowDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Fred&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;FlipButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Barney&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;FlipButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button3&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Wilma&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;FlipButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button4&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Betty&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;3&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;FlipButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Name&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button5&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Content&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Pebbles&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Grid.Column&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;4&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;FlipButton&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;      &lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;      &lt;br /&gt;&lt;/span&gt;&lt;/p&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;  &lt;p&gt;The key thing is to target the UIElement’s Projection.ProjectionPlane property and to animate its RotationX, RotationY and RotationZ properties to transform the 2D plane of the element in the X, Y &amp;amp; Z dimensions. Setting the CentreOfRotationX, CentreOfRotationY &amp;amp; CentreOfRotationZ properties determines when the movement ‘hinges’ and the rotations are in degrees from the normal, untransformed state (i.e. 0 degrees).&lt;/p&gt;  &lt;p&gt;Five minutes obviously doesn’t make for a control – but interesting to play with the effect and I expect to see it crop up in many a control and Silverlight app in the future.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1879095322853169870?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1879095322853169870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1879095322853169870' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1879095322853169870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1879095322853169870'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/03/new-features-in-silverlight-3-3d.html' title='The new features in Silverlight 3 – 3D Projections'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_E_ZM9Y7o2Ow/ScK-rO_GC4I/AAAAAAAAADM/5mRkYhYu1pw/s72-c/QuickCarousel_thumb%5B6%5D.png?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4760606151744422786</id><published>2009-01-12T23:35:00.001Z</published><updated>2009-01-13T11:17:15.494Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows 7 beta'/><category scheme='http://www.blogger.com/atom/ns#' term='Desktop'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='WinForms'/><category scheme='http://www.blogger.com/atom/ns#' term='wallpaper'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><title type='text'>Great Minds…</title><content type='html'>&lt;p&gt;Having joined the millions of others who have downloaded and installed the Windows 7 beta recently, I noticed that one of the new features is the ability to have the desktop wallpaper change automatically at selectable intervals. This is functionality that I implemented in a little app that I wrote a few years ago as a bit of a C#.NET learning exercise and put up on my website. I called it the Openfeature WallpaperChanger and it is available &lt;a href="http://www.openfeature.co.uk/download/WallpaperChanger.exe"&gt;here&lt;/a&gt;. &lt;a href="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SWvTylkW7LI/AAAAAAAAACc/6dVeALBpv04/s1600-h/WallpaperChanger%5B5%5D.jpg"&gt;&lt;img style="border-right-width: 0px; margin: 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="WallpaperChanger" border="0" alt="WallpaperChanger" align="right" src="http://lh5.ggpht.com/_E_ZM9Y7o2Ow/SWvTzHdZaZI/AAAAAAAAACg/2lD_Wt-GW3U/WallpaperChanger_thumb%5B3%5D.jpg?imgmax=800" width="199" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It allows you to pick a set of images to use as desktop wallpapers and set the interval after which the app will select the next one and make it the Windows wallpaper; it also allows you to randomise the order and set the tile/stretch options for filling the screen. I had always intended to rework it as a Vista gadget, but I guess there won’t be a need to if Microsoft are going to make the functionality a feature of the OS.&lt;/p&gt;  &lt;p&gt;This is not the first time this has happened either – I had a hunt around but couldn’t find a copy of an app I wrote some time in the early 1990s which consisted of a 2-3 pixel wide UI bar that docked to one side of the Windows desktop and slide out to a larger surface when the mouse was moved over it to reveal a notepad icon, a printer icon and a wastepaper basket icon. Dragging files from the File Manager to the bar and dropping them on one of the icons would allow viewing, printing or deleting them. This was Windows 3/3.11 Workgroups and predated Windows 95 and the auto-hide taskbar by a year or two.&lt;/p&gt;  &lt;p&gt;Now I’m not for a moment suggesting that Microsoft spies were snooping on my hobby developer activities on each of these occasions - the phrase “don’t flatter yourself, dear” comes to mind - but I do think certain ideas have their time and emerge spontaneously, meme-like, in more than one place at the same time.&lt;/p&gt;  &lt;p&gt;And I guess anyway that there will be plenty of people who will claim that these sorts of features were already in the Apple Mac OS for others to steal long before they appeared in Windows and there will be others still who don’t reckon much to UX features like auto-hide, or cycling wallpapers anyway so maybe “fools seldom differ”.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4760606151744422786?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4760606151744422786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4760606151744422786' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4760606151744422786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4760606151744422786'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2009/01/great-minds.html' title='Great Minds…'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh5.ggpht.com/_E_ZM9Y7o2Ow/SWvTzHdZaZI/AAAAAAAAACg/2lD_Wt-GW3U/s72-c/WallpaperChanger_thumb%5B3%5D.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8775415673310687312</id><published>2008-11-24T23:19:00.002Z</published><updated>2008-11-24T23:22:02.872Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Music'/><category scheme='http://www.blogger.com/atom/ns#' term='Scale'/><category scheme='http://www.blogger.com/atom/ns#' term='Chord'/><category scheme='http://www.blogger.com/atom/ns#' term='XAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Silverlight'/><category scheme='http://www.blogger.com/atom/ns#' term='Piano'/><title type='text'>Creating a Chord Factory in Silverlight 2</title><content type='html'>&lt;p&gt;Years ago I created a Windows Forms application that displayed piano chords and musical scales graphically as a sort of pet project/learning exercise. It was written in VB6.0 (I said it was years ago) and contained an image of a piano keyboard and a musical stave. Selecting a root note, either by clicking a key or using a ComboBox, and picking a chord and/or scale, it would show the notes in the chord and/or scale on the keyboard and on the stave. It is still available for download &lt;a href="http://www.openfeature.co.uk/download/chord.zip"&gt;here&lt;/a&gt; and will install and run under Vista - although as you can see from the image it fails to install the musical font used to display the clef symbols.&lt;/p&gt;&lt;p&gt;&lt;a href="http://lh6.ggpht.com/_E_ZM9Y7o2Ow/SSs2bHt2tHI/AAAAAAAAACU/2LIPqvvS3GM/s1600-h/ChordFactory%5B10%5D.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 5px 10px 0px 0px; BORDER-TOP: 0px; BORDER-RIGHT: 0px" border="0" alt="ChordFactory" align="left" src="http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SSs2bo7KexI/AAAAAAAAACY/1nuUzybxqdY/ChordFactory_thumb%5B8%5D.png?imgmax=800" width="460" height="370" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;&lt;em&gt;The Openfeature Chord Factory main screen. &lt;/em&gt;That should be a &lt;span style="font-family:MusiSync;font-size:180%;"&gt;G &lt;/span&gt;&lt;span style="font-family:Trebuchet MS;"&gt;rather than an &lt;strong&gt;O&lt;/strong&gt;.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#404040;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;As well as showing chords it also harnessed the power of the Windows Multi Media API to play them using the MIDI synthesizer of the PC sound card or to an attached MIDI device. Over time I added further enhancements such as chord-inversions, chord progressions and a help file. I was and still am quite proud of it.&lt;/p&gt;&lt;p&gt;I recently decided to revisit Chord Factory after all these years and have a look at re-implementing it in Silverlight 2 - using XAML to achieve better graphical presentation of the piano keyboard and musical stave and data binding to better store and represent the musical data for the chord shapes and scales. I suspected that the lack of access to the Windows API would make it necessary to find another way of playing the chords, but thought the the Silverlight MediaElement might offer a way around this limitation.&lt;/p&gt;&lt;p&gt;It's not quite finished yet, but I thought it might make the subject of a few posts on how I did it  and I'm starting with this one. I have done quite a bit on it so far and the work-in-progress is already up on the web at my Openfeature web site &lt;a href="http://www.openfeature.co.uk/Silverlight/SilverlightChordFactory.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;More to come...&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8775415673310687312?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8775415673310687312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8775415673310687312' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8775415673310687312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8775415673310687312'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2008/11/creating-chord-factory-in-silverlight-2.html' title='Creating a Chord Factory in Silverlight 2'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh4.ggpht.com/_E_ZM9Y7o2Ow/SSs2bo7KexI/AAAAAAAAACY/1nuUzybxqdY/s72-c/ChordFactory_thumb%5B8%5D.png?imgmax=800' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-3027450357368679983</id><published>2008-11-24T16:51:00.004Z</published><updated>2008-11-24T17:10:14.950Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='IDE'/><category scheme='http://www.blogger.com/atom/ns#' term='designer'/><category scheme='http://www.blogger.com/atom/ns#' term='WinForms'/><category scheme='http://www.blogger.com/atom/ns#' term='Windows'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='attributes'/><category scheme='http://www.blogger.com/atom/ns#' term='property browser'/><title type='text'>20 Tips for Producing Releasable Controls</title><content type='html'>&lt;p&gt;I thought I would publish the slides from the presentation I put together for last year's Developer Day, on producing releasable controls. It covered attributing and enhancing custom and user controls in order to get them to a level good enough for public or commercial release.&lt;/p&gt;  &lt;p&gt;The slide deck is &lt;a href="http://www.openfeature.co.uk/download/slidedecks/TwentyTips.zip"&gt;here&lt;/a&gt;, but I thought I might also elaborate a bit with a write-up of the hand-written notes I had for presenting.&lt;/p&gt;  &lt;p&gt;The idea was to show how to bridge the gap between functional controls for WinForms, Web, WPF etc., that might be good enough for internal project use, and releasable ones that better support deployment and use in the Visual Studio toolbox with all the design-time support that makes a control easier and nicer to use. Simple attributes, extensions and practices that enhance a control to make it look and behave better when used by other developers. &lt;/p&gt;&lt;p&gt;The 20 tips are:&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;1.&lt;/strong&gt; &lt;/span&gt;The &lt;span style="color:#0080c0;"&gt;Description&lt;/span&gt; Attribute, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;2.&lt;/span&gt;&lt;/strong&gt; The &lt;span style="color:#0080c0;"&gt;Category&lt;/span&gt; Attribute, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;3.&lt;/span&gt;&lt;/strong&gt; The &lt;span style="color:#0080c0;"&gt;Browsable&lt;/span&gt; Attribute &lt;/em&gt;- Use these simple attributes to decorate a control's properties to affect how (and whether) they appear in the property browser of Visual Studio.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;4.&lt;/span&gt; &lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;ToolboxBitmap&lt;/span&gt; Attribute &lt;/em&gt;- Add a 16x16 bitmap to your project and reference it using this attribute to avoid the default cog toolbox image.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;5. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;DefaultValue&lt;/span&gt; Attribute, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;6. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;ResetXxxx&lt;/span&gt; Method, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;7. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;ShouldSerializeXxxx&lt;/span&gt; Method&lt;/em&gt; - This is how you enable the Reset option in the context menu for a property in the property browser and govern how that property's state is serialized into the designer code for a control. If you want to provide the ability to reset a property, then you need a default to reset it to and if you have a default property, what is the point in serializing the value of that property for a control instance in a form or page, if the property's value is the same as the default. The DefaultValue attribute allows you to set a default (which must be a literal value) and the two methods allow you to get around the need for the default to be a literal value which is often the case where a property's type is an enumeration or a stored value (often resource strings localisation resources). Having implemented these methods, the designer will magically call them when providing the reset functionality for the property browser and when serializing the state of the control.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;8. &lt;/span&gt;&lt;/strong&gt;Extend the &lt;span style="color:#0080c0;"&gt;DefaultValue&lt;/span&gt; Attribute&lt;/em&gt; - This is a refinement of the above approach to getting around the literal restriction on using DefaultValue. Here you roll your own version of the attribute that can take arguments to allow resource retrieval for the default value rather than a literal.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;9. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;DefaultProperty&lt;/span&gt; Attribute, &lt;strong&gt;&lt;span style="color:#ff0000;"&gt;10. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;DefaultEvent&lt;/span&gt; Attribute&lt;/em&gt; - Determine which property is scrolled to and highlighted by default in the property browser and which event stub is generated when the control is double-clicked in the designer.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;11. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;ToolboxItemFilter&lt;/span&gt; Attribute&lt;/em&gt; - Used to restrict visibility of a control to particular designers in Visual Studio - if you use the Require value of the ToolboxItemFilterType enumeration then the control will only appear in the toolbox when that designer is open.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;12. &lt;/span&gt;&lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;Bindable&lt;/span&gt; Attribute, &lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;13. &lt;/span&gt;&lt;/strong&gt;Implement &lt;/em&gt;&lt;span style="color:#0080c0;"&gt;&lt;em&gt;INotifyPropertyChanged&lt;/em&gt;&lt;/span&gt;&lt;/em&gt; - These help the IDE with hints for the property browser when displaying bindable properties - marking a property as bindable means that you have undertaken to have implemented property change notification for it and ensures that it is included in the list of default binding properties at the top of the property browser.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;14. &lt;/span&gt;&lt;/strong&gt;The setter value comparison pattern&lt;/em&gt; - This simple pattern helps avoid unnecessarily exercising setter code and erroneously firing property changed events, by checking that the new value is actually different to the old value.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;15.&lt;/span&gt; &lt;/strong&gt;The &lt;span style="color:#0080c0;"&gt;RefreshProperties&lt;/span&gt; Attribute &lt;/em&gt;- If a change in one of your properties has an effect on the display of others in the property browser or the control's appearance on the design surface then you can use this attribute to signal to the IDE that the property browser should re-query all the property values of the control and/or repaint the control in the designer.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;16.&lt;/span&gt; &lt;/strong&gt;Use Sandcastle&lt;/em&gt; - Microsoft now makes available the toolset it uses for generating the MSDN reference and help files from XML documentation comments in code. You can use Sandcastle to produce professional docs from your control's XML comments (which of course you should be providing for the sake of intellisense support and the IDE Object Browser).&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;17. &lt;/span&gt;&lt;/strong&gt;Setup/Toolbox registration&lt;/em&gt; - This has perennially been an area of pain and confusion in the past and continues to be to this day. The links here point to sources of help, but the whole subject is inevitably bound up in permissions and issues with target machines and their configuration.&lt;/p&gt;  &lt;p&gt;&lt;span style="color:#0080c0;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;18. &lt;/span&gt;&lt;/strong&gt;TypeConverter&lt;/em&gt;&lt;span style="color:#000000;"&gt;&lt;em&gt; &lt;/em&gt;- Where your properties are not simple CLR types and the IDE does not know how to present and manage their values in the property browser you can supply one of the standard set of TypeConverters or indeed your own custom TypeConverter to help. In this example the property is a class instance with its own properties and using the ExpandableObjectConverter allows the IDE to know that it can 'drill-down' into the property to expose the property's own properties as an expanded list. TypeConverters specify to the IDE how to convert from a type to a string and back again so that the IDE knows how to serialise and present property values in the property browser window.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;span style="color:#0080c0;"&gt;&lt;em&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;19. &lt;/span&gt;&lt;/strong&gt;TypeEditor&lt;/em&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt; - Where a property is not easily entered as a string from the property browser a TypeEditor can be used to provide a UI for setting the property. The IDE already has TypeEditors for types such as Color where it will drop down a selector dialog with tabs for system, web and custom colour selection. You can write your own TypeEditors for custom display and editing of your properties and use the TypeEditor attribute to indicate to the IDE that the property has a special editor to display for setting its value.&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;20. &lt;/em&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:#0080ff;"&gt;&lt;em&gt;Smart Tags&lt;/em&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt; - Common tasks for a control sited on the designer surface can be accessed via a little right-arrow icon if you supply a list of tasks using the smart tags support available in the Visual Studio IDE. The two books I name-check there &lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;a href="http://www.amazon.co.uk/NET-Windows-Forms-Custom-Controls/dp/1590594398/ref=sr_1_3?ie=UTF8&amp;amp;s=books&amp;amp;qid=1227545331&amp;amp;sr=1-3"&gt;Pro .NET 2.0 Windows Forms and Custom Controls by Matthew MacDonald&lt;/a&gt; &lt;/em&gt;and &lt;strong&gt;&lt;/strong&gt;&lt;em&gt;&lt;a href="http://www.amazon.co.uk/Windows-Forms-Programming-Chris-Sells/dp/0321267966/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1227545444&amp;amp;sr=1-1"&gt;Windows Forms 2.0 Programming by Chris Sells and Michael Weinhardt&lt;/a&gt;&lt;/em&gt; contain good walkthroughs of how to set these up and provide the UI for them.&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-3027450357368679983?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/3027450357368679983/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=3027450357368679983' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3027450357368679983'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/3027450357368679983'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2008/11/20-tips-for-producing-releasable.html' title='20 Tips for Producing Releasable Controls'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-2493265936796121071</id><published>2008-09-04T12:09:00.001+01:00</published><updated>2008-09-04T12:09:17.584+01:00</updated><title type='text'>Organising Silverlight XAML Resources</title><content type='html'>&lt;p&gt;I recently had to work through a large number of XAML files and rationalise the use of styles in a medium-size Silverlight application. &lt;/p&gt;  &lt;p&gt;The original files had been produced with Expression Blend, and although some effort had been put into reusing common features such as fonts and colours, the resulting XAML was a mixture of named styles used as static resources and inline setting of properties. There was also repetition of styles across files within the project both in name and in content.&lt;/p&gt;  &lt;p&gt;Styles with the same key within a resource hierarchy will override each other with the definition nearest the element winning out and it is easy, unintentionally, to quickly accumulate styles with the same contents but different keys unless you're careful.&lt;/p&gt;  &lt;p&gt;An obvious inclination in this sort of situation is to centralise everything and to eliminate all duplication in order to tidy up things up. Styles and other resources used in more than one page or control can be placed in the App.xaml file of an application and accessed as static resources from XAML across the project. In this way if a change is required to the house style, like changing to a new standard font or colour-scheme, a single change in the central resources and a recompile is all that is required for the changes to apply throughout the entire project. And don't forget that one resource can make use of another; so, for example, a font name can be declared as a named resource and all other style resources can reference it as a static resource:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Sys&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;String &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;HouseFont&amp;quot;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;  Verdana&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Sys&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;String&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Sys&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;String &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BigTextSize&amp;quot;&amp;gt;&lt;br /&gt;  &lt;/span&gt;&lt;span style="color: #a31515"&gt;56&lt;br /&gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Sys&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;String&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;BigButtonStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Button&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontFamily&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;HouseFont&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontSize&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;BigTextSize&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;...&lt;/span&gt;&lt;span style="color: blue"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Button &lt;/span&gt;&lt;span style="color: red"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;BigButtonStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;On the whole this works fine, and the really nice thing is that the resource management features in Expression Blend make using and maintaining the resources easy. When creating new styles in the designer you can opt to store them centrally and when editing styles or templates it is easy to apply previously saved resources and avoid adding ad hoc styling.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://lh4.ggpht.com/JoanMiro154/SL_B2mBKT7I/AAAAAAAAABw/x_f4SHAyaso/s1600-h/BlendResources8.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" border="0" alt="BlendResources" src="http://lh3.ggpht.com/JoanMiro154/SL_B3BDL7NI/AAAAAAAAAB0/D_2MDYXUlW4/BlendResources_thumb6.jpg?imgmax=800" width="417" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;At the same time, however, it is important to bear in mind the intentions of the designer of the application's visuals - my first, over-rigorous attempts at eliminating duplication of styles where the property values were all the same led to some problems because I didn't realise that two styles with exactly the same contents could still be two &lt;strong&gt;&lt;em&gt;different&lt;/em&gt;&lt;/strong&gt; styles. Take this example, where two styles contain the same setters and values:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ProductDescriptionTextBlockStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TextBlock&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontFamily&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;HouseFont&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontSize&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;MediumTextSize&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;span style="color: blue"&gt;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;BrightTextColour&lt;/span&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TextWrapping&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;NoWrap&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;        &lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style &lt;/span&gt;&lt;span style="color: red"&gt;x&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;Key&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;ThumbnailSubTitleTextBlockStyle&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;TargetType&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TextBlock&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontFamily&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;HouseFont&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;FontSize&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;MediumTextSize&lt;/span&gt;&lt;span style="color: blue"&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Foreground&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;&lt;span style="color: blue"&gt;{&lt;/span&gt;&lt;span style="color: #a31515"&gt;StaticResource &lt;/span&gt;&lt;span style="color: red"&gt;BrightTextColour&lt;/span&gt;}&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Setter &lt;/span&gt;&lt;span style="color: red"&gt;Property&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;TextWrapping&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;Value&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;NoWrap&amp;quot; /&amp;gt;&lt;br /&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Style&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;I first assumed these were obvious candidates for merging and renaming to a single style for use on product descriptions and thumbnail subtitles, but &lt;em&gt;logically&lt;/em&gt; they are different, and to replace these two styles with a single generally named one locks the style of two conceptual &lt;em&gt;different&lt;/em&gt; areas of the look and feel together artificially and arbitrarily - what if the designer of the UI later decides that thumbnail subtitles should be italicised? Would she expect all product descriptions to appear in italics? Rather obviously not. Clearly if a style is needed in more than one place because common aspects of visual design appear through the pages of an application then it makes sense to store it centrally in the application's resources and reference it everywhere it is needed, but elements that &lt;em&gt;happen&lt;/em&gt; to have the same set of style properties but are not related to each other might have their styles stored centrally but they shouldn't have their styles merged arbitrarily.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;So whilst it is important to rationalise repetition of genuinely duplicate style definitions&lt;font color="#000000"&gt;&lt;/font&gt;, it is also important to realise that coincidence of content is not always equality of identity.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;Another lesson I learnt was that over-centralisation could become cumbersome; I began by collecting styles in a grand sweep through the application and depositing them all in the App.xaml file on the general principle that styles stored &lt;em&gt;centrally &lt;/em&gt;are available &lt;em&gt;everywhere&lt;/em&gt; throughout the application if required. But what if they aren't required &lt;em&gt;everywhere&lt;/em&gt;? What if styles are only of relevance to a particular page? As I progressed in my task I realised that general styles with names such as 'TitleTextBlock' occurred in several places with different setter content - moving them to a central location meant the need to rename them with prefixes to differentiate them and keep the compiler from objecting. &lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;Under these circumstances it proved important to establish whether they needed to be held centrally at all - if they were only used in a particular page then it seemed better to leave them there and obviate the need for a prefix. On the other hand if they were used in several places and yet still had a conflicting name then a prefix seemed appropriate but adding a prefix based on the page where it was originally found before moving it into App.xaml led to confusing results - why was a style called 'BuyIt_TitleTextBlock' being used in the PrintDetails page? In these circumstances it was important to establish if the style was truly serving the the same purpose in all the locations it was being used and if so to give it a more accurate name that described its purpose rather than where it originated - in this case I settled on 'SummaryTitleTextBlock'.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;font color="#000000"&gt;Finally a word about the suffixes on style keys: as the names used in the style keys grew to include distinguishing qualifiers, their lengths became a bit unwieldy - 'ThumbnailSummaryTitleHyperlinkButtonStyle' for example, at 41 characters, is a getting bit long; and more importantly unnecessarily long - what actual useful information is conveyed by the inclusion of the 'HyperlinkButton' type when that is clear from the TargetType attribute in the declaration of the style? Similarly, the inclusion of the word 'Style' itself adds nothing that we don't already know - the fact is that either where the style is declared or where it is used, it will be clear to anyone reading the code, what it is and to which element type it applies. The only place where resources are seen 'out of context' as it were, is in the Resources view of Expression Blend and here a useful icon indicates the TargetType and the tooltip for each resource gives details of its type. As such it seemed reasonable to shorten resource keys to their descriptive parts with 'ThumbnailSummaryTitleHyperlinkButtonStyle' becoming merely 'ThumbnailSummaryTitle' - until I came up against two 'ThumbnailSummaryTitle' instances - one for a TextBlock and one for a HyperlinkButton in which case the reintroduction of the TargetType suffix was justified to distinguish the two styles.&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&amp;#160;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style="padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; display: inline" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6833e7fb-26d6-4105-b373-806de4e4ba3a" class="wlWriterSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Styles" rel="tag"&gt;Styles&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Resources" rel="tag"&gt;Resources&lt;/a&gt;,&lt;a href="http://technorati.com/tags/XAML" rel="tag"&gt;XAML&lt;/a&gt;&lt;/div&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-2493265936796121071?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/2493265936796121071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=2493265936796121071' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2493265936796121071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2493265936796121071'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2008/09/organising-silverlight-xaml-resources.html' title='Organising Silverlight XAML Resources'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://lh3.ggpht.com/JoanMiro154/SL_B3BDL7NI/AAAAAAAAAB0/D_2MDYXUlW4/s72-c/BlendResources_thumb6.jpg?imgmax=800' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-8413128517761606660</id><published>2008-08-26T22:27:00.001+01:00</published><updated>2008-08-26T22:27:43.294+01:00</updated><title type='text'>Travel By Thought: McCluskey - The Lost Album</title><content type='html'>&lt;p&gt;Looking through the Mini-Discs in my attic the other day I found the only surviving copy of a set of recordings I made over 10 years ago, when I was into writing and recording using computers and MIDI equipment.&lt;/p&gt;  &lt;p&gt;I wrote 18 pieces based on 'themes' from the music of Orchestral Manoeuvres in the Dark and named them after one of the group's two main members - Andy McCluskey.&lt;/p&gt;  &lt;p&gt;Listening to them after all this time, I am quite satisfied with the results - I only had a bedroom to record in, a few pieces of MIDI equipment and an Atari ST, but apart from the odd glitch here and there, the tracks still sound pretty reasonable efforts.&lt;/p&gt;  &lt;p&gt;Anyway, to prevent them being lost for another 10 or more years, I have put them up on my web site for my easy access and for the world to stumble across in the unlikely event that anyone else is interested:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.openfeature.co.uk/cnstrct/sound.htm"&gt;http://www.openfeature.co.uk/cnstrct/sound.htm&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-8413128517761606660?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/8413128517761606660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=8413128517761606660' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8413128517761606660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/8413128517761606660'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2008/08/travel-by-thought-mccluskey-lost-album.html' title='Travel By Thought: McCluskey - The Lost Album'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-2120690314076431199</id><published>2007-11-07T21:25:00.000Z</published><updated>2007-11-07T21:37:30.924Z</updated><title type='text'>TechEd 2007 interim swag count</title><content type='html'>Third day of TechEd 2007 and the swag-count is modest:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;T-Shirts:&lt;/strong&gt; 4&lt;br /&gt;&lt;strong&gt;Baseball caps: &lt;/strong&gt;2&lt;br /&gt;&lt;strong&gt;Misc: &lt;/strong&gt;1 Swaggily Fortunes winners plaque, 2 Beer cosies, 1 inflatable microphone (discarded due to slow-puncture)&lt;br /&gt;&lt;br /&gt;The right-honourable &lt;a href="http://www.guysmithferrier.com/"&gt;GSF&lt;/a&gt; and I agree - not a vintage year...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-2120690314076431199?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/2120690314076431199/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=2120690314076431199' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2120690314076431199'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/2120690314076431199'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/11/teched-2007-interim-swag-count.html' title='TechEd 2007 interim swag count'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-6889016201449450639</id><published>2007-11-07T14:26:00.000Z</published><updated>2007-11-07T14:59:49.360Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='collection initializers'/><category scheme='http://www.blogger.com/atom/ns#' term='object initializers'/><category scheme='http://www.blogger.com/atom/ns#' term='TechEd 2007'/><category scheme='http://www.blogger.com/atom/ns#' term='auto properties'/><title type='text'>Auto Properties &amp; Object/Collection initializers - the presenter's friend</title><content type='html'>From being here at TechEd2007, I have noticed one thing, if nothing else (actually I have noticed lots else) is that the presenters bashing out code in live demos love auto properties and the quick initialisation capabilities in C#3.0. It makes the job of getting straight down to the umpteenth&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;   from &lt;/span&gt;a &lt;span style="color:#000099;"&gt;in &lt;/span&gt;b &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;   &lt;span style="color:#000099;"&gt;where &lt;/span&gt;c &lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#000099;"&gt;&lt;span style="color:#000000;"&gt;   &lt;/span&gt;select&lt;/span&gt; d&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;so much easier. A bit like using dynamic SQL, it saves time/errors when cutting code in front of a live audience, and so it has cropped up in loads of sessions.&lt;br /&gt;&lt;br /&gt;Coming from a coding environment where we produce web, win and ajax controls, however, I can't say that auto properties will be figuring much in my production code; for the one reason that they cannot be decorated with attributes. Attributes are essential when surfacing control properties for governing designtime stuff like visibility, serialisation and categorisation as well as runtime stuff like data binding. Even simple private member variables need stuff like this when they are encapsulated as public properties.&lt;br /&gt;&lt;br /&gt;The initializers on the other hand are an excellent labour-saving piece of &lt;span style="color:#000099;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#993300;"&gt;motsDuJour&lt;/span&gt;&lt;span style="color:#000099;"&gt;&amp;gt;&lt;/span&gt;Syntactical Sugar&lt;span style="color:#000099;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#993300;"&gt;motsDuJour&lt;/span&gt;&lt;span style="color:#000099;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;. Given that all that happens when the syntax is compiled is that the longer-winded versions of the constructs are created in IL, they can be seen as akin to the &lt;em&gt;using &lt;/em&gt;block's expansion to a &lt;em&gt;try-finally dispose &lt;/em&gt;construct in the corresponding IL. &lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;Good stuff.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-6889016201449450639?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/6889016201449450639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=6889016201449450639' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6889016201449450639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6889016201449450639'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/11/auto-properties-objectcollection.html' title='Auto Properties &amp; Object/Collection initializers - the presenter&apos;s friend'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-5872715633041102234</id><published>2007-09-20T14:05:00.000+01:00</published><updated>2007-10-12T15:59:06.505+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='punctuation'/><category scheme='http://www.blogger.com/atom/ns#' term='apostrophe'/><title type='text'>Possession or omission with one exception - and that's all</title><content type='html'>Pointless, I know, but I'm going to get this off my chest...&lt;br /&gt;&lt;br /&gt;How is it that so many people cannot get the use of the apostrophe correct? The rules for its use are simple and have only one exception (example of which can be found in this sentence).&lt;br /&gt;&lt;br /&gt;Possession - "Joan's painting (noun)", "England's captain"&lt;br /&gt;Omission - "That's all folks", "Don't get me started", "Joan's painting (verb)"&lt;br /&gt;Exception - "It's a long way to Tipperary", "The rules for its use"&lt;br /&gt;&lt;br /&gt;And that's all - it's not for awkward plurals like abbreviations (&lt;em&gt;DVDs&lt;/em&gt; not &lt;em&gt;DVD's&lt;/em&gt;) or nouns ending in vowels (&lt;em&gt;casinos &lt;/em&gt;not &lt;em&gt;casino's&lt;/em&gt;)&lt;br /&gt;&lt;br /&gt;IT IS SO SIMPLE!&lt;br /&gt;&lt;br /&gt;I feel better for that...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-5872715633041102234?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/5872715633041102234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=5872715633041102234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5872715633041102234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5872715633041102234'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/09/possession-or-omission-with-one.html' title='Possession or omission with one exception - and that&apos;s all'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1349121908051594073</id><published>2007-07-20T08:59:00.000+01:00</published><updated>2007-10-12T15:58:17.640+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='CodePlex'/><category scheme='http://www.blogger.com/atom/ns#' term='AjaxControlToolkit'/><category scheme='http://www.blogger.com/atom/ns#' term='MSCUI'/><category scheme='http://www.blogger.com/atom/ns#' term='NHS'/><title type='text'>MSCUI - The Microsoft Health Common User Interface</title><content type='html'>Last week some of the fruits of the project I have been working on for the last 2 years at Microsoft UK, saw the public light of day as &lt;a href="http://www.mscui.com/"&gt;http://www.mscui.com/&lt;/a&gt; and &lt;a href="http://www.codeplex.com/mscui"&gt;http://www.codeplex.com/mscui&lt;/a&gt; went live.&lt;br /&gt;&lt;br /&gt;Microsoft have been working for some time now with the UK National Health Service to produce UI guidance for healthcare software and to produce a UI control toolkit for web and Windows development that embodies that design guidance.&lt;br /&gt;&lt;br /&gt;Primarily centred around patient safety and standardisation of common interface elements, the guidance and tools are intended for health care ISVs to help them quickly and consistently produce web and Windows applications that conform to UK NHS standards that aid patient safety.&lt;br /&gt;&lt;br /&gt;The stuff we devs have been working on - the web and Windows controls - are intended to enforce rules about formatting of information-display and standardising and validating the input of data to promote patient safety and reduce ambiguity. The web controls make use of AJAX and the Microsoft AjaxControlToolkit and both platforms share common specific data types and code for parsing input and standardisation of displayed information.&lt;br /&gt;&lt;br /&gt;The intention in going public is to give the work and its output wider exposure and to create a community for feedback and input into an ongoing process of developing and extending the design guidance documentation (primarily through the &lt;a href="http://www.mscui.com/"&gt;http://www.mscui.com/&lt;/a&gt; site) and practical support for it in the toolkit and again a community for feedback (through the &lt;a href="http://www.codeplex.com/mscui"&gt;http://www.codeplex.com/mscui&lt;/a&gt; site).&lt;br /&gt;&lt;br /&gt;Anyway, the sites themselves describe and explain it better than I can here, but it is nice to see a public release to some of the stuff we've been doing over the past few months; and hopefully some of the stuff we are doing now, and as we move on, will make it out into the community via the same or a similar route.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1349121908051594073?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1349121908051594073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1349121908051594073' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1349121908051594073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1349121908051594073'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/07/mscui-microsoft-health-common-user.html' title='MSCUI - The Microsoft Health Common User Interface'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1038771497737504617</id><published>2007-07-19T10:47:00.001+01:00</published><updated>2007-07-19T10:49:28.529+01:00</updated><title type='text'>See what I mean?</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_E_ZM9Y7o2Ow/Rp8znuU3n_I/AAAAAAAAAAU/mPM69tXGrU0/s1600-h/Chinooks.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5088842861495427058" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_E_ZM9Y7o2Ow/Rp8znuU3n_I/AAAAAAAAAAU/mPM69tXGrU0/s320/Chinooks.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_E_ZM9Y7o2Ow/Rp8ziuU3n-I/AAAAAAAAAAM/9-ignSRLJok/s1600-h/Merlins.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5088842775596081122" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_E_ZM9Y7o2Ow/Rp8ziuU3n-I/AAAAAAAAAAM/9-ignSRLJok/s320/Merlins.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1038771497737504617?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1038771497737504617/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1038771497737504617' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1038771497737504617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1038771497737504617'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/07/see-what-i-mean.html' title='See what I mean?'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_E_ZM9Y7o2Ow/Rp8znuU3n_I/AAAAAAAAAAU/mPM69tXGrU0/s72-c/Chinooks.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4414203073772395105</id><published>2007-07-19T10:23:00.000+01:00</published><updated>2007-07-19T10:28:06.758+01:00</updated><title type='text'>OH NO! Not the BBC as well!</title><content type='html'>I saw a piece on the BBC 10 o'clock news last about supplying new helicopters to the troop-effort in Afghanistan and couldn't believe my eyes as the graphics for the numbers and types of aircraft contained the loathsome "grocer's apostrophe": Merlin's, Chinook's etc. Good grief! Were all the literate staff at the BBC too busy panicking about cancelling phone-in competitions to proof-read the captions on their flagship news programme?&lt;br /&gt;&lt;br /&gt;Has anybody checked whether there are still ravens at the Tower of London?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4414203073772395105?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4414203073772395105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4414203073772395105' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4414203073772395105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4414203073772395105'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/07/oh-no-not-bbc-as-well.html' title='OH NO! Not the BBC as well!'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-6533967495863930164</id><published>2007-06-28T17:57:00.001+01:00</published><updated>2007-06-28T17:57:01.483+01:00</updated><title type='text'>Technobile link</title><content type='html'>&lt;p&gt;The online version of my Guardian Technology Technobile article is &lt;a href="http://technology.guardian.co.uk/weekly/story/0,,2112678,00.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-6533967495863930164?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/6533967495863930164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=6533967495863930164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6533967495863930164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/6533967495863930164'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/06/technobile-link.html' title='Technobile link'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4989446939607615375</id><published>2007-06-26T10:51:00.001+01:00</published><updated>2007-06-26T10:51:17.430+01:00</updated><title type='text'>K&amp;R Slaves</title><content type='html'>&lt;p&gt;&lt;strong&gt;&lt;font color="#ff0000"&gt;Warning: anyone reading this might want to do so with a mental IMHO tag around the whole thing.&lt;/font&gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Long-suffering friends and colleagues know that I make no secret of disliking the code formatting convention known as &lt;a href="http://en.wikipedia.org/wiki/Indent_style#K.26R_style"&gt;K&amp;amp;R style&lt;/a&gt; (after &lt;a href="http://en.wikipedia.org/wiki/Brian_Kernighan"&gt;Brian Kernighan&lt;/a&gt; &amp;amp; &lt;a href="http://en.wikipedia.org/wiki/Dennis_Ritchie"&gt;Dennis Ritchie&lt;/a&gt; and the code layout style first used in their seminal book &lt;em&gt;&lt;a href="http://en.wikipedia.org/wiki/The_C_Programming_Language_%28book%29"&gt;The C Programming Language&lt;/a&gt;&lt;/em&gt;). However, although I personally believe that this:&lt;/p&gt;&lt;pre class="code"&gt;&lt;font size="2"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; changeTarget(source){&lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (source === Targets.localTarget){&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; target = &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._get_target(source);&lt;br /&gt;        &lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.ops; i++){&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.ops[i].value === target){&lt;br /&gt;                &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._logs.selectedindex = i;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;span style="color: rgb(0,0,255)"&gt;else&lt;/span&gt;{&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.selectedIndex = -1;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.get_mode() === SourceMode.Extended){&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.addCssClass(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._popupElement, &lt;span style="color: rgb(163,21,21)"&gt;"Extended"&lt;/span&gt;);&lt;br /&gt;    }&lt;span style="color: rgb(0,0,255)"&gt;else&lt;/span&gt;{&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.removeCssClass(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._popupElement, &lt;span style="color: rgb(163,21,21)"&gt;"Extended"&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;/font&gt;&lt;br /&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;...is much less readable and understandable than this: &lt;/p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; changeTarget(source)&lt;br /&gt;{&lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (source === Targets.localTarget)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; target = &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._get_target(source);&lt;br /&gt;        &lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt;(i = 0; i &amp;lt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.ops; i++)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.ops[i].value === target)&lt;br /&gt;            {&lt;br /&gt;                &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.selectedindex = i;&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;else&lt;br /&gt;&lt;/span&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._log.selectedIndex = -1;&lt;br /&gt;    }&lt;br /&gt;    &lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.get_mode() === SourceMode.Extended)&lt;br /&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.addCssClass(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._popupElement, &lt;span style="color: rgb(163,21,21)"&gt;"Extended"&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;    &lt;span style="color: rgb(0,0,255)"&gt;else&lt;br /&gt;&lt;/span&gt;    {&lt;br /&gt;        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.removeCssClass(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._popupElement, &lt;span style="color: rgb(163,21,21)"&gt;"Extended"&lt;/span&gt;);&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;...I know that these things are a matter of preference and project/company standards.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;No, what really annoys me are the reasons some people cite for preferring K&amp;amp;R over BSD/Allman code layout and the actual origins of the style itself. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;There seem to be two main reasons people go for it - firstly they think it looks cool; as if making code look complicated and involved imparts some sort of geeky kudos - "look at that heavy-duty code! Must be pretty hairy stuff going on in there, best not to touch it or try to maintain it, best just to marvel at it" - however, as in the above examples, I'd go for clarity and readability any day because code shouldn't be "write-only" and needs to be comprehensible to others to allow for maintainability.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;The second reason seems to be born of a "be like the big boys" motivation - "if its good enough for the giants of software like Kernighan and Ritchie, then who are we to argue?" and "all the code that comes out of the big guys at Microsoft is formatted that way", but hang on - a few issues: &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;The compacted style only emerged as a practicality of only having 80 column x 25 line displays and trying to get as much readable code into each screen or printed page as possible - we don't have that constraint anymore and who prints code listings these days anyway?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Kernighan and Ritchie never mandated or recommended that style - they were quite neutral in the original book about it: &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;"The position of braces is less important, although people hold passionate beliefs. We have chosen one of several popular styles. Pick a style that suits you, then use it consistently."&lt;/em&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Yet somehow the style has become a sort of holy gourd.&lt;/p&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Kernighan and Ritchie's original use of the style was inconsistent, (again because of constraints); the original C language didn't allow for the compacted braces style on functions that took arguments and K&amp;amp;R were quite happy to be pragmatic about things and adopt a BSD/Allman style for these cases&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Microsoft's big boys don't always manage consistency either; whilst they ship the AjaxControlToolkit with lots of K&amp;amp;R style code in the JavaScript, their internal style and code review tools warn against elements of K&amp;amp;R styling when they appear in language files that the tools process (main example C#) and it is possible to fall foul of check-in policies for compliance with these code review tools on readability/maintainability grounds&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Ultimately though, my point is that to go with K&amp;amp;R for reasons of emulation or hero-worship is spurious and slavish, and readability and comprehensibility are much better criteria by which to select a code formatting style and I will "take the Pepsi challenge" any day that BSD/Allman wins on that score - I might just have to wait for a few others to cast off their chains.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4989446939607615375?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4989446939607615375/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4989446939607615375' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4989446939607615375'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4989446939607615375'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/06/k-slaves.html' title='K&amp;amp;R Slaves'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-1609256514638510035</id><published>2007-06-26T08:37:00.001+01:00</published><updated>2007-06-26T08:37:58.639+01:00</updated><title type='text'>The fight continues...</title><content type='html'>&lt;p&gt;The &lt;a href="http://www.guardian.co.uk/"&gt;Guardian&lt;/a&gt; say that they are going to publish a piece I wrote for their &lt;strong&gt;Technobile&lt;/strong&gt; column which is published each Thursday in the &lt;a href="http://technology.guardian.co.uk"&gt;Technology&lt;/a&gt; supplement. The article is an extended version of my rant about big corporations misspelling my surname in correspondence, which I &lt;a href="http://joanmiro.blogspot.com/2006/06/misnominalorthography.html"&gt;previously posted here&lt;/a&gt;. My main motivation in sending it to them is the hope that wider exposure might result in someone identifying the makers of the CRM software that seems to be responsible for propagating the spelling error to so many companies. Then I can write to them and direct my bile more effectively.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-1609256514638510035?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/1609256514638510035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=1609256514638510035' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1609256514638510035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/1609256514638510035'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/06/fight-continues.html' title='The fight continues...'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-5717410923151601389</id><published>2007-05-02T09:07:00.000+01:00</published><updated>2007-05-02T09:22:55.161+01:00</updated><title type='text'>(Active)ActiveSync</title><content type='html'>Update on syncing my Treo 750 PDA phone:&lt;br /&gt;&lt;br /&gt;There is at least additional software on the install CD to enable synching via Bluetooth - yeah right, like the Bluetooth stack is renowned for its rock-solid reliability and compatibility...&lt;br /&gt;&lt;br /&gt;Well I wasn't too hopeful, but after the usual multitude of notifications about this, that and the other Bluetooth device all with individual (uncertified - of course) drivers, I got everything installed; and it all works!&lt;br /&gt;&lt;br /&gt;Now, with only the occasional hiccup/lockup/Task Manager kill off (it is Bluetooth after all), I have a way of syncing and transferring stuff, albeit at modem speeds (well it is Bluetooth after all).&lt;br /&gt;&lt;br /&gt;So although I won't be moving too many large files over to use in Picsel's dinky PDF viewer or ripping any DVDs to its miniSD card, I do at least have a way of getting stuff on and off the thing and a way of backing it up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-5717410923151601389?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/5717410923151601389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=5717410923151601389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5717410923151601389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/5717410923151601389'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/05/activeactivesync.html' title='(Active)ActiveSync'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-7505273230117546994</id><published>2007-04-17T14:51:00.000+01:00</published><updated>2007-04-17T15:11:48.546+01:00</updated><title type='text'>(in)ActiveSync</title><content type='html'>Over the years I have owned one or two PDA-type mobile devices at various times, not really using them as the workhorses of office productivity that they are often portrayed as being, but more out of sporadic curiosity and out of an interest in their programmability.&lt;br /&gt;&lt;br /&gt;Recently I got a Treo 750 as a replacement for my mobile phone and as it also runs Windows Mobile 5.0, I find myself effectively with another PDA. This time there is more of a chance of it becoming a real everyday tool for me as it pretty successfully combines a mobile phone with PDA Pocket PC functionality.&lt;br /&gt;&lt;br /&gt;But, and here finally is my point, over the years ActiveSync has always been a bugbear in terms of reliability and stability of configuration and use - AND IT IS STILL NO BETTER IN ITS LATEST INCARNATION! Connected once, synched, never recognised again except as an USB device error. So now I am stuck trawling the forums looking for help in resolving the issue, un-installing/re-installing (didn't work), upgrading ActiveSync from 4.2 to 4.5 (didn't work), swapping to other USB ports and other machines (you've guessed it - didn't work)...&lt;br /&gt;&lt;br /&gt;...frustrating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-7505273230117546994?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/7505273230117546994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=7505273230117546994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/7505273230117546994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/7505273230117546994'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/04/inactivesync.html' title='(in)ActiveSync'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-4017449087057403325</id><published>2007-04-02T09:02:00.000+01:00</published><updated>2007-04-17T14:48:27.055+01:00</updated><title type='text'>Ah! Good old .net remoting...</title><content type='html'>Looking at some .net remoting code recently reminded me of just how confusing and frustrating using it can be.&lt;br /&gt;&lt;br /&gt;We were trying to diagnose why remoted events hooked up to a remoted object were failing after the standard 5 minutes initial lease time despite the fact that the remoted object had an overridden InitializeLifetimeService method that returned null - the standard way to setup an infinite lease on a remoted object.&lt;br /&gt;&lt;br /&gt;Using debug tracing and explicit lease management with a sponsor class, we could prove that the remoted object was not dying, but nevertheless the events that it was firing seemed to be disconnected after the initial 5 minutes and we were getting a standard remoting infrastructure exception stating that the remote object didn't exist or was disconnected. How could it be that the remote object had an infinite lease but the events it was firing didn't?&lt;br /&gt;&lt;br /&gt;The answer, as always with remoting, lay in understanding the hoops that the remoting infrastructure goes through in supporting cross-domain marshaling of calls, i.e. how it manages to make each side of the remoting relationship behave like it is communicating with a local instance of what is to either side, the remote object.&lt;br /&gt;&lt;br /&gt;The curious thing is that even when a object that is remotable (i.e. derives from MarshalByRefObject) is started by a client that is not itself remotable, if the remoted object calls back to the client (as it must in order to fire an event back), then the remoted object must do so via the remoting infrastructure by communicating with a transparent proxy/real proxy local to itself which then forward the call via remoting back to the client.&lt;br /&gt;&lt;br /&gt;In other words the client and server roles are reversed for this callback and there is effectively a remoted instance at the client to receive the call and it was this that was being created with the default 5 minute initial lease time.&lt;br /&gt;&lt;br /&gt;This of course begs a couple of questions - firstly: what is being created on the client side as the receiver of the events? It can't be the client itself because it already exists, stays alive after the 5 minutes are up and doesn't derive from MarshalByRefObject and so cannot have a leased lifetime anyway. Secondly: how could we avoid whatever it was from dying after its 5 minute lease expired?&lt;br /&gt;&lt;br /&gt;As it turned out the second question was easier to answer than the first, albeit with a somewhat inelegant solution.&lt;br /&gt;&lt;br /&gt;A simple call to set the LifetimeServices.LeaseTime static property to a very large figure (say 1000 days) within the client app's initialization, sets the initial lease time for any MarshalByRefObject subsequently created in its AppDomain (including the dynamically created proxy that was previously timing out at the default lease time of 5 minutes) to what is effectively an infinite lease (unless you want to go 27 years without shutting the client app down!)&lt;br /&gt;&lt;br /&gt;Of course a more elegant solution would be to actually have created our own client side MarshalByRefObject derived class to serve up the events to the client app and then to have overriden the InitializeLifetimeService method to return null as we do on the server side, but that really wasn't necessary as the only remoted functionality on the client end was the servicing of these events and we could safety define a long default lease for all remoted objects created in the AppDomain and achieve the same effect without another layer of indirection and the effort of creating and testing more code.&lt;br /&gt;&lt;br /&gt;As for the answer to the first question...that's more difficult to answer; from debugging, it is clear that there is a TransparentProxy created on the server side which is used to fire events back to the client side, but what it is connected to, through the Remoting framework, down at the client side is difficult to establish (although I must admit I didn't spend too much time trying, after establishing the easy fix solution) - all the client is attached to, is an event that may or may not fire depending on whether it is connected to a valid source or not.&lt;br /&gt;&lt;br /&gt;Perhaps someone more familiar with the Remoting framework knows more about the mechanics that go on under the hood when "doing events" on remotable objects and how non-remotable objects can effectively work as remote servers when the remote objects &lt;em&gt;they&lt;/em&gt; create need to fire events back to them; it would be interesting to know...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-4017449087057403325?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/4017449087057403325/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=4017449087057403325' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4017449087057403325'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/4017449087057403325'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2007/04/ah-good-old-net-remoting.html' title='Ah! Good old .net remoting...'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-116582566975895086</id><published>2006-12-11T07:56:00.000Z</published><updated>2006-12-11T08:27:49.810Z</updated><title type='text'>Retro</title><content type='html'>How weird to be back in the world of WinForms and ASP.NET control development, after so long in the realms of WPF betas and CTPs. Working on Windows and Web controls and components has a familiar and old-fashioned feel - like I know how to do everything that the spec requires, but that the results will be rather plain and rigid in appearance and behaviour.&lt;br /&gt;&lt;br /&gt;Still there are compensations - not feeling that every surface will inevitably end up with a gradient fill; not having animations just because you can; having an infinitely higher level of confidence in the dev tools and the base class libraries which allows you to know that if things are going wrong it's definitely your own fault and not a buggy set of fundamental building blocks.&lt;br /&gt;&lt;br /&gt;But it is also amazing how rusty you can get - leaving a branch of dev technology for a 12-18 month period brings on, for me at least, a Homer Simpson like phenomenon of the newer stuff pushing the old stuff out of the brain to make room; the shelf above my desk is currently groaning under the weight of tech books that I have had to bring to work as reference material.&lt;br /&gt;&lt;br /&gt;And this is before taking into account the newer VS2005/CLR 2.0 stuff that I didn't really get to grips with as it was released - ASP.NET 2.0 is so different from 1.0/1.1 and because of the timing of its release, I never got the chance to enjoy the delights of Master Pages, Personalisation, the Provider model etc., etc. &lt;br /&gt;&lt;br /&gt;The worry of course is that I will use older techniques or approaches to implement features and miss the opportunity to do things better by exploiting newer aspects of the technology - so rather than just using the tech books as reference material, I am carting them back and forth to and from work and trying to read them a bit more sequentially in order to get coverage of more than just the stuff I think of and go look up. So it's 'back to the classroom' so I can push all that WPF/XAML out of my brain again...ho hum.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-116582566975895086?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/116582566975895086/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=116582566975895086' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116582566975895086'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116582566975895086'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/12/retro.html' title='Retro'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-116175944782321429</id><published>2006-10-25T07:50:00.000+01:00</published><updated>2006-10-27T10:35:55.803+01:00</updated><title type='text'>CodeTidy Update</title><content type='html'>Listening in catch-up mode to past &lt;a href="http://www.dotnetrocks.com/"&gt;DotNetRocks&lt;/a&gt; podcast shows as I commute into work in the car (Milton Keynes to TVP takes about 1.5 hours each way each day), I came across a recent episode with Mark Miller of &lt;a href="http://www.devexpress.com"&gt;Developer Express&lt;/a&gt; in which they referred to a DotNetRocks TV episode he did showing off DevExpress's DXCore plugin framework for Visual Studio.&lt;br /&gt;&lt;br /&gt;I didn't even know they did the DNR TV , but it sounded like it might contain something useful on doing tools for the VS IDE, so I took a look at the show and was amazed to watch as they used the DXCore framework to basically build a first-cut of CodeTidy! The DXCore basically contains a whole bunch of classes that wrap the IDE and provide access to code and code windows in a nice, comprehensive and logical way. Mark took less than an hour to put together an add-in that could sort the members of the current class/type in the editor window by visibility (private, public etc.) and type (properties, mem vars etc.) and a bit of sub-sorting of one category within another. &lt;br /&gt;&lt;br /&gt;The design approach he took wasn't quite how I would have done it, but that is not important; what was important was how easy the DXCore framework made it to do things like grab a method and all its attached XML comments and queue up a delete/move operation on it along with all the others to make the sort operation consistent and undoable - all courtesy of calls to DXCore. Incredible.&lt;br /&gt;&lt;br /&gt;So...I have grabbed the sample code that they thoughtfully made available and have gotten hold of a copy of the DXCore install (it is free) and plan to refactor/build on it to make a CodeTidy I can use in daily coding.&lt;br /&gt;&lt;br /&gt;The session also allowed Mark to show off the tools that DevExpress actually charge for - Refactor and CodeRush - which looked pretty impressive too. Refactor does what it says on the tin and CodeRush is like intellisense on steroids with masses of customisable keyboard shortcuts for frequently used actions like newing up class and vars, creating if, while, for/foreach blocks etc. Could be a purchase coming on...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-116175944782321429?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/116175944782321429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=116175944782321429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116175944782321429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116175944782321429'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/10/codetidy-update.html' title='CodeTidy Update'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-116175896951167256</id><published>2006-10-25T07:34:00.000+01:00</published><updated>2006-10-27T10:14:53.453+01:00</updated><title type='text'>Essential WPF - Chris Anderson</title><content type='html'>I have been looking at draft chapters for &lt;a href="http://www.simplegeek.com"&gt;Chris Anderson's&lt;/a&gt; forthcoming WPF book and it looks like it is going to be a great tech reference - lots of under-the-hood stuff and a nice logical progression through the major concepts.&lt;br /&gt;&lt;br /&gt;More XAML-oriented than Charles Petzold's &lt;a href="http://www.charlespetzold.com/wpf/"&gt;Applications = Code + Markup&lt;/a&gt; which I thought was (understandably) very code-behind oriented and procedural. Given that I think the most exciting thing about XAML and WPF is the declarative programming aspect, I think that books that focus on this side make more sense.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Original and Best &lt;/strong&gt;- Chris Sells and Ian Griffiths original &lt;a href="http://www.sellsbrothers.com/writing/avbook/"&gt;Programming WPF&lt;/a&gt; had the approach spot-on and I am really looking forward to their WPF-release update next year.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-116175896951167256?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/116175896951167256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=116175896951167256' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116175896951167256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/116175896951167256'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/10/essential-wpf-chris-anderson.html' title='Essential WPF - Chris Anderson'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-115945352346440902</id><published>2006-09-28T14:56:00.000+01:00</published><updated>2006-09-28T15:25:23.626+01:00</updated><title type='text'>CodeTidy Kickoff</title><content type='html'>Processing the code in a C# code file can be done in a few ways. Visual Studio has an &lt;a href="http://msdn2.microsoft.com/en-us/library/xc52cke4.aspx"&gt;extensibility/automation model&lt;/a&gt; that allows access to projects, solutions, modules, classes, code etc. as object collections; which would seem to be ideal for what I have in mind - not having to parse the stuff oneself.&lt;br /&gt;&lt;br /&gt;However anytime I have looked at this in the past as a possible route for achieving the task of manipulating the raw code in a file I have come up against obstacles - most notably no support for locating and dealing with regions, some comments, namespace import (i.e. &lt;font color="blue"&gt;using&lt;/font&gt;) statements etc.&lt;br /&gt;&lt;br /&gt;If I am to sort/arrange code without mucking up the containment of regions or orphaning comment lines, then I have to know about these parts of the text content of a code file and be able to manipulate them in the same way as the methods, properties etc. that are available as objects in the extensibility/automation model.&lt;br /&gt;&lt;br /&gt;Parsing code files as raw text and recognising these 'contructs' manually seems like re-inventing the wheel and the sort of activity better done by people with more mathematical minds than mine, who thrive on lexical parser theory and and all that grammar/token recognition stuff.&lt;br /&gt;&lt;br /&gt;So, what to do..? It would be nice to use the automation/extensibility model and fill in the gaps with a bit of manual parsing I suppose, but that leads to the need to effectively maintain my own 'meta-model' of the code being analysed that references/synchronises with the VS model but supplements it with information about the association of things like regions. Plus I need to take a fresh look at the VS model as I guess it has moved on and improved since I last looked at it (VS 2003) - though I'm pretty sure it still doesn't provide exposure of things like regions. &lt;br /&gt;&lt;br /&gt;Further thinking required.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-115945352346440902?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/115945352346440902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=115945352346440902' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115945352346440902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115945352346440902'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/09/codetidy-kickoff.html' title='CodeTidy Kickoff'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-115869522157891790</id><published>2006-09-19T20:45:00.000+01:00</published><updated>2006-09-25T07:55:22.170+01:00</updated><title type='text'>Pet Projects</title><content type='html'>I am a big fan of pet projects; by which I mean hobby code that I have developed and continually re-develop in order to learn new and newer versions of developer technology.&lt;br /&gt;&lt;br /&gt;I have done this in the past with a Windows wallpaper changer taskbar app and a piano scale and chord finder utility. These have gone through various VB, Delphi and C# versions. Each time the familiarity with the 'requirements' means that I can use them as a comfortable 'problem-space' in which to try to utilise new features and rework code.&lt;br /&gt;&lt;br /&gt;I am just about to start a new pet project - this time to sort code (initially C#) in code files according to configurable rules. I've always wanted a utility that would allow me to organise/group code in order of construct type (e.g. properties, ENUM, methods etc.) or access (private, protected, public etc.), taking account of regions and respecting comments and areas like namespace containment of imports (using statements) and allowing alphabetic sorting within these groupings.&lt;br /&gt;&lt;br /&gt;Eventually I hope to make this an add-in to Visual Studio that will help me to organise my code in place and at the same time master the dark art of VS automation...so &lt;strong&gt;CodeTidy &lt;/strong&gt;is born.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-115869522157891790?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/115869522157891790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=115869522157891790' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115869522157891790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115869522157891790'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/09/pet-projects.html' title='Pet Projects'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-115157161313445181</id><published>2006-06-29T09:58:00.000+01:00</published><updated>2006-07-19T09:06:31.043+01:00</updated><title type='text'>Misnominalorthography</title><content type='html'>&lt;strong&gt;&amp;ltRant&amp;gt&lt;/strong&gt;&lt;br /&gt;Only those in similar circumstances can appreciate how damn annoying it is when people misspell your name. After years of suffering the frustration of having &lt;em&gt;Mackie&lt;/em&gt; spelled as &lt;em&gt;Mackay&lt;/em&gt; or &lt;em&gt;Mackey&lt;/em&gt; (not to mention &lt;em&gt;Gordan&lt;/em&gt; and &lt;em&gt;Gorden&lt;/em&gt;), things have recently taken a much worse turn.&lt;br /&gt;&lt;br /&gt;Somewhere, some business analyst or software developer has decided that they know best when it comes to the capitalisation of surnames that begin &lt;em&gt;Mack...&lt;/em&gt; and have decreed that the K is to be capitalised. That same someone has managed to get their arbitrary rule incorporated into some of the most common CRM software in use in the UK. As a result, on countless mail-outs from the banks, high street stores, credit card companies and other large organisations, I have become &lt;b&gt;Gordon MacKie&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;Now, even when I point out this misspelling to them, by letter or in person when my details are being taken in a shop for entry into their customer database, the spelling cannot be changed as the software &lt;em&gt;will not allow it&lt;/em&gt;; despite willing employees retyping the entry, as they type the &lt;strong&gt;&lt;em&gt;k&lt;/em&gt;&lt;/strong&gt; it automatically and stubbornly becomes a &lt;strong&gt;&lt;em&gt;K&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Argggggh!! Stop it!!&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Stop dictating to me how to spell my name! I know how to spell my own bloody name!&lt;br /&gt;&lt;br /&gt;Unless I and the Mackenzies, Mackinlays and other &lt;em&gt;Mack&lt;/em&gt;s of the world fight this, then it won't be long before the casual observer will assume that this is the correct rule for the spelling of our surnames. We need to resist this outrageous abuse before it's too late.&lt;br /&gt;&lt;strong&gt;&amp;lt/Rant&amp;gt&lt;/strong&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-115157161313445181?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/115157161313445181/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=115157161313445181' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115157161313445181'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/115157161313445181'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/06/misnominalorthography.html' title='Misnominalorthography'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6938791.post-114409167572245429</id><published>2006-04-03T20:08:00.000+01:00</published><updated>2006-07-19T10:01:17.053+01:00</updated><title type='text'>First post...</title><content type='html'>I don't like blogs generally - in principle they are a great idea, in practice they are often not much more than an electronic version of vanity publishing. Just because you have an opinion doesn't mean that the whole world has to hear it or that your views are any more valid for being blogged. The &lt;em&gt;&lt;strong&gt;Your shout&lt;/strong&gt;&lt;/em&gt; approach only works if you know what you are talking about. All too often I find myself agreeing with Sid Vicious' response when he was asked about 'the man in the street' - track the quote down...Tony Wilson is fond of using it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6938791-114409167572245429?l=joanmiro.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://joanmiro.blogspot.com/feeds/114409167572245429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6938791&amp;postID=114409167572245429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/114409167572245429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6938791/posts/default/114409167572245429'/><link rel='alternate' type='text/html' href='http://joanmiro.blogspot.com/2006/04/first-post.html' title='First post...'/><author><name>Joan Miro (aka Gordon Mackie)</name><uri>http://www.blogger.com/profile/10154076207056707301</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='17' src='http://2.bp.blogspot.com/_E_ZM9Y7o2Ow/Sbj7BuGJmyI/AAAAAAAAACo/zTri_uihRh8/S220/OpenfeatureLizard.jpg'/></author><thr:total>0</thr:total></entry></feed>
