<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C04ARXczcSp7ImA9WhBaEEg.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647</id><updated>2013-05-20T08:12:24.989-04:00</updated><category term="images" /><category term="arm" /><category term="silverlight seo" /><category term="xaml keys" /><category term="textblock" /><category term="transport" /><category term="dynamic modules" /><category term="liskov substitution" /><category term="bugs" /><category term="development" /><category term="expression tree" /><category term="dynamic types" /><category term="winrt" /><category term="source code browser" /><category term="tombstone" /><category term="asus" /><category term="snowflake" /><category term="conversion" /><category term="events" /><category term="OOB" /><category term="rss reader" /><category term="rest services" /><category term="silverlight toolkit" /><category term="nonsecure items" /><category term="module" /><category term="silverlight navigation" /><category term="silverlight download" /><category term="ria services" /><category term="moq" /><category term="image transform" /><category term="powershell" /><category term="web client" /><category term="property change" /><category term="video" /><category term="nosql" /><category term="#msmix11w" /><category term="ideapad" /><category term="codeproject" /><category term="prism" /><category term="locator" /><category term="saga pattern" /><category term="ie 6.0" /><category term="facebook" /><category term="by ref" /><category term="linq" /><category term="windows mobile 7" /><category term="mix 2011" /><category term="lenovo" /><category term="theme" /><category term="observable" /><category term="azure" /><category term="datagridtemplatecolumn" /><category term="embedded resources" /><category term="click event" /><category term="common table expression" /><category term="mvc" /><category term="crud" /><category term="ms-pl" /><category term="build" /><category term="mvvm" /><category term="rx" /><category term="databinding" /><category term="client script" /><category term="unit testing" /><category term="NHibernate" /><category term="asp.net" /><category term="design" /><category term="scrollchanged" /><category term="anti-aliasing" /><category term="copyleft" /><category term="postback. callback. button" /><category term="enumerator" /><category term="windsor" /><category term=".NET tools" /><category term="coffeescript" /><category term="text search" /><category term="silverlight animation" /><category term="subversion" /><category term="yuml" /><category term="ioc" /><category term="fluent interfaces" /><category term="dropdown" /><category term="windows 8 apps" /><category term="reflection" /><category term="model-view-controller" /><category term="list" /><category term="storyboard" /><category term="reportviewer" /><category term="cal" /><category term="serialization" /><category term="paging" /><category term="preloading" /><category term="yoga 13" /><category term="ASP.NET control" /><category term="OODB" /><category term="command" /><category term="model-view-presenter" /><category term="silverlight 5" /><category term="silverlight printing" /><category term="single responsibility" /><category term="datacontext" /><category term="#msmix11s" /><category term="silverlight controls" /><category term="mvp" /><category term="visual studio 2012" /><category term="olympics" /><category term="dynamic xap" /><category term="knockoutjs" /><category term="tortoisesvn" /><category term="MEF" /><category term="nokia" /><category term="frameworks" /><category term="child window" /><category term="value type" /><category term="partinitializer" /><category term="plugin" /><category term="hierarchical data template" /><category term="animation" /><category term="line of business" /><category term="mix" /><category term="dynamic control" /><category term="source control" /><category term="lumia 900" /><category term="host control" /><category term="JSON" /><category term="async" /><category term="cross domain" /><category term="scrollview" /><category term="touch" /><category term="focus" /><category term="data temlate" /><category term="law of demeter" /><category term="silverlight 4" /><category term="feed reader" /><category term="await" /><category term="navigation" /><category term="secondary tiles" /><category term="dry" /><category term="transaction" /><category term="windows service" /><category term="silverlight" /><category term="number" /><category term="di" /><category term="design-time" /><category term="wpf control" /><category term="expression blend" /><category term="modules" /><category term="dispatcher" /><category term="cube" /><category term="solid principle" /><category term="silveright 3" /><category term="delegates" /><category term="old school" /><category term="weakreference" /><category term="constructor injection" /><category term="endomondo" /><category term="observablecollection" /><category term="datagrid" /><category term="jquery" /><category term="idataerrorinfo" /><category term="odata" /><category term="user control" /><category term="silverlight 3" /><category term="iapplicationservice" /><category term="dropdown bug" /><category term="CTE" /><category term="wpf" /><category term="behavior" /><category term="automated testing" /><category term="id" /><category term="exception" /><category term=".net framework 4.5" /><category term="lifetime management" /><category term="caching" /><category term="entity framework" /><category term="typescript" /><category term="sql 2008" /><category term="custom markup extension" /><category term="silverlight services" /><category term="yield" /><category term="dialog" /><category term="xaml" /><category term="path" /><category term="SQL" /><category term="scriptableobject" /><category term="html5" /><category term="encoding" /><category term="Jounce" /><category term="windows rt" /><category term="singleton" /><category term="Windows Workflow Foundation" /><category term="yagni" /><category term="treeview" /><category term="windows phone 7" /><category term="smooth streaming" /><category term="unity framework" /><category term="out of browser" /><category term="plasma" /><category term="nunit" /><category term="validation" /><category term="service host" /><category term="convention" /><category term="ultralight.mvvm" /><category term="c#" /><category term="firefox" /><category term="image reflection" /><category term="interface segregation" /><category term="queries" /><category term="fractal" /><category term="data form" /><category term="pinvoke" /><category term="inotifypropertychanged" /><category term="mocking" /><category term="embedded javascript" /><category term="tiles" /><category term="web service" /><category term="ancestor" /><category term="dynamic data" /><category term=".net" /><category term="event aggregator" /><category term="cag" /><category term="isolated storage" /><category term="vivotab" /><category term="bing maps" /><category term="windows phone" /><category term="value converter" /><category term="xml" /><category term="silverlight myths" /><category term="windows runtime" /><category term="relative source" /><category term="data contract" /><category term="select" /><category term="attribute" /><category term="sharpdevelop" /><category term="silverlight games" /><category term="#msmix11sw" /><category term="ultra light" /><category term="visual tree" /><category term="schema" /><category term="licenses" /><category term="silverlight unit test" /><category term="metro" /><category term="callback" /><category term="icustomtypeprovider" /><category term="webforms" /><category term="deploymentcatalog" /><category term="backbone" /><category term="handler" /><category term="data grid" /><category term="style" /><category term="inversion of control" /><category term="visual studio" /><category term="composite application guidance" /><category term="windows 8" /><category term="ssrs" /><category term="custom" /><category term="ui virtualization" /><category term="live smooth streaming" /><category term="html" /><category term="combobox" /><category term="large data sets" /><category term="quickstart" /><category term="plm" /><category term="task parallel library" /><category term="visual state manager" /><category term="syntax highlighter" /><category term="windows phone 8" /><category term="sterling" /><category term="state management" /><category term="ref keyword" /><category term="media" /><category term="xbox live" /><category term="viewmodel" /><category term="width" /><category term="system.web.ui" /><category term="javascript" /><category term="silverlight 3.0.50106.0" /><category term="asynchronous" /><category term="workflow" /><category term="debugging" /><category term="anonymous method" /><category term="silverlight richtextarea" /><category term="tablet" /><category term="server control" /><category term="windows communication foundation" /><category term="silverlight splash" /><category term="pivot" /><category term="pipes and filters" /><category term="gnu" /><category term="vs 2010" /><category term="windows phone 7 series" /><category term="childwindow" /><category term="regions" /><category term="view model" /><category term="zoom" /><category term="partial members" /><category term="panel" /><category term="iusertype" /><category term="pipeline pattern" /><category term="changed" /><category term="enterprise" /><category term="telerik" /><category term="html 5" /><category term="triggeraction" /><category term="viewbox" /><category term="postbacksettings error" /><category term="Koch" /><category term="database" /><category term="ndepend" /><category term="scrollviewer" /><category term="delegatecommand" /><category term="wcf" /><category term="debug" /><category term="assert" /><category term="coroutine" /><category term="codestock" /><category term="tpl" /><category term="dependency injection" /><category term="key" /><category term="slate" /><category term="assert.true" /><category term="wcf ria" /><category term="Managed Extensibility Framework" /><category term="code first" /><category term="dynamic xaml" /><category term="composite wpf" /><category term="consumer preview" /><category term="magic string" /><category term="unspecified error" /><category term="lambda expression" /><category term="zune" /><category term="ajax" /><category term="updatepanel" /><category term="trigger" /><category term="view engine" /><category term="ui automation" /><category term="inline hyperlink" /><category term="reference type" /><category term="exportprovider" /><category term="isinteger" /><category term="listbox" /><category term="XAP" /><category term="portable library" /><category term="single point of truth" /><category term="textbox" /><category term="windbg" /><category term="gmail autopilot" /><category term="enumerable" /><category term="napkee" /><category term="resource dictionary" /><category term="silverlight test" /><category term="free software" /><category term="performance profiling" /><category term="balsamiq" /><category term="captcha" /><category term="dependency property" /><category term="matrix" /><category term="generics" /><category term="multivalue" /><category term="dictionary" /><category term="resource file" /><category term="https" /><category term="reactive extensions" /><category term="open closed" /><category term="attached property" /><category term="references" /><category term="collections" /><category term="metadata" /><category term="model-view-viewmodel" /><category term="profiling" /><category term="bitmap" /><category term="binding" /><title>C#er : IMage</title><subtitle type="html">Developer and author Jeremy Likness blogs about enterprise and line of business development on Microsoft platforms using technologies like LINQ, Entity Framework, C#, ASP.NET, MVC, Silverlight, XAML, and Windows 8 (Metro and WinRT).</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://csharperimage.jeremylikness.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>307</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/CSharperImage" /><feedburner:info uri="csharperimage" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by/3.0/" /><logo>http://jeremylikness.com/signature.gif</logo><entry gd:etag="W/&quot;C04ARH45fip7ImA9WhBaEEg.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-6936423674395741819</id><published>2013-05-20T08:12:00.001-04:00</published><updated>2013-05-20T08:12:25.026-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-20T08:12:25.026-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><title>Quick Tip: Processing HTML Content in Windows Store Apps</title><content type="html">&lt;p&gt;The &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control allows you to display content from sites in your app using a small window that renders the HTML using the same rendering engine as Internet Explorer. It does have some limitations and most likely if you are providing content in your app, your goal is to augment your app with fresh data rather than try to superimpose a full-blown web application on your own native Windows Store app.&lt;/p&gt; &lt;p&gt;Trying to strip down content can be quite cumbersome once you wade through the myriad RegEx expressions or other utilities available. Here’s a simple trick that will work with most content-oriented sites like blogs and online magazines. It allows you to get a more basic view of the content and present it without all of the bells and whistles you may end up pulling down with regular content. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Step 1: Be Mobile&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;When you are loading content, make the server believe you are mobile. This will often result in a simpler page being presented, often without the heavy script tags or headers, table of contents, and other sections included. Here’s a nice mobile user agent string that will impersonate one of the most popular mobile clients out there, an iPhone:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;const&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; MobileUserAgent = &lt;span style="color: #a31515"&gt;"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"&lt;/span&gt;;
&lt;/pre&gt;
&lt;p&gt;With the mobile header you can override the user agent and request the content. Instead of having the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control load the page directly, use the &lt;font face="Consolas"&gt;HttpClient&lt;/font&gt; and grab the content like this: &lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; handler = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;HttpClientHandler&lt;/span&gt; { AllowAutoRedirect = &lt;span style="color: blue"&gt;true&lt;/span&gt; };
&lt;span style="color: blue"&gt;&lt;br&gt;var&lt;/span&gt; client = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;HttpClient&lt;/span&gt;(handler);
&lt;br&gt;client.DefaultRequestHeaders.Add(&lt;span style="color: #a31515"&gt;"user-agent"&lt;/span&gt;, MobileUserAgent);
&lt;span style="color: blue"&gt;&lt;br&gt;var&lt;/span&gt; response = &lt;span style="color: blue"&gt;await&lt;/span&gt; client.GetAsync(&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(InsertSuperAwesomeUrlHere));
&lt;br&gt;response.EnsureSuccessStatusCode();
&lt;span style="color: blue"&gt;&lt;br&gt;var&lt;/span&gt; html = &lt;span style="color: blue"&gt;await&lt;/span&gt; response.Content.ReadAsStringAsync();
&lt;/pre&gt;
&lt;p&gt;Allowing redirects is important because many pages will auto-detect your mobile client and instead of dynamically serving content will redirect you to a new page for the mobile content. This allows the client to follow the redirect and then pull down the content that is tailored to mobile devices. At this stage you may think you have what you need, but if you pass this to the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control you’ll find there is often script content trying to make updates that will throw exceptions and generally cause the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; to choke. Next you must cleanse the data.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 2: Cleanse the Content &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cleansing the content may be easier than you think. It turns out that you need to have clean HTML to share HTML content with other Windows Store apps. In fact, the sharing mechanism provides a nice &lt;font face="Consolas"&gt;HtmlFormatHelper&lt;/font&gt; class (located in the &lt;font face="Consolas"&gt;Windows.ApplicationModel.DataTransfer&lt;/font&gt; namespace) designed to package your HTML so it is ready for sharing. It also contains a useful &lt;font face="Consolas"&gt;GetStaticFragment&lt;/font&gt; method that will strip out the dynamic code so you have nice, clean content. The trick is to prep the HTML as if you were going to share it, then get the static fragment so you have the raw text you can load.&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;var&lt;/span&gt; fragment = &lt;span style="color: #2b91af"&gt;HtmlFormatHelper&lt;/span&gt;.GetStaticFragment(&lt;span style="color: #2b91af"&gt;HtmlFormatHelper&lt;/span&gt;.CreateHtmlFormat(html));
&lt;/pre&gt;
&lt;p&gt;Now you are ready to show it to the user.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step 3: Show it to the User&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Now that you have clean HTML, you can ask the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control to navigate to the string like this:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;WebViewControl.NavigateToString(fragment);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/pre&gt;
&lt;p&gt;That’s all there is to it, and you should get a nice, clean page of data without dynamic tags.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=HxcS2SRo_8Y:xlcGOP00NG4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=HxcS2SRo_8Y:xlcGOP00NG4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=HxcS2SRo_8Y:xlcGOP00NG4:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/HxcS2SRo_8Y" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/6936423674395741819/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/05/quick-tip-processing-html-content-in.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6936423674395741819?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6936423674395741819?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/HxcS2SRo_8Y/quick-tip-processing-html-content-in.html" title="Quick Tip: Processing HTML Content in Windows Store Apps" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/05/quick-tip-processing-html-content-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUINQXo9eSp7ImA9WhBUGEU.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-5636492155667815300</id><published>2013-05-06T20:45:00.001-04:00</published><updated>2013-05-06T20:46:30.461-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-06T20:46:30.461-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="tiles" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows rt" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><title>A Fluent Approach to Windows Store Tiles</title><content type="html">&lt;p&gt;Windows Store apps have a variety of tricks up their sleeve for engaging the user even when they are not running. Tiles are a perfect example because they provide at-a-glance information to the user from the start screen. Tiles can provide images, text, or a combination of both and support queuing multiple notifications. &lt;/p&gt; &lt;p&gt;Tiles are defined by various pre-built XML templates. The catalog of tiles is available online in the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/Hh761491.aspx" target="_blank"&gt;tile template catalog&lt;/a&gt; and can be enumerated via &lt;font face="Consolas"&gt;TileTemplateType&lt;/font&gt; as defined in the &lt;font face="Consolas"&gt;Windows.UI.Notifications&lt;/font&gt; namespace. The sample apps for Windows 8 from Microsoft include a helper that allows you to create tiles but it requires instantiating specific classes. I wanted to create a more straightforward and fluent method for defining and setting tiles.&lt;/p&gt; &lt;p&gt;It turns out you can get the template for any tile type by calling &lt;font face="Consolas"&gt;GetTemplateContent&lt;/font&gt; on the &lt;font face="Consolas"&gt;TileUpdateManager&lt;/font&gt; class with the &lt;font face="Consolas"&gt;TileTemplateType&lt;/font&gt; you are interested in. Here’s a fast way to get the &lt;font face="Consolas"&gt;XmlDocument&lt;/font&gt;:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.xml = &lt;span style="color: #2b91af"&gt;TileUpdateManager&lt;/span&gt;.GetTemplateContent(templateType);
&lt;/pre&gt;
&lt;p&gt;With the template I can easily inspect how many lines of text and images it is capable of supporting:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.TextLines = &lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"text"&lt;/span&gt;).Count;
&lt;span style="color: blue"&gt;this&lt;/span&gt;.Images = &lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"image"&lt;/span&gt;).Count;&lt;/pre&gt;
&lt;p&gt;Now I can add text and raise an exception if the amount of text the tile can hold is exceeded:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;BaseTile&lt;/span&gt; AddText(&lt;span style="color: blue"&gt;string&lt;/span&gt; text, &lt;span style="color: blue"&gt;uint&lt;/span&gt; id = 0)
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrWhiteSpace(text))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;throw&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ArgumentException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"text"&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (id == 0)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id = &lt;span style="color: blue"&gt;this&lt;/span&gt;.textIndex++;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (id &amp;gt;= &lt;span style="color: blue"&gt;this&lt;/span&gt;.TextLines)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;throw&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ArgumentOutOfRangeException&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"id"&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; elements = &lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"text"&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; node = elements.Item(id);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (node != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; node.AppendChild(&lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.CreateTextNode(text));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;this&lt;/span&gt;;
}&lt;/pre&gt;
&lt;p&gt;Notice that the method returns the class instance itself. This sets the class up to support a fluent interface with multiple commands chained together. The same logic is used to add images. When you allow your app to provide both a wide and traditional square tile, you can update both formats with a single call. Therefore, you should be able to merge the definitions of multiple tiles:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;BaseTile&lt;/span&gt; WithTile(&lt;span style="color: #2b91af"&gt;BaseTile&lt;/span&gt; otherTile)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; otherBinding = &lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.ImportNode(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; otherTile.xml.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"visual"&lt;/span&gt;)[0].LastChild,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;true&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.xml.GetElementsByTagName(&lt;span style="color: #a31515"&gt;"visual"&lt;/span&gt;)[0].AppendChild(otherBinding);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;this&lt;/span&gt;;
}&lt;br&gt;&lt;/pre&gt;
&lt;p&gt;Now we can grab the template for a tile, specify text and images, and combine square and rectangular tiles together. The next step is to actually set the tile for the app:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; Set()
&lt;br&gt;{
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;TileUpdateManager&lt;/span&gt;.CreateTileUpdaterForApplication().Update(
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;TileNotification&lt;/span&gt;(&lt;span style="color: blue"&gt;this&lt;/span&gt;.xml));
&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;I then added an extension method that takes in the type of the tile and returns an instance of my helper class that contains all of the methods described in this post. Putting it all together, the code to set a wide and square tile for an example app I’m building that enumerates all tiles on the system to display the XML looks like this:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: green"&gt;// set some default tiles &lt;/span&gt;
&lt;span style="color: #2b91af"&gt;TileTemplateType&lt;/span&gt;.TileWideText03.GetTile()
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .AddText(&lt;span style="color: #a31515"&gt;"Tile Explorer"&lt;/span&gt;)
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .WithTile(&lt;span style="color: #2b91af"&gt;TileTemplateType&lt;/span&gt;.TileSquareText03.GetTile()
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .AddText(&lt;span style="color: #a31515"&gt;"Tile Explorer"&lt;/span&gt;)
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .AddText(&lt;span style="color: #a31515"&gt;"A WinRT Example"&lt;/span&gt;)
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .AddText(&lt;span style="color: #a31515"&gt;"by Jeremy Likness"&lt;/span&gt;))
&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Set();&lt;/pre&gt;
&lt;p&gt;This certainly makes it easier to update tiles. A complete helper will also include similar methods for badges and notifications of course … that’s all part of the work I’m doing. Full source and examples will be available in my upcoming book and I’ll share more details when I have them.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=xgcBf_m6kpU:QtTQ6P_aQRs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=xgcBf_m6kpU:QtTQ6P_aQRs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=xgcBf_m6kpU:QtTQ6P_aQRs:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/xgcBf_m6kpU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/5636492155667815300/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/05/a-fluent-approach-to-windows-store-tiles.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5636492155667815300?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5636492155667815300?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/xgcBf_m6kpU/a-fluent-approach-to-windows-store-tiles.html" title="A Fluent Approach to Windows Store Tiles" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/05/a-fluent-approach-to-windows-store-tiles.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUBQX06eSp7ImA9WhBWEEU.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-5078130862482450686</id><published>2013-04-04T08:57:00.001-04:00</published><updated>2013-04-04T08:57:30.311-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-04T08:57:30.311-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term=".net framework 4.5" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="design-time" /><category scheme="http://www.blogger.com/atom/ns#" term="xaml" /><category scheme="http://www.blogger.com/atom/ns#" term="design" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><title>Design-time Data for Windows Store Apps with C#</title><content type="html">&lt;p&gt;One of my favorite features of XAML is the ability to provide design-time data. This feature is present in WPF, Silverlight, and of course Windows Store apps. The great thing about design-time data is that the developer can create it programmatically when needed or the designer can generate some through Blend. In this post I will share an example of generating design-time data through code. The example is a project I am working on for my upcoming book, and can be downloaded from the website (still in its very early stages) from &lt;a href="http://winrtexamples.codeplex.com/" target="_blank"&gt;CodePlex&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;In Chapter 5 I am covering the various options for interacting with web services. A company called &lt;a href="http://cdyne.com/" target="_blank"&gt;CDYNE Corporation&lt;/a&gt; provides a nice, free weather service that is useful for demonstrating how to connect to a SOAP service. Yes, I know everything today is about REST but trust me, the SOAP services are still around. I’m just glad that the committee that governs the standard was wise enough to declare it is no longer an acronym. In case you didn’t know, SOAP originally stood for “Simple Object Access Protocol” but there was really nothing simple about it. Fortunately Microsoft saw wisdom in WSDL and was kind enough to provide the ability from Visual Studio 2012 to generate a proxy for you. &lt;/p&gt; &lt;p&gt;The focus of this post is design-time data, not web services, so let’s focus on the problem at hand. The web service I am referring to provides two APIs I’ll be using. One will resolve a zip code to a city and provide a forecast, and the other takes various weather “types” and provides a corresponding URL so that you can show a friendly icon for “sunny” or “cloudy” etc.&lt;/p&gt; &lt;p&gt;The first step I take is to model the result. Although I could use the model generated by the proxy, I find it’s often better to create your own domain model with the pieces you want so you don’t have to take a dependency on the service itself. You can easily map the service model to a domain model. The main service returns a result that provides the city and state (if it was successfully resolved) and a collection of entries that represent the forecast for each day of the upcoming week. &lt;/p&gt; &lt;p&gt;A “forecast” generated by the service looks something like this (taken from the proxy itself):&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;partial&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Forecast&lt;/span&gt; : &lt;span style="color: blue"&gt;object&lt;/span&gt;, System.ComponentModel.&lt;span style="color: #2b91af"&gt;INotifyPropertyChanged&lt;/span&gt; &lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt; System.&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt; dateField;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;short&lt;/span&gt; weatherIDField;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; desciptionField;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;temp&lt;/span&gt; temperaturesField;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;POP&lt;/span&gt; probabilityOfPrecipiationField;&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;I’ll model it a little differently. Some developers will cry out and gnash their teeth when they see me exposing a property to convert the date instead of using a value converter, but I say … cry away. Here is the entry:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;/span&gt;
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt; Day { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; DayText&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;get&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;this&lt;/span&gt;.Day.Date.ToString(&lt;span style="color: #a31515"&gt;"D"&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;int&lt;/span&gt; TypeId { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; Description { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; PrecipitationDay { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; PrecipitationNight { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; TemperatureLow { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; TemperatureHigh { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt; ForecastUri { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;p&gt;And here is the extension method to convert from the service to an instance of my domain entry:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;static&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;/span&gt; AsForecastEntry(&lt;span style="color: blue"&gt;this&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Forecast&lt;/span&gt; forecast)
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day = forecast.Date,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description = forecast.Desciption,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrecipitationDay = forecast.ProbabilityOfPrecipiation.Daytime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrecipitationNight = forecast.ProbabilityOfPrecipiation.Nighttime,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemperatureLow = forecast.Temperatures.MorningLow,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemperatureHigh = forecast.Temperatures.DaytimeHigh,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TypeId = forecast.WeatherID&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };
}&lt;/pre&gt;
&lt;p&gt;That was easy enough – and would have been even easier with a tool like &lt;a href="https://github.com/AutoMapper/AutoMapper" target="_blank"&gt;AutoMapper&lt;/a&gt;. Now we can create a simple user control that displays a single entry. Here is the XAML (keep in mind I get paid mostly for development, not design):&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="color: red"&gt; Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"230"&lt;/span&gt;&lt;span style="color: red"&gt; Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"200"&lt;/span&gt;&lt;span style="color: red"&gt; Background&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"DarkBlue"&lt;/span&gt;&lt;span style="color: red"&gt; CornerRadius&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"20"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;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; d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;DataContext&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Source&lt;/span&gt;&lt;span style="color: blue"&gt;={&lt;/span&gt;&lt;span style="color: #a31515"&gt;d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;DesignInstance&lt;/span&gt;&lt;span style="color: red"&gt; Type&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;data&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: blue"&gt;DesignForecastEntry&lt;/span&gt;&lt;span style="color: blue"&gt;,&lt;/span&gt;&lt;span style="color: red"&gt; IsDesignTimeCreatable&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;True&lt;/span&gt;&lt;span style="color: blue"&gt;}}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10"&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"210"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"40"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"60"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; DayText&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt;TextWrapping&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Wrap"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt;Style&lt;/span&gt;&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; BodyTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Center"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; Width&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"50"&lt;/span&gt;&lt;span style="color: red"&gt; Height&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"50"&lt;/span&gt;&lt;span style="color: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"1"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Source&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;BitmapImage&lt;/span&gt;&lt;span style="color: red"&gt; UriSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; ForecastUri&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Image.Source&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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: blue"&gt;&amp;gt;&lt;br&gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Description&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"2"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Style&lt;/span&gt;&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; CaptionTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Center"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"5"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"3"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Center"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Horizontal"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Low:"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; TemperatureLow&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10 0 0 0"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;" / High:"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; TemperatureHigh&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10 0 0 0"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"4"&lt;/span&gt;&amp;nbsp;&lt;span style="color: red"&gt;Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Horizontal"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; HorizontalAlignment&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Center"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Chance of Precipitation:"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; PrecipitationDay&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10 0 0 0"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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: blue"&gt;&amp;gt;&lt;/span&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: blue"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;Border&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;There is no way I would be clever enough to design that simply by tapping out XAML and I’m far too lazy to put an entry and then run the app and repeat. In fact, I like to build from the bottom up – in other words, I worked on the forecast entry first, then the entire forecast, then the page to request the forecast, so if I didn’t have design-time data it would be impossible for me to preview the app before I wired everything in! If you can eyeball that XAML and tell me what it looks like … wow. More power to you! I, on the other hand, just created a simple class:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;DesignForecastEntry&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;ForecastEntry&lt;/span&gt;
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; DesignForecastEntry()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Day = &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.ForecastUri = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;br&gt;&lt;br&gt;               &lt;span style="color: #a31515"&gt;&lt;a href="http://ws.cdyne.com/WeatherWS/Images/mostlycloudy.gif"&gt;http://ws.cdyne.com/WeatherWS/Images/mostlycloudy.gif&lt;/a&gt;&lt;/span&gt;, &lt;br&gt;&lt;span style="color: #2b91af"&gt;               UriKind&lt;/span&gt;.Absolute);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Description = &lt;span style="color: #a31515"&gt;"Sample day for weather"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.PrecipitationDay = &lt;span style="color: #a31515"&gt;"50"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.PrecipitationNight = &lt;span style="color: #a31515"&gt;"20"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.TemperatureLow = &lt;span style="color: #a31515"&gt;"25"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.TemperatureHigh = &lt;span style="color: #a31515"&gt;"49"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.TypeId = 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;
&lt;p&gt;Now the reference in the XAML makes sense. Specifically, you can specify a &lt;font face="Consolas"&gt;d:DataContext&lt;/font&gt; that is a data context only used at design time. You pass the type and inform the designer that it can be instantiated, and then in design-time you get something beautiful like this:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-AZi-cqkXESg/UV14r7_3O_I/AAAAAAAAA7M/yh5sxG1H9is/s1600-h/weatherentry3.png"&gt;&lt;img title="weatherentry" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="weatherentry" src="http://lh6.ggpht.com/-qv3dR_nJQag/UV14sLpszGI/AAAAAAAAA7U/QlQzbm7Keec/weatherentry_thumb1.png?imgmax=800" width="375" height="381"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The best part? Even with my aesthetically challenged design skills, I can tweak the XAML and see the changes reflected immediately. I’m not complaining about the end result, are you? Now there is the whole forecast that I modeled like this: &lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;WeatherForecast&lt;/span&gt;
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; WeatherForecast()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Forecast = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;/span&gt;&amp;gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; City { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; State { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;string&lt;/span&gt; Result { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;set&lt;/span&gt;; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;/span&gt;&amp;gt; Forecast { &lt;span style="color: blue"&gt;get&lt;/span&gt;; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;p&gt;And the XAML for the whole forecast: &lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&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; d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: red"&gt;DataContext&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Source&lt;/span&gt;&lt;span style="color: blue"&gt;={&lt;/span&gt;&lt;span style="color: #a31515"&gt;d&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;DesignInstance&lt;/span&gt;&lt;span style="color: red"&gt; Type&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;data&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: blue"&gt;DesignForecast&lt;/span&gt;&lt;span style="color: blue"&gt;,&lt;/span&gt;&lt;span style="color: red"&gt; IsDesignTimeCreatable&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;True&lt;/span&gt;&lt;span style="color: blue"&gt;}}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Auto"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;"*"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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; Orientation&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"Horizontal"&lt;/span&gt;&lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; City&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Style&lt;/span&gt;&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; HeaderTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;=&lt;/span&gt;&lt;span style="color: blue"&gt;","&lt;/span&gt;&lt;span style="color: red"&gt; Style&lt;/span&gt;&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; HeaderTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; State&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Style&lt;/span&gt;&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; HeaderTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"20 0 0 0"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &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: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;TextBlock&lt;/span&gt;&lt;span style="color: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"1"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Text&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Result&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Style&lt;/span&gt;&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; PageSubheaderTextStyle&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: red"&gt; Margin&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"10"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView&lt;/span&gt;&lt;span style="color: red"&gt; Grid.Row&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"2"&lt;/span&gt;&lt;span style="color: red"&gt; ItemsSource&lt;/span&gt;&lt;span style="color: blue"&gt;="{&lt;/span&gt;&lt;span style="color: #a31515"&gt;Binding&lt;/span&gt;&lt;span style="color: red"&gt; Forecast&lt;/span&gt;&lt;span style="color: blue"&gt;}&lt;/span&gt;&lt;span style="color: blue"&gt;"&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;local&lt;/span&gt;&lt;span style="color: blue"&gt;:&lt;/span&gt;&lt;span style="color: #a31515"&gt;ForecastEntry&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView.ItemsPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;WrapGrid&lt;/span&gt;&lt;span style="color: red"&gt; MaximumRowsOrColumns&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;/span&gt;&lt;span style="color: blue"&gt;"1"&lt;/span&gt;&lt;span style="color: blue"&gt;/&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&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;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView.ItemsPanel&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;GridView&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br&gt;&lt;/span&gt;&amp;nbsp;&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: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The design-time model for the forecast is kind enough to offer some variety and generate several days of entries.&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;DesignForecast&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;WeatherForecast&lt;/span&gt;
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;readonly&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;[] testUris = &lt;span style="color: blue"&gt;new&lt;/span&gt;[]&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;br&gt;          &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"http://ws.cdyne.com/WeatherWS/Images/mostlycloudy.gif"&lt;/span&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;UriKind&lt;/span&gt;.Absolute),&lt;br&gt;&lt;span style="color: blue"&gt;&lt;font color="#000000"&gt;          &lt;/font&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515"&gt;&lt;a href="http://ws.cdyne.com/WeatherWS/Images/sunny.gif"&gt;http://ws.cdyne.com/WeatherWS/Images/sunny.gif&lt;/a&gt;&lt;/span&gt;,&lt;br&gt;&lt;span style="color: #2b91af"&gt;              UriKind&lt;/span&gt;.Absolute)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; DesignForecast()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.City = &lt;span style="color: #a31515"&gt;"Woodstock"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.State = &lt;span style="color: #a31515"&gt;"GA"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Result = &lt;span style="color: #a31515"&gt;"Design-mode data"&lt;/span&gt;;&lt;br&gt;         &lt;span style="color: blue"&gt;for&lt;/span&gt; (&lt;span style="color: blue"&gt;var&lt;/span&gt; x = 0; x &amp;lt; 7; x++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; offset = 7 - x;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; entry = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ForecastEntry&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day = &lt;span style="color: #2b91af"&gt;DateTime&lt;/span&gt;.Now.AddDays(-1 * offset),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ForecastUri = &lt;span style="color: blue"&gt;this&lt;/span&gt;.testUris[x % 2],&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"Rainy &lt;/span&gt;&lt;span style="color: mediumseagreen"&gt;{0}&lt;/span&gt;&lt;span style="color: #a31515"&gt;"&lt;/span&gt;, x),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrecipitationDay = &lt;span style="color: #a31515"&gt;"50"&lt;/span&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PrecipitationNight = &lt;span style="color: #a31515"&gt;"20"&lt;/span&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemperatureLow = &lt;span style="color: #a31515"&gt;"25"&lt;/span&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TemperatureHigh = &lt;span style="color: #a31515"&gt;"49"&lt;/span&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TypeId = x&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.Forecast.Add(entry);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;
&lt;p&gt;And this is what I see in the designer: &lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-EHzdR3jJje0/UV14spdgXfI/AAAAAAAAA7Y/Vn479BsYFiI/s1600-h/weatherforecast3.png"&gt;&lt;img title="weatherforecast" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="weatherforecast" src="http://lh3.ggpht.com/-3VSrCItB00I/UV14tCX5_bI/AAAAAAAAA7k/SHHU6x1jLOY/weatherforecast_thumb1.png?imgmax=800" width="772" height="379"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;How cool is that? Now I have what I need. The view model exposes a zip code for the user to enter and an instance of the forecast. The view model I instantiate directly but in the constructor detect design mode and set the forecast property to a design version:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (Windows.ApplicationModel.&lt;span style="color: #2b91af"&gt;DesignMode&lt;/span&gt;.DesignModeEnabled)
&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.currentForecast = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;DesignForecast&lt;/span&gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.zipCode = &lt;span style="color: #a31515"&gt;"30189"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;;
}&lt;/pre&gt;(Here’s a tip – I usually set the field values in design mode so the property change notification isn’t fired – when it’s done in the constructor it will be there in time for binding to the design view). 
&lt;p&gt;Now I have the whole app assembled, and even with a “real” instance of the view model in the designer, I’m able to see what the app will look like. &lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-pUW3r-H-L2o/UV14tQHp1WI/AAAAAAAAA7o/Q0DHS1tTt6Q/s1600-h/weatherdesigner4.png"&gt;&lt;img title="weatherdesigner" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="weatherdesigner" src="http://lh3.ggpht.com/-UmmTQosrVck/UV14tlejThI/AAAAAAAAA7w/F_Ln_XH-LI8/weatherdesigner_thumb2.png?imgmax=800" width="778" height="494"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The individual design instances let me compose the UI with design-time data, while the view model can then instantiate a design instance or “go live” and actually call the service to provide a “real” weather forecast. Here’s what the runtime looks like … not too much different from the design-time view! &lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-EbRAnMypBD0/UV14tw64laI/AAAAAAAAA74/UyjFap9D3J8/s1600-h/runtime3.png"&gt;&lt;img title="runtime" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="runtime" src="http://lh4.ggpht.com/-RfQcxVaj-ss/UV14uIqerhI/AAAAAAAAA8A/WsyphKJXqlI/runtime_thumb1.png?imgmax=800" width="794" height="462"&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Thank goodness for XAML and the ability to easily create design-time data for our apps.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=b8_L3GXhIHU:CcLZxGAQVqs:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=b8_L3GXhIHU:CcLZxGAQVqs:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=b8_L3GXhIHU:CcLZxGAQVqs:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/b8_L3GXhIHU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/5078130862482450686/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/04/design-time-data-for-windows-store-apps.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5078130862482450686?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5078130862482450686?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/b8_L3GXhIHU/design-time-data-for-windows-store-apps.html" title="Design-time Data for Windows Store Apps with C#" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-qv3dR_nJQag/UV14sLpszGI/AAAAAAAAA7U/QlQzbm7Keec/s72-c/weatherentry_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/04/design-time-data-for-windows-store-apps.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0cEQXw9cCp7ImA9WhBQEE0.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-1994342953410796465</id><published>2013-03-10T13:46:00.001-04:00</published><updated>2013-03-11T07:23:20.268-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-03-11T07:23:20.268-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="async" /><category scheme="http://www.blogger.com/atom/ns#" term=".net framework 4.5" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><category scheme="http://www.blogger.com/atom/ns#" term="asynchronous" /><category scheme="http://www.blogger.com/atom/ns#" term="winrt" /><title>Asynchronous Commands in Windows Store Apps</title><content type="html">&lt;p&gt;The Model-View-View Model (MVVM) pattern is more popular than ever and is built into the Visual Studio templates for creating Windows Store apps. Developers familiar with Silverlight already encountered the platform shift to using asynchronous operations because it was impossible to generate a WCF client with synchronous methods. The Windows Runtime (WinRT) takes this further by dictating any operation that may potentially take longer than 50ms to complete should be asynchronous. &lt;/p&gt; &lt;p&gt;How does the MVVM pattern handle asynchronous operations, when the command interface &lt;font face="Consolas"&gt;ICommand&lt;/font&gt; only exposes synchronous methods?&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; System.Windows.Input
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;interface&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ICommand&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;event&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt; CanExecuteChanged;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;bool&lt;/span&gt; CanExecute(&lt;span style="color: blue"&gt;object&lt;/span&gt; parameter);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;void&lt;/span&gt; Execute(&lt;span style="color: blue"&gt;object&lt;/span&gt; parameter);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;
&lt;p&gt;Now consider a simple implementation of a command we’ll call an &lt;font face="Consolas"&gt;ActionCommand&lt;/font&gt; because it allows you to specify a delegate to perform and action when it is invoked. It also provides a predicate to condition the command and a public method to notify the command when the conditions for the predicate have changed.&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;namespace&lt;/span&gt; MyApp.Common
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;using&lt;/span&gt; System;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;using&lt;/span&gt; System.Windows.Input;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;class&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ActionCommand&lt;/span&gt; : &lt;span style="color: #2b91af"&gt;ICommand&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;readonly&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt; action;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;readonly&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; condition;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; ActionCommand()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.action = &lt;span style="color: blue"&gt;delegate&lt;/span&gt; { };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.condition = () =&amp;gt; &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; ActionCommand(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt; action)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.action = action;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.condition = () =&amp;gt; &lt;span style="color: blue"&gt;true&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt; ActionCommand(&lt;span style="color: #2b91af"&gt;Action&lt;/span&gt; action, &lt;span style="color: #2b91af"&gt;Func&lt;/span&gt;&amp;lt;&lt;span style="color: blue"&gt;bool&lt;/span&gt;&amp;gt; condition)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.action = action;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.condition = condition;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&lt;br&gt;         &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;event&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;EventHandler&lt;/span&gt; CanExecuteChanged = &lt;span style="color: blue"&gt;delegate&lt;/span&gt; { };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; RaiseExecuteChanged()&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.CanExecuteChanged(&lt;span style="color: blue"&gt;this&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;EventArgs&lt;/span&gt;.Empty);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;bool&lt;/span&gt; CanExecute(&lt;span style="color: blue"&gt;object&lt;/span&gt; parameter)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;this&lt;/span&gt;.condition();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;public&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; Execute(&lt;span style="color: blue"&gt;object&lt;/span&gt; parameter)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.action();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;
&lt;p&gt;As you can see, there is no &lt;font face="Consolas"&gt;Task&lt;/font&gt; in the implementation of &lt;font face="Consolas"&gt;ICommand&lt;/font&gt;, nor any asynchronous code. As you are also aware, WinRT requires asynchronous code when you are performing various operations including a dialog. Here is an example of code that copies text and HTML to the clipboard and then shows a dialog to the end user they must confirm to acknowledge the copy was successful. The method is asynchronous.&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;async&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Task&lt;/span&gt; Copy()
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; package = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;DataPackage&lt;/span&gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; package.SetText(&lt;span style="color: blue"&gt;this&lt;/span&gt;.DataManager.CurrentPage.Text);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; package.SetHtmlFormat(&lt;span style="color: #2b91af"&gt;HtmlFormatHelper&lt;/span&gt;.CreateHtmlFormat&lt;br&gt;        (&lt;span style="color: blue"&gt;this&lt;/span&gt;.DataManager.CurrentPage.Html));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;Clipboard&lt;/span&gt;.SetContent(package);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; dialog = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;MessageDialog&lt;/span&gt;(&lt;br&gt;        &lt;span style="color: #a31515"&gt;"The web page was successfully copied to the clipboard."&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;await&lt;/span&gt; dialog.ShowAsync();
}&lt;/pre&gt;
&lt;p&gt;Now you have to wire it to the command implementation that is not asynchronous. How can you? Fortunately, the magic that is asynchronous code is able to combine forces with lambda expressions to enable you to handle asynchronous code “on the fly.” Here is the code to wire-up the command to call the &lt;font face="Consolas"&gt;Copy&lt;/font&gt; method asynchronously:&lt;/p&gt;&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;this&lt;/span&gt;.CopyCommand = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;ActionCommand&lt;/span&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;async&lt;/span&gt; () =&amp;gt; &lt;span style="color: blue"&gt;await&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;this&lt;/span&gt;.Copy(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; () =&amp;gt; &lt;span style="color: blue"&gt;this&lt;/span&gt;.CopyEnabled);&lt;/pre&gt;
&lt;p&gt;That’s it. The action itself may be implemented as an asynchronous operation simply by invoking the &lt;font face="Consolas"&gt;async&lt;/font&gt; keyword and using the &lt;font face="Consolas"&gt;await&lt;/font&gt; operator. That’s how easy it is! While you should typically declare your interface consistently – for example, declaring them to return a Task when they should be implemented asynchronously – using this technique you can apply an asynchronous operation to the existing contract when needed. This means your commands &lt;em&gt;can&lt;/em&gt; be asynchronous if and when needed, in full compliance with the WinRT guidelines.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=dbPOvibBTFU:piG2wZSJymA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=dbPOvibBTFU:piG2wZSJymA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=dbPOvibBTFU:piG2wZSJymA:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/dbPOvibBTFU" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/1994342953410796465/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/03/asynchronous-commands-in-windows-store.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1994342953410796465?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1994342953410796465?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/dbPOvibBTFU/asynchronous-commands-in-windows-store.html" title="Asynchronous Commands in Windows Store Apps" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>1</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/03/asynchronous-commands-in-windows-store.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAHRH4_eSp7ImA9WhBREEg.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-3227767913722545205</id><published>2013-02-28T08:05:00.001-05:00</published><updated>2013-02-28T08:05:35.041-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-28T08:05:35.041-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term=".net framework 4.5" /><category scheme="http://www.blogger.com/atom/ns#" term="html 5" /><category scheme="http://www.blogger.com/atom/ns#" term="windows rt" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="html5" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="html" /><category scheme="http://www.blogger.com/atom/ns#" term="winrt" /><title>Windows Store Apps, SVG, and HTML Interoperability</title><content type="html">&lt;p&gt;There are several reasons you may wish to show HTML content in your Windows Store app. You may have information that is updated frequently and makes the most sense to consume as HTML data. Your app may aggregate feeds that contain HTML content. In some cases you may be creating a native client that accesses an existing web-based application that you need to interoperate with. Fortunately, the WinRT has a control that addresses these needs: the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control.  &lt;p&gt;It is important to understand what the purpose of the control is and how that may impact how you architect your app. The control itself is not intended to be a complete replacement for a browser. Indeed, Microsoft has made it clear that if you try to get an app approved in the store that tries to solely interact with a web-based app or simply act as a web browser, it will be rejected &lt;a href="http://bit.ly/13EKx7B" target="_blank"&gt;[1-Ten Things You Need to Know about WebView]&lt;/a&gt;. There are several limitations built into the control that prevents many scenarios.  &lt;p&gt;The control uses the Internet Explorer 10 engine. It does not support advanced features in HTML5 including caching, indexed databases, programmatic access to the clipboard, or geo location. It supports the same version of the Document Object Model (DOM) that is used by Windows Store apps written in JavaScript &lt;a href="http://bit.ly/YR9mdN" target="_blank"&gt;[2 - Document Object Model (DOM) (Windows)]&lt;/a&gt;. There is no support for any type of plug-in or ActiveX extension, including Flash, Silverlight, or embedded PDF documents.  &lt;p&gt;There is full support for enhanced protocol handling &lt;a href="http://bit.ly/Yryqva" target="_blank"&gt;[3 - Auto-launching with file and URI associations]&lt;/a&gt;. This provides support for things like custom protocols that allow you to access resources embedded in your app as well as links that will automatically launch the program associated with them. You can generate a web page that, when viewed, not only provides content served from within your app, but also allows the user to open those resources using their preferred app (for example, a resource with a .pdf extension will open with the preferred reader app).  &lt;p&gt;The control is also unique because it cannot be covered by other controls. It completely takes over the pixels defined for its area. Any controls that you attempt to place in front of the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control will be cropped. If you must overlay the page with controls, you can capture the current view using a special &lt;font face="Consolas"&gt;WebViewBrush&lt;/font&gt; and use that brush to render a surface.  &lt;p&gt;The final and perhaps most important feature of the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control is the ability to interoperate with your Windows Store app. Your app can communicate with the web page by invoking JavaScript functions and passing in parameters. The page can also interact with your app by calling a method on an object that WinRT creates in the DOM. This allows you to create some truly interactive experiences between web content and your Windows Store app.  &lt;p&gt;The &lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/WebViewExamplesSource.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;WebViewExamples&lt;/a&gt; project contains several examples of working with HTML and JavaScript. &lt;font face="Consolas"&gt;MainPage.xaml&lt;/font&gt; defines a &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control named &lt;font face="Consolas"&gt;WebViewControl&lt;/font&gt; and a brush named &lt;font face="Consolas"&gt;WebBrush&lt;/font&gt;. When the page is loaded, a handler is registered to the &lt;font face="Consolas"&gt;LoadCompleted&lt;/font&gt; event on the &lt;font face="Consolas"&gt;WebView&lt;/font&gt;. This will fire any time a new resource (whether it is a string literal or a web page) is loaded. It will force the brush to refresh and show a dialog indicating the content that was loaded.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;async&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; WebViewControlLoadCompleted(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;NavigationEventArgs&lt;/span&gt; e)
{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;     WebBrush.Redraw();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; url = e.Uri != &lt;span style="color: blue"&gt;null&lt;/span&gt; ? e.Uri.ToString() : &lt;span style="color: #a31515"&gt;"Text Content"&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; popup = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;MessageDialog&lt;/span&gt;(url, &lt;span style="color: #a31515"&gt;"Content Loaded."&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;await&lt;/span&gt; popup.ShowAsync();&lt;br&gt;&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;The first button triggers a straightforward page load. &lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; ButtonBase_OnClick(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.WebViewControl.Navigate(&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(JeremyBlog));
}&lt;/pre&gt;
&lt;p&gt;The page is my main blog page. You’ll find it loads and renders fine. You can also click on links and navigate just as if you pulled the page up in a web browser. There are no forward or backwards buttons and there is no place to enter a new address so you are stuck following the links provided by the control. Notice that the dialog fires every time you navigate to a new page – you could easily use this feature to inspect where the user ended up and hide the control or reset it if needed. 
&lt;p&gt;The second button invokes a specific page as a mobile client by writing a user agent that mimics an iPhone. My blog will detect that a mobile device is accessing the page and redirect to a mobile-friendly page. In this mode you may see several errors thrown by the debugger. This is because the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control will throw an error any time it encounters a JavaScript error or an issue parsing the DOM. You can turn off the JavaScript errors by going into the debugger settings and un-checking &lt;strong&gt;Script&lt;/strong&gt; under the &lt;strong&gt;Just-In-Time&lt;/strong&gt; tab. Other errors you have to muscle through and just select &lt;strong&gt;No&lt;/strong&gt; – on my machine the mobile page generates four errors I must acknowledge before accessing the page. If you run the app outside of the debugger, it will swallow these errors and run normally. 
&lt;p&gt;The only way to update the user agent that the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control uses is to use some hacks that will prevent your app from making it into the app store. For those hackers in the audience, you’ll need to p/Invoke &lt;font face="Consolas"&gt;urlmon.dll&lt;/font&gt; and call &lt;font face="Consolas"&gt;UrlMkSetSessionOption&lt;/font&gt; with option 0x10000001 and your user agent string prior to navigating with the control. A more direct approach is to download the page yourself and pass it to the control as text. The steps are shown below.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;async&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; ViewMobile_OnClick(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; handler = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;HttpClientHandler&lt;/span&gt; { AllowAutoRedirect = &lt;span style="color: blue"&gt;true&lt;/span&gt; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; client = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;HttpClient&lt;/span&gt;(handler);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; client.DefaultRequestHeaders.Add(&lt;span style="color: #a31515"&gt;"user-agent"&lt;/span&gt;, MobileUserAgent);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; response = &lt;span style="color: blue"&gt;await&lt;/span&gt; client.GetAsync(&lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(JeremyYogaPost));&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;     response.EnsureSuccessStatusCode();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; html = &lt;span style="color: blue"&gt;await&lt;/span&gt; response.Content.ReadAsStringAsync();&lt;br&gt;&lt;span style="color: blue"&gt;     this&lt;/span&gt;.WebViewControl.NavigateToString(html);&lt;br&gt;}&lt;/pre&gt;
&lt;p&gt;The example sets up a client that accepts redirects (in the case of the blog post reference, it will redirect to a mobile version), then creates a client and sets the user agent to mimic a mobile device. The page is requested and the code ensures a successful response was obtained before loading the content of the response and sending it to the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control. 
&lt;p&gt;This technique is common for requesting content in a format that is suitable for viewing within your app (mobile content tends to have less chrome so it is easier to process). You can also parse and analyze the content prior to presenting it to the end user. This allows you to strip unwanted tags or even inject your own JavaScript and content as needed prior to the page being displayed. 
&lt;p&gt;In some apps you may wish to include embedded HTML resources for your apps to display. The third button demonstrates this technique. It also shows that the rendering engine has full support for Scalable Vector Graphics (SVG) &lt;a href="http://bit.ly/XVgLuz"&gt;[4 - W3C SVG Working Group]&lt;/a&gt;, which can be useful if you need to integrate charts or vector-based graphics in your application and have existing implementations using SVG. In the example app, there is an embedded HTML file named &lt;font face="Consolas"&gt;Ellipse.html&lt;/font&gt; in the &lt;font face="Consolas"&gt;Data&lt;/font&gt; folder. 
&lt;p&gt;Referencing this resource is simple and straightforward. The special &lt;font face="Consolas"&gt;ms-appx-web&lt;/font&gt; protocol provides a path to the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control that is embedded in the store app. You’ll notice it uses three forward slashes and then provides a path to the resource in the app from the root.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; ViewSvg_OnClick(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.WebViewControl.Navigate(&lt;span style="color: blue"&gt;new&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;Uri&lt;/span&gt;(&lt;span style="color: #a31515"&gt;"ms-appx-web:///Data/Ellipse.html"&lt;/span&gt;));
}&lt;/pre&gt;
&lt;p&gt;You can also embed static text (or dynamic text that you build and generate prior to passing into the control). The fourth button triggers the load of a string literal. The literal contains the text for an HTML document and includes various header tags, an embedded image (the logo of the app itself), and a hyperlink that demonstrates you can navigate to embedded content or external content. If you follow the link to the external website, you’ll see that the base URL is consistently reported as static text because that’s how the original document was loaded.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; ViewString_OnClick(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.WebViewControl.NavigateToString(HtmlFragment);
}&lt;/pre&gt;
&lt;p&gt;The final button demonstrates how your app can interoperate with the web. To show this, I included a JavaScript function in the template of my blog. The function is just a few lines of code. If you load any page from my blog and view the source, you can search for “supersecret” to locate the function: 
&lt;p&gt;&lt;font face="Consolas"&gt;function superSecretBiographyFunction(subPath) {&lt;br&gt;&amp;nbsp;&amp;nbsp; window.location.href="http://csharperimage.jeremylikness.com/" + subPath;&lt;br&gt;}&lt;/font&gt; 
&lt;p&gt;The function is usually not called, but that will change if you load one of the blog pages using the example app and click the last button. The code snippet below shows the implementation. The &lt;font face="Consolas"&gt;InvokeScript&lt;/font&gt; method is used to call the function. You can pass in null for a function that takes no parameters, otherwise you can pass in an array of values. In this case the path to my biography is passed in, and the page picks it up and navigates to the path. Note that you can call JavaScript on any type of page the control rendered, including embedded resources or literals you’ve passed in.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;async&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; CallJavaScript_OnClick(&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af"&gt;MessageDialog&lt;/span&gt; popup = &lt;span style="color: blue"&gt;null&lt;/span&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;var&lt;/span&gt; parameters = &lt;span style="color: blue"&gt;new&lt;/span&gt;[] &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515"&gt;"p/biography.html"&lt;br&gt;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;try&lt;/span&gt;&amp;nbsp;&lt;br&gt;     {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.WebViewControl&lt;br&gt;                .InvokeScript(&lt;span style="color: #a31515"&gt;"superSecretBiographyFunction"&lt;/span&gt;, parameters);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af"&gt;Exception&lt;/span&gt; ex)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; popup = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;MessageDialog&lt;/span&gt;(ex.Message, &lt;span style="color: #a31515"&gt;"Unable to Call JavaScript."&lt;/span&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;if&lt;/span&gt; (popup != &lt;span style="color: blue"&gt;null&lt;/span&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;await&lt;/span&gt; popup.ShowAsync();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
}&lt;/pre&gt;
&lt;p&gt;An attempt to invoke a function on page that doesn’t have that function will result in an exception. The code captures the very user-unfriendly exception and displays it for you. The pattern is important to note because it is not possible to use the await keyword from within a catch block. The workaround is to capture any necessary information needed in the catch, then await the dialog to display the information once the block is exited. 
&lt;p&gt;Although sending information to a page is nice, wouldn’t it be great if you could receive information back? This scenario is possible and you can in fact create apps that have two-way conversations with web pages. If you searched for the source snippet above, you may have also noticed this block of code: 
&lt;p&gt;&lt;font face="Consolas"&gt;if (document.title==='C#er : IMage: Synchronous to Asynchronous Explained') {&lt;br&gt;if ((typeof (window.external) !== "undefined") &amp;amp;&amp;amp; (typeof (window.external.notify) !== "undefined")) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; window.external.notify(new Date().toLocaleString()); &lt;br&gt;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt; 
&lt;p&gt;I would not normally do a string comparison against a topic title to trigger application logic, but I can get away with it here because I own the blog and am not planning on changing the title. When the user navigates to a specific topic inside a &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control, the web page itself will actually send a message to the Windows Store app that contains the localized date and time. The communication between the web page and the Windows Store app is illustrated here: 
&lt;p&gt;&lt;a href="http://lh4.ggpht.com/-deOx9kntsqQ/US9WHP3IK2I/AAAAAAAAA6s/G3-hfznRLg4/s1600-h/htmlwinstoreinterop3.png"&gt;&lt;img title="htmlwinstoreinterop" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="htmlwinstoreinterop" src="http://lh6.ggpht.com/-4EoFXvo6ZHQ/US9WHuqEmCI/AAAAAAAAA60/hYi5OT_s5NE/htmlwinstoreinterop_thumb1.png?imgmax=800" width="640" height="340"&gt;&lt;/a&gt; 
&lt;p&gt;The function first checks for the existence of the window.external object. This is provided to the JavaScript runtime by Internet Explorer to provide access to the object model of the host &lt;a href="http://bit.ly/13c9v2H" target="_blank"&gt;[5 - External object (Internet Explorer)]&lt;/a&gt; (in this case, the host is the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control). The control in turn exposes the notify method to the runtime. A call to this from the web page with a single string parameter will raise the &lt;font face="Consolas"&gt;ScriptNotify&lt;/font&gt; event on the &lt;font face="Consolas"&gt;WebView&lt;/font&gt; control. 
&lt;p&gt;The example app simple stores the value that is passed to a local variable.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;private&lt;/span&gt;&amp;nbsp;&lt;span style="color: blue"&gt;void&lt;/span&gt; WebViewControlScriptNotify(&lt;span style="color: blue"&gt;object &lt;/span&gt;sender, &lt;br&gt;    Windows.UI.Xaml.Controls.&lt;span style="color: #2b91af"&gt;NotifyEventArgs&lt;/span&gt; e)
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.message = e.Value;
}&lt;/pre&gt;
&lt;p&gt;Once the entire web page is loaded, the &lt;font face="Consolas"&gt;LoadCompleted&lt;/font&gt; event checks for this value and displays it when present.&lt;pre style="font-size: 13px; font-family: consolas; background: white; color: black"&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (&lt;span style="color: blue"&gt;string&lt;/span&gt;.IsNullOrEmpty(&lt;span style="color: blue"&gt;this&lt;/span&gt;.message))
{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;return&lt;/span&gt;;
}
 
popup = &lt;span style="color: blue"&gt;new&lt;/span&gt;&amp;nbsp;&lt;span style="color: #2b91af"&gt;MessageDialog&lt;/span&gt;(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue"&gt;this&lt;/span&gt;.message,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #a31515"&gt;"The Blog Has Spoken!"&lt;/span&gt;);
&lt;span style="color: blue"&gt;this&lt;/span&gt;.message = &lt;span style="color: blue"&gt;string&lt;/span&gt;.Empty;
&lt;span style="color: blue"&gt;await&lt;/span&gt; popup.ShowAsync();&lt;/pre&gt;
&lt;p&gt;To see this in action, use the timeline on the right side of my blog to navigate to the year 2012, the month August, and the title “Synchronous to Asynchronous Explained.” The result should be two pop-ups, one to notify you when the page has loaded and a second that declares the blog has spoken and displays the date. This closes the loop and demonstrates how Windows Store apps can load, display, and interact with HTML-based content. 
&lt;p&gt;This post just scratches the surface of what is possible but hopefully provides you with an in-depth demonstration of how you can embed HTML, SVG, and even JavaScript in your Windows Store apps.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/WebViewExamplesSource.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;Full Source Code&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/WebViewExamples_1.0.0.0_AnyCPU_Debug.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;Side-Load Package&lt;/a&gt;&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=0RAob8TaX7k:iDwjddiC32w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=0RAob8TaX7k:iDwjddiC32w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0RAob8TaX7k:iDwjddiC32w:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/0RAob8TaX7k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/3227767913722545205/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/02/windows-store-apps-svg-and-html.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3227767913722545205?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3227767913722545205?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/0RAob8TaX7k/windows-store-apps-svg-and-html.html" title="Windows Store Apps, SVG, and HTML Interoperability" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-4EoFXvo6ZHQ/US9WHuqEmCI/AAAAAAAAA60/hYi5OT_s5NE/s72-c/htmlwinstoreinterop_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/02/windows-store-apps-svg-and-html.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkUMQ3Y5fyp7ImA9WhBSEUk.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-9174434907372774072</id><published>2013-02-17T18:38:00.001-05:00</published><updated>2013-02-17T18:38:02.827-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-02-17T18:38:02.827-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="yoga 13" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="tablet" /><category scheme="http://www.blogger.com/atom/ns#" term="ideapad" /><category scheme="http://www.blogger.com/atom/ns#" term="lenovo" /><title>Review of the Lenovo IdeaPad Yoga 13 for Development</title><content type="html">&lt;p&gt;After several months of comparing various Windows 8 devices to replace my old 1.5” thick 6-lb. Dell laptop, I finally settled on the &lt;a href="http://www.amazon.com/gp/product/B00ATANTRW/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B00ATANTRW&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Lenovo IdeaPad Yoga 13&lt;/a&gt;. My requirements are fairly straightforward: I want 8GB of RAM and a minimum of 256GB SSD, I have to have a touch display and the resolution needs to be at least HD+ (1600 x 900). I wasn’t as concerned about budget and there was one device that fit the bill perfectly: the &lt;a href="http://www.amazon.com/gp/product/B00AWT1GTS/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B00AWT1GTS&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;ASUS ZenBook Prime Touch&lt;/a&gt;. The only catch was that the 8GB version isn’t yet available in the states. I also didn’t feel like waiting for the &lt;a href="http://www.lenovo.com/products/us/tablet/thinkpad/thinkpad-helix/" target="_blank"&gt;Helix&lt;/a&gt; and other devices. The &lt;a href="http://www.engadget.com/2012/10/23/dell-xps-12-review/" target="_blank"&gt;Dell XPS 12&lt;/a&gt; was a strong contender but I had a hard time committing to such a small (12.5”) display, and the &lt;a href="http://www.amazon.com/gp/product/B00AQ2DS8S/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B00AQ2DS8S&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;ThinkPad X1 Carbon Touch&lt;/a&gt; would have likely been my choice if Lenovo didn’t have supply problems that prevented them from shipping it for 4 – 8 weeks after ordering.&lt;/p&gt; &lt;p&gt;I did want to stick with the maxim of “thin and light” because part of the reason for replacing my perfectly competent Dell is the simple fact it gets old lugging something that thick and heavy around. The only two concerns I had with the Lenovo were the keyboard (the ThinkPad line has the best keyboards out there, but I also know I can purchase a USB external version if I need one) and the display (1600 x 900 is fine, but I really wanted full 1080p at 1920 x 1080). So, after much deliberation, I pulled the trigger and purchased my Lenovo from Amazon after locating a third-party seller who had it in stock (the 8GB models are suddenly very hard to find).&lt;/p&gt; &lt;h2&gt;Un-boxing&lt;/h2&gt; &lt;p&gt;UPS dropped off my box just a few days after I purchased it through Amazon.com. The box is simple and easy to open and gives you immediate access to the components within. It ships with the laptop, a power cable, and some documentation to get started quickly. Obviously there is no “instructional DVD” as there is no DVD included. I was debating whether or not to invest in a portable DVD burner, but I realized I rarely use the one I have unless it’s to install software, and then I can just burn an ISO to my home network and install from that. I passed on it for now. &lt;/p&gt; &lt;p&gt;I don’t do un-boxing videos but it was really mundane – a few slices with my Buck knife and I was in, then plugged in the adapter and booted it. The boot time is under 10 seconds. I spent just a few minutes logging into my Microsoft Account and specifying my WiFi options and I was logged in with most of my content synchronized. All of my Windows 8 roaming settings carried over and most of my writing is synchronized through SkyDrive. The installs for Office, SQL, and Visual Studio with a few extensions all took only an hour or two. It took a little longer to copy some resources over my local network but it wasn’t long before I was transitioned over to the new laptop. &lt;/p&gt; &lt;p&gt;Here’s a quick snap of the laptop sitting on the tray on my Delta flight:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-NaZVl1iyu5M/USFpvgeRaoI/AAAAAAAAA48/Eue0EUSFd_w/s1600-h/airplane5.jpg"&gt;&lt;img title="airplane" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="airplane" src="http://lh6.ggpht.com/-rLx5hChMgyQ/USFpwRtvKgI/AAAAAAAAA5E/oxYrT0_Hwwc/airplane_thumb3.jpg?imgmax=800" width="647" height="500"&gt;&lt;/a&gt; &lt;/p&gt; &lt;h2&gt;Look and feel&lt;/h2&gt; &lt;p&gt;The laptop itself is very simple. It has a solid build and feel. It’s not designed with a sleek taper like the MacBook, Samsung, or even ASUS models, but this is a 13.3” ultrabook and that means light (3.34 lbs – heavier than other tablets but half the weight of my Dell) and thin (17mm, again about half the thickness of my Dell). The outside is a nice monochrome silver metal (top and bottom – apparently bold users can get an orange one too) while the inside sports a black keyboard and frame around the screen. The inside looks almost like leather but is texture plastic. The touchpad is glass.&lt;/p&gt; &lt;p&gt;Here’s the laptop closed:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-DIBsq-1Zm-Y/USFpxHCtUWI/AAAAAAAAA5M/xebXzRnIF8c/s1600-h/WP_000381%25255B3%25255D.jpg"&gt;&lt;img title="WP_000381" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="WP_000381" src="http://lh4.ggpht.com/-2-myk9EmZfA/USFpx0irxOI/AAAAAAAAA5U/e0k7iMMLwDg/WP_000381_thumb%25255B1%25255D.jpg?imgmax=800" width="662" height="504"&gt;&lt;/a&gt; &lt;/p&gt; &lt;h2&gt;Specs&lt;/h2&gt; &lt;p&gt;The system I ordered sports an Intel Core &lt;a href="http://ark.intel.com/products/72054/Intel-Core-i7-3537U-Processor-4M-Cache-up-to-3_10-GHz?q=i7-3537U" target="_blank"&gt;i7-3537U&lt;/a&gt; (U for Ultralow voltage) processor w/ 2.00 GHz that over-clocks up to 3.1 GHz. It is dual core with hyper-threading allowing for 4 virtual cores. The installed memory is 8.0GB and I’m happy to say after quite a bit of usage this laptop isn’t memory hungry even when running a full developer edition of SQL Server 2012 and building/running an MVC 4 enterprise application using Entity Framework that is composed of over 20 different projects. It compiles the project roughly 33% faster than my Dell that had the same specs, which I’m assuming I can attribute to the included Samsung SSD. From the specs I’ve read it’s midrange speed (over 200 MB both read and write, whereas some models like the Dell XPS 12 almost double the read rate). The Windows Experience Index rates it solid in almost everything but desktop graphics, but that’s the trade-off with the ubiquitous Intel HD 4000 chip – you’re getting it for business, not heavy 3D gaming.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-M3-TC-gd28w/USFpyOLAc7I/AAAAAAAAA5c/nHxcb7rVKcc/s1600-h/Screenshot83.png"&gt;&lt;img title="Screenshot (8)" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Screenshot (8)" src="http://lh4.ggpht.com/-MMX8_sYV4xo/USFpykXIBTI/AAAAAAAAA5k/YzSVIYnUo30/Screenshot8_thumb1.png?imgmax=800" width="658" height="179"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;Included are Bluetooth 4.0 that works quite well (more on that later), Sensors include ambient light, orientation and compass. Orientation sensors are there as I’ve verified with several programs and I don’t believe there is GPS although the location services do quite well using the network to locate your position. There is no Near Field Communication (NFC) unfortunately.&lt;/p&gt; &lt;h2&gt;Ports&lt;/h2&gt; &lt;p&gt;Starting at the back of the device and going clockwise, we have some vents, square proprietary power adapter, USB 2.0, mini-card reader and orientation lock. The front includes the battery indicator, power button, and Lenovo one-touch restore. Finally we have volume rockers, headphone and microphone jack (single jack), USB 3.0 and full HDMI. &lt;/p&gt; &lt;h2&gt;Keyboard&lt;/h2&gt; &lt;p&gt;One reason I was reluctant to invest in the Yoga was my fear that the smaller keyboard would require me to invest in an external keyboard. I have been using an external one for some time but have been hoping to consolidate and just use the included laptop. The biggest complaints I’ve read are that the laptop feels cramped and there are issues with the location and size of the right shift key. &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/--mPuxdvKqf8/USFpzDUXXiI/AAAAAAAAA5s/DCz4EuXvIn8/s1600-h/keyboard3.jpg"&gt;&lt;img title="keyboard" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="keyboard" src="http://lh6.ggpht.com/-cBAfF7vFeI8/USFpzuGKdWI/AAAAAAAAA50/d8AqEAXIAUw/keyboard_thumb1.jpg?imgmax=800" width="608" height="463"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;After working on this laptop full time for several days, both developing code and working on my next book, I can say that my opinion is that this keyboard is phenomenal. Maybe I’m biased because I’m used to the really small ASUS VivoTab RT keyboard and this is much larger, but it truly has been a pleasure using the keyboard. I’m able to easily find the keys, they have perfect travel and feedback and a nice, soft touch (and yes, I do use the right shift key). It is much quieter than my external keyboard. While the locations of the Home, End, etc. keys are slightly different than what I’m used to, I quickly adapted to them and haven’t found it to be a problem. I took a typing test online that lasted one minute and was able to type 109 Word Per Minute at 100% accuracy, so no complaints here – I doubt I’ll be investing in an external keyboard.&lt;/p&gt; &lt;p&gt;The only complaint I have is the trend that seems to be common in newer ultrabooks and that’s making the function keys default to laptop functions instead of, well, function keys. The default mode is for the keys to do things like adjust volume, switch to airplane mode and change the brightness of the display. As a developer I’m constantly using function keys from within Visual Studio and it can be jarring to hit F10 to step through code and have the external monitor fly-out appear instead. I’m assuming there is some way to swap the default but I haven’t looked into it yet and I seem to be getting “trained” on holding down the FN key to make them work as expected. &lt;/p&gt; &lt;h2&gt;Touchpad&lt;/h2&gt; &lt;p&gt;I’ve seen a lot of negative touchpad reviews in general so I was concerned about this experience as well. I can say my fears were completely unfounded. I find the touchpad to be extremely responsive to both normal “desktop mode” mouse pointer emulation and full Windows 8 gesture recognition. I consistently use it to swap between applications, pull up the charm bar, activate the application bar and scroll both vertically and horizontally. It has the right level of sensitivity and I don’t miss the mouse at all. There are no raised buttons for clicks – you depress the lower left or right – but that is fine. Palm detection is superb and I have yet to have a “miss” where I’m typing and my palm forces the cursor to jump elsewhere. &lt;/p&gt; &lt;p&gt;My only complaint about the touchpad is that sometimes I’ll try to move the cursor and accidently swipe from the edge to activate a Windows 8 gesture instead. Fortunately the touchpad is fairly large so it is easy to adapt to this.&lt;/p&gt; &lt;h2&gt;Screen&lt;/h2&gt; &lt;p&gt;When I started my search for a replacement laptop, I was fairly certain I only wanted to consider full HD at 1080p. It was frustrating to find most of Lenovo’s offerings standardized at the lower 1600 x 900 resolution. After using the laptop, however, I can safely say that this resolution works fine. It is very sharp and bright and watching full screen movies is an amazing experience. I am really pleased with the display, both for its brightness and viewing angles. While it is a glossy (not a matte) display, it is bright enough that I can use it quite well even in bright, outdoor conditions. While the screen is 13.3” there is significant frame around the edge, unlike the ThinkPad X1 Carbon Touch which manages to fit a larger screen in the same size space by bringing it to the edges. This is not an issue in my mind because it makes it easy to use gestures and swipe from the side of the screen. The screen does take to fingerprints easily, but a small cloth takes care of that (and again, the brightness makes it difficult to notice).&lt;/p&gt; &lt;p&gt;The touch works flawlessly and handles all swipes and multi-gestures without issue. The only thing it is lacking is a digitizer pen. I feel like these should be standard with touch screens because they offer so much added precision and flexibility. Speaking of flexibility, the whole point of the Yoga is the various screen orientations that are available and it works well. While I won’t be using it in full laptop mode often, flipping the screen over in “display mode” (imagine the keyboard facing down and the screen closest to you rather than farther away as it is in the traditional laptop mode) is perfect for playing touch games while it’s resting on my lap or resting on my chest when I want to lie down and watch movies.&lt;/p&gt; &lt;h2&gt;Sound&lt;/h2&gt; &lt;p&gt;I’m more of a headphones person so I’ve never paid much attention to laptop speakers unless I’m bringing it outdoors to provide some entertainment. The speakers are housed beneath the keyboard and have decent volume. There is obviously no throbbing bass due to the ultrabook form factor but the volume and clarity are enough to make this work to play some tunes on the deck or while I’m packing my bags for a trip. The laptop comes with Dolby Home Theater and an impressive equalizer that I couldn’t tell you I know how to use.&lt;/p&gt; &lt;p&gt;I mentioned earlier I would share more about the Bluetooth. After an exhaustive search I decided I wanted to invest in a Bluetooth headset (more on the model, etc. below). The headset connected immediately and without issue to my Yoga and produces amazing quality sound. I haven’t tried it for a Skype call yet so the jury is out on the microphone, but I’m used to the older Bluetooth that was tinny and distorted. I’m getting a full range of CD quality sound that is fantastic. I love the freedom of listening without having to keep track of an audio cord. &lt;/p&gt; &lt;h2&gt;Performance&lt;/h2&gt; &lt;p&gt;General performance is fantastic. It will definitely serve as my primary development machine. I’ll talk a bit more about extensibility later, but I do two primary tasks during the day: writing and developing. The laptop performs superbly for both. My current configuration uses a docking station (more on&amp;nbsp; that later) to extend to two additional monitors, giving me a setup with three monitors total (the laptop 1600 x 900 and two 21” 1920 x 1080). I often have a web application on one screen, Visual Studio on another screen, and email or a team chat window open in the third window. I’m debugging a large enterprise project over a Cisco VPN over wireless and it all works flawlessly. Compile times are about 33% faster than my old Dell workstation (again, I attribute this mainly to the speed of the SSD drive) and everything just feels snappy. I haven’t figured out why yet (maybe there are more programs I’ve yet to install) but in general the Yoga seems to consistently use less memory than my Dell setup. Again, it could be some background agents that aren’t running yet.&lt;/p&gt; &lt;p&gt;I read some complaints about the WiFi not being dual band. I’m sure down the road I might have an issue with that but for now the bands included more than match the speed of my connections. My recent test gave me 28 Mbps which exceeds the advertised pipe for my Comcast broadband. No issues there! &lt;/p&gt; &lt;h2&gt;Camera&lt;/h2&gt; &lt;p&gt;The built-in camera is perfect for video conferences. I lead a large distributed development team and we frequently conduct virtual meetings using WebEx, GoToMeeting or even Google Hangouts. The team reported that the camera looked great and the built-in microphone was perfect. I made several Skype calls and had no complaints about audio fidelity. The following was taken during my flight with the screen shaking somewhat – note I’m leaning into the aisle to try to avoid bumping elbows with my seat mate. &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-5HPWMAjfO2k/USFp0CQ-VoI/AAAAAAAAA58/Ti08eQo88Bw/s1600-h/picture0054.jpg"&gt;&lt;img title="picture005" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="picture005" src="http://lh6.ggpht.com/-YPUxFruIDFA/USFp0raqHAI/AAAAAAAAA6E/bHy3vg05Ed4/picture005_thumb2.jpg?imgmax=800" width="626" height="370"&gt;&lt;/a&gt; &lt;/p&gt; &lt;h2&gt;Battery Life&lt;/h2&gt; &lt;p&gt;The huge brick of a Dell I am used to would be lucky to get about 2 hours of solid battery life even with a bulky battery. My &lt;a href="http://www.amazon.com/gp/product/B009F1INL8/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B009F1INL8&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;ASUS VivoTab RT&lt;/a&gt;, on the other hand, seems to go on forever – even on international flights I’ve never come close to running the battery out. While the Yoga may not be comparable to some laptops that approach the 10 hour range, the battery life is still impressive. I’ve had two tests so far – one was at my daughter’s archery competition when I was working on code samples and writing between her sets, and the second is writing this on a flight from Atlanta to Seattle. In the latter case I was editing the blog post, downloading software and listening to music over Bluetooth for the duration of the flight. Neither time did I completely drain the battery, but it showed plenty time remaining even after several hours of use at full brightness. It looks like I am on track to get a full five hours of use before recharging, and I’m assuming that will dwindle if I’m doing things like watching Netflix full screen. Overall I’m perfectly satisfied with the battery life because seldom will I be in a situation that requires it last longer. &lt;/p&gt; &lt;h2&gt;Software&lt;/h2&gt; &lt;p&gt;Although there were some complaints about initial configurations losing up to 40GB of storage, Lenovo seems to have addressed these and ships the laptop with only about 20GB taken up for recovery. That may seem like a lot but on the 256GB system I didn’t even bother with re-partitioning. I can always do that later if I need the space but for now I’m fine with having the little bit of recovery media available in case I need to reset. &lt;/p&gt; &lt;p&gt;Otherwise the shipped software was fairly light. I immediately uninstalled the McCaffee anti-virus as I find the built-in Microsoft tools to be sufficient. So far I’m tolerating the YouCam software, it seems to be a lot of bells and whistles around the built-in camera. Otherwise there is Kindle that holds the current copy of Steve Jobs’ biography that I’m reading, Evernote, a Tetris-like game that features birds, and some Lenovo software like gesture support for the cam and general support for the laptop. Windows 8 makes it extremely easy to simply tap and uninstall unwanted software, while some of the other programs need to be removed from the control panel.&lt;/p&gt; &lt;h2&gt;Extensibility&lt;/h2&gt; &lt;p&gt;One reason I used to always get Dell machines was due to the docking station that made it easy to dock and connect to multiple peripherals including a multi-monitor setup. This used to be something you had to give up when moving to ultraportable devices. Not any more! There are quite a few options that make it easy to extend the setup.The first thing I invested in was a &lt;a href="http://www.amazon.com/gp/product/B005YR1PV2/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B005YR1PV2&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Targus USB 3.0 Docking Station&lt;/a&gt;. The reviews seemed to go either way for this so I decided to take a chance. I am glad I did. I literally unboxed the Targus and plugged it into the Lenovo and it was recognized instantly – the drivers installed automatically in seconds. I was able to plug in my external USB 3.0 hard drive and set up &lt;a href="http://blogs.windows.com/windows/b/extremewindows/archive/2012/12/20/a-new-way-to-backup-file-history-in-windows-8.aspx" target="_blank"&gt;File History&lt;/a&gt;. I then connected my two external monitors. The docking station has one DVI and one HDMI. I have two DVI cables. No worries, the docking station includes all of the converters you could hope for so I simply used the HDMI port with a DVI converter and was instantly greeted with three screens, the vivid Yoga at 1600x900 and my two 21” at 1920 x 1080 (when I return from the MVP summit I plan to connect one of them directly to the Yoga’s HDMI). The USB charging port was able to quickly charge my &lt;a href="http://www.amazon.com/gp/product/B008562SXS/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B008562SXS&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Sennheiser MM 450&lt;/a&gt; headphones (that’s another review – I love them). Now docking my Lenovo is as simple as plugging a cable into the USB 3.0 port.&lt;/p&gt; &lt;p&gt;Here is the three-screen setup: &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-VDJqd-JchS0/USFp1kIhwtI/AAAAAAAAA6M/nTpldq9p6tI/s1600-h/threescreens3.jpg"&gt;&lt;img title="threescreens" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="threescreens" src="http://lh4.ggpht.com/-SfCmWhlByI8/USFp2IcinTI/AAAAAAAAA6U/IMs1d0Rbus8/threescreens_thumb1.jpg?imgmax=800" width="614" height="468"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;The other accessory I got was for the road. With all of the coding and writing I do, I’ve come to rely on a dual-monitor set-up. Before I’d travel with my brick of a Dell along with a huge external keyboard and still be stuck with a single screen. Now with the lighter main laptop I was able to invest in a &lt;a href="http://www.amazon.com/gp/product/B005L2NA54/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B005L2NA54&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Lenovo ThinkVision 14” mobile monitor&lt;/a&gt;. This is a thin monitor that has a hard plastic cover to slide over and protect the glass and runs solely from USB power (there is an included Y-cable for situations when your ports are underpowered). Once again I plugged this in and instantly the driver was recognized and installed. The monitor is only 1366 x 768 and not very bright on a single USB port but it does double the number of screens and give me the workable space I need (it’s perfect for a Word document set to fit the display width when I have Visual Studio pulled up on the higher resolution laptop screen). It takes the place of my external keyboard in my laptop bag (no longer needed because the Yoga keyboard is so great) and ironically takes up less space. If you are interested in this option you may wish to wait; Lenovo is coming out with a 1600 x 900 model later this year with a touch and digitizer pen option. &lt;/p&gt; &lt;h2&gt;Conclusion&lt;/h2&gt; &lt;p&gt;So far I’m extremely pleased with the investment. I am still curious about some of the other devices coming down the pipe in 2013 but the Yoga has exceeded my expectations. It is light, thin, portable, yet powerful enough for me to conduct all of my daily tasks faster than I did on my previous workhorse laptop. That one, by the way, is going to get an installation of &lt;a href="http://www.plexapp.com/" target="_blank"&gt;Plex&lt;/a&gt; and become the family media server.&lt;/p&gt; &lt;p&gt;Have you recently purchased a Windows 8 device? What device was it and why did you pick that particular model? How do you like it? Please leave your feedback in the comments section below and feel free to ask any questions you may have regarding the Yoga. Thanks! &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=NL2VibV6_oM:5cmrCzH4bGQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=NL2VibV6_oM:5cmrCzH4bGQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=NL2VibV6_oM:5cmrCzH4bGQ:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/NL2VibV6_oM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/9174434907372774072/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/02/review-of-lenovo-ideapad-yoga-13-for.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/9174434907372774072?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/9174434907372774072?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/NL2VibV6_oM/review-of-lenovo-ideapad-yoga-13-for.html" title="Review of the Lenovo IdeaPad Yoga 13 for Development" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-rLx5hChMgyQ/USFpwRtvKgI/AAAAAAAAA5E/oxYrT0_Hwwc/s72-c/airplane_thumb3.jpg?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/02/review-of-lenovo-ideapad-yoga-13-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk8NQXk_fCp7ImA9WhNbEUs.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-3397538789229269359</id><published>2013-01-14T07:01:00.001-05:00</published><updated>2013-01-14T07:01:30.744-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-14T07:01:30.744-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><category scheme="http://www.blogger.com/atom/ns#" term="c#" /><category scheme="http://www.blogger.com/atom/ns#" term="winrt" /><title>Referencing the Windows Runtime from Desktop Apps</title><content type="html">&lt;p&gt;Most people think of the Windows Runtime as being synonymous with the formerly-known-as “Metro” applications, now called Windows Store apps. To add to the confusion, of course, is the fact that the ARM-based version of the Windows OS is branded as Windows RT. Programmers, being lazy, like our abbreviations so the runtime has been adopted by the world at large as WinRT. Did you know you can reference WinRT from desktop applications? It’s possible, but not easy nor straightforward.&lt;/p&gt; &lt;p&gt;There are actually two approaches you can follow if you wish to build a desktop application that references the Windows Runtime. The first, through the IDE, works like this:&lt;/p&gt; &lt;p&gt;First, create your project and target the .NET Framework 4.5 or later. You see what I did there? By using “later” I’m hoping this post will still be relevant next year. Once your project is created, right-click on the project node and select &lt;strong&gt;Unload Project&lt;/strong&gt;. You should get something like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-jnpYjtfQqtI/UPPzgZk8BoI/AAAAAAAAA3c/Js4iaz1x2oE/s1600-h/01fig02%25255B3%25255D.png"&gt;&lt;img title="01fig02" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="01fig02" src="http://lh4.ggpht.com/-LOeAz78yINM/UPPzg3aRxpI/AAAAAAAAA3k/ItCL8zGFTHw/01fig02_thumb%25255B1%25255D.png?imgmax=800" width="410" height="271"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now edit the project and add the following tag inside a &lt;font face="Consolas"&gt;PropertyGroup&lt;/font&gt; element:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-QilOJ_0hkuk/UPPzhW7HLfI/AAAAAAAAA3s/0uJVMJyRYss/s1600-h/targetplatformversion%25255B3%25255D.png"&gt;&lt;img title="targetplatformversion" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="targetplatformversion" src="http://lh4.ggpht.com/-MWL3Pxodnwo/UPPziVObDsI/AAAAAAAAA30/8ITTpuTBguM/targetplatformversion_thumb%25255B1%25255D.png?imgmax=800" width="519" height="463"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Reload the project and you’ll now have access to WinRT. If you go to the &lt;strong&gt;Add References&lt;/strong&gt; tab, There will be a new option to add the Core for the Windows Runtime:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-g9AaTlOFMYs/UPPzikZaHJI/AAAAAAAAA34/IhfugW3M7mo/s1600-h/01fig03%25255B4%25255D.png"&gt;&lt;img title="01fig03" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="01fig03" src="http://lh3.ggpht.com/-ADpx8GqBx7s/UPPzjXf6yJI/AAAAAAAAA4E/f-kujmHphf0/01fig03_thumb%25255B2%25255D.png?imgmax=800" width="639" height="461"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Be sure this is included. You might feel like you’re good to go, but there’s actually more to it. Trying to reference WinRT components and compiling will result in an error like this:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-QMJ-JfrVNgQ/UPPzkOkCZwI/AAAAAAAAA4M/URJezlgaSPk/s1600-h/01fig04%25255B3%25255D.png"&gt;&lt;img title="01fig04" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="01fig04" src="http://lh4.ggpht.com/-1Hq9NjcWbM8/UPPzlAVYPYI/AAAAAAAAA4U/XmTU8nWhZek/01fig04_thumb%25255B1%25255D.png?imgmax=800" width="640" height="168"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You need to add another reference to &lt;strong&gt;System.Runtime.dll&lt;/strong&gt; – to do this, browse to the folder:&lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\Facades&lt;/font&gt;&lt;/p&gt; &lt;p&gt;You know the drill: if you’re on 32-bit, remove the (x86) portion. There you will find any other necessary DLLs you need to build and compile your application. If that seems like a lot of work, it is. You could try an alternative. My colleague Jeffrey Richter shows you how to do it from the command line in &lt;a href="http://www.wintellect.com/CS/blogs/jeffreyr/archive/2011/09/20/using-the-windows-runtime-from-a-non-metro-application.aspx" target="_blank"&gt;Using the Windows Runtime from a Non-Metro application&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;You’ll quickly learn that not all APIs are available to desktop applications, and some that are available on the desktop aren’t available to Windows Store apps. If you are in doubt, consult the MSDN documentation for the API in question. You will see what is supported at the bottom under supported client and server:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-w7GiI8Sgvto/UPPzlgc9KBI/AAAAAAAAA4c/E2c_tVmzGUw/s1600-h/01fig06%25255B3%25255D.png"&gt;&lt;img title="01fig06" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="01fig06" src="http://lh3.ggpht.com/-BiX2Ppi3x_I/UPPzmFMTbFI/AAAAAAAAA4k/JfI6RpzMEW4/01fig06_thumb%25255B1%25255D.png?imgmax=800" width="621" height="323"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;MSDN also provides a comprehensive &lt;a href="http://msdn.microsoft.com/en-us/library/windows/desktop/hh920511(v=vs.85).aspx" target="_blank"&gt;Windows 8 API List&lt;/a&gt; for desktop apps.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=7AgWNEIMW0E:8hIypeK8qiA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=7AgWNEIMW0E:8hIypeK8qiA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=7AgWNEIMW0E:8hIypeK8qiA:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/7AgWNEIMW0E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/3397538789229269359/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/01/referencing-windows-runtime-from.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3397538789229269359?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3397538789229269359?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/7AgWNEIMW0E/referencing-windows-runtime-from.html" title="Referencing the Windows Runtime from Desktop Apps" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-LOeAz78yINM/UPPzg3aRxpI/AAAAAAAAA3k/ItCL8zGFTHw/s72-c/01fig02_thumb%25255B1%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/01/referencing-windows-runtime-from.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0QNR30yeSp7ImA9WhNUFEU.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-1741813814947100531</id><published>2013-01-04T07:22:00.001-05:00</published><updated>2013-01-06T10:16:36.391-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-01-06T10:16:36.391-05:00</app:edited><title>Traveling with Microsoft and the ASUS VivoTab RT</title><content type="html">&lt;p&gt;My daughter turns 13 today and to celebrate, our family took a trip to Paris, France. We celebrated Christmas and New Year’s Eve (bonne année) there. I recently purchased an &lt;a href="http://www.amazon.com/gp/product/B009F1INL8/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B009F1INL8&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;ASUS VivoTab RT&lt;/a&gt; and turned over my &lt;a href="http://www.amazon.com/gp/product/B005OUQ9WO/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=cei0e-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B005OUQ9WO" target="_blank"&gt;Samsung Series 7&lt;/a&gt; slate to my wife. We decided to travel light and only bring the slates – no heavy laptops. We were gone for 10 days – so how was the experience? &lt;/p&gt; &lt;p&gt;In a word, fantastic! Before I share some updates around the slate itself, I wanted to mention a few technologies that eased my time in Paris. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Phone (Nokia Lumia 900)&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I brought my Windows Phone and despite it being the “older version” (nope, don’t have the fancy new “8” yet) it was a life saver and I didn’t feel like I missed a thing. I took all of my pictures on the trip using the phone. While the quality pales in comparison to the professional camera my daughter brought along, it held it’s own. Here’s the gardens of Versailles: &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-JDPsAtwVMHI/UObJa6Sos-I/AAAAAAAAA2o/fER_8Ij3oyw/s1600-h/WP_000308%25255B4%25255D.jpg"&gt;&lt;img title="The gardens at Versailles " style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="The gardens at Versailles " src="http://lh3.ggpht.com/-dryp3GmYnVk/UObJb-7dT_I/AAAAAAAAA2w/RsIO4Z28_ys/WP_000308_thumb%25255B1%25255D.jpg?imgmax=800" width="595" height="460"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here’s the moon peeking out from behind the Eiffel Tower at night. I didn’t even tinker with settings aside from changing the “scene” to “night”:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-iX__67rcqPk/UObJcUZzTqI/AAAAAAAAA24/bia_E2lI2d0/s1600-h/WP_000232%25255B4%25255D.jpg"&gt;&lt;img title="WP_000232" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_000232" src="http://lh6.ggpht.com/-WYkLA5K30mw/UObJc7Ls6bI/AAAAAAAAA3A/2gng-TfN6aE/WP_000232_thumb%25255B1%25255D.jpg?imgmax=800" width="333" height="452"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The ability to take high resolution pictures was also a boon because instead of carrying around Metro maps, etc. we’d simply load up a portion of the map we were going to visit, snap a picture on the phone, then pull it up when needed. Worked great.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;SkyDrive&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;We had wireless in the apartment. SkyDrive made it very easy for me to organize my photos on the trip. I would capture pictures all day with the phone, then upload them to SkyDrive and the family would review them on the slate. I also saved some of the materials for my new book so I could edit them on the trip when I felt like it and easily synchronize them back to my laptop when I returned.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Skype&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Skype is awesome. I purchased a year of unlimited calls to the US and Canada because my cellular phone wasn’t getting good reception in my home office (not a problem specific to any phone, just seems the radiation emitted by my large screen monitors does something). I’ve been very satisfied with the service and Paris was no let down. I used Skype and WiFi on my slate to monitor messages on my home and cell phones (I did not get a data plan, so my cell phone was in airplane mode with WiFi turned on the duration of the trip). It made it extremely easy to check for calls. &lt;/p&gt; &lt;p&gt;It also helped me when I made a little mistake. I scheduled a shuttle service to pick us up the last day in Paris and bring us to the airport. We were waiting for the shuttle and it did not show, so I went online to track it and was told I could only track within 2 hours of the service date. Puzzled, I opened my confirmation email and found I had scheduled it for the wrong day! The service was US-based so I used Skype to call in and correct the error – and we made it home fine.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Bank of America&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Bank of America has a great app for Windows 8 and I used it to track my various purchases and withdrawals and track against the exchange rate, etc. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Super Voltage and Ragdoll Run&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Some of the lines were a bit long. We waited three hours to gain entrance to the catacombs! Having &lt;a href="http://www.windowsphone.com/en-us/store/app/super-voltage/980d78a7-4a21-407c-9e6e-05af1290a96f" target="_blank"&gt;Super Voltage&lt;/a&gt; on my phone kept my daughter occupied for most of that time, as well as on the 18 hours of air time we spent traveling between Atlanta and Paris. I personally am a fan of &lt;a href="http://www.windowsphone.com/en-us/store/app/ragdoll-run/88897723-a460-4810-a82f-0a7c7f7fa29a" target="_blank"&gt;Ragdoll Run&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Now to the Slate …&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;So how was the slate experience? &lt;/p&gt; &lt;p&gt;After having it for this time and relying on it during the trip, I can say it was fantastic. I could do everything I wanted: listen to music, keep up with news, post pictures to Facebook, manage pictures, write, Tweet, etc. The extremely long battery life meant I could watch videos and play games on the flights without the battery even showing a dent. &lt;/p&gt; &lt;p&gt;There were some negatives. Specifically, some of the Paris sites I wanted to visit used Flash and for some reason didn’t work with the Internet Explorer 10 even in desktop mode (what was really weird was the &lt;a href="http://www.ratp.fr/plan-interactif/" target="_blank"&gt;interactive Paris Metro application&lt;/a&gt; worked for a few days then started complaining that I didn’t have the right plug-in). That was solved by pulling it up on my wife’s slate. &lt;strike&gt;The other issue was that the Word version doesn’t support the macros my publisher provided for formatting the book, so I decided not to work much on that for fear of losing formatting, etc.&lt;/strike&gt; &lt;/p&gt; &lt;p&gt;Update: turns out I just didn’t know the right way to configure the macros. I have full support and can edit my book on the go with this laptop as well. WOW! Loving it even more.&lt;/p&gt; &lt;p&gt;Those are not deal-breaking issues for me, however, because I don’t expect to have 100% productivity on my slate – it’s a nice, lightweight, portable device and I’m not looking to develop code for it (nope, that’s going to be my next investment, and I’m getting very excited). &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Beyond the Slate&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;So just as a final note, I have to make a purchase soon for a more primary development laptop. I know there are a lot of models coming out in the next few months but I’m not in a position to really wait. I’ve been to several stores and tried out various models. Right now my favorite hands-on model is the &lt;a href="http://www.bestbuy.com/site/Asus+-+Ultrabook+13.3%26%2334%3B+Touch-Screen+Laptop+-+4GB+Memory+-+128GB+Solid+State+Drive+-+Radiant+Black/6906246.p;jsessionid=9F8021A7AD9542E24CAE27B009283D4F.bbolsp-app02-70?id=1218812711231&amp;amp;skuId=6906246" target="_blank"&gt;ASUS 13.3” Zenbook Ultrabook&lt;/a&gt;. It is light, thin, responsive, and fun to use. I liked the form factor better than the &lt;a href="http://www.amazon.com/gp/product/B009Z002M2/ref=as_li_ss_tl?ie=UTF8&amp;amp;tag=cei0e-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B009Z002M2" target="_blank"&gt;Lenovo IdeaPad Yoga 13&lt;/a&gt;, but Lenovo has the best keyboards by far in my opinion (ASUS was a great keyboard compared to all of the other models I tried, but the Lenovo keyboard is still my favorite to type on). Therefore, I’m holding out to test drive a &lt;a href="http://www.engadget.com/2013/01/02/lenovo-thinkpad-x1-carbon-touch-review/" target="_blank"&gt;Lenovo ThinkPad X1 Carbon Touch&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;What do you think?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I know many of you have invested or tried out your own devices, or are currently looking. I am amazed at how far technology has come and how different this trip was compared to the last time I visited 15 years ago (nope, no looking up the Metro online back then). What are your thoughts and experiences? Please share in the comments below.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=MIPxYFmj9VA:ffBFJQQ1gVI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=MIPxYFmj9VA:ffBFJQQ1gVI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MIPxYFmj9VA:ffBFJQQ1gVI:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/MIPxYFmj9VA" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/1741813814947100531/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2013/01/traveling-with-microsoft-and-asus.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1741813814947100531?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1741813814947100531?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/MIPxYFmj9VA/traveling-with-microsoft-and-asus.html" title="Traveling with Microsoft and the ASUS VivoTab RT" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-dryp3GmYnVk/UObJb-7dT_I/AAAAAAAAA2w/RsIO4Z28_ys/s72-c/WP_000308_thumb%25255B1%25255D.jpg?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2013/01/traveling-with-microsoft-and-asus.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUGRH4-fCp7ImA9WhNVEEQ.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-1589026322747413520</id><published>2012-12-21T07:33:00.001-05:00</published><updated>2012-12-21T07:33:45.054-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-21T07:33:45.054-05:00</app:edited><title>The Mixed Bag of Windows 8 Chips</title><content type="html">&lt;p&gt;Ivy Bridge. Clover Tail. No, wait, &lt;em&gt;Cloverview&lt;/em&gt;. ARM? Atom! &lt;/p&gt; &lt;p&gt;Understanding the processors that drive today’s tablets and laptops is definitely like wading through alphabet soup. If the fact that there are two versions of the latest Windows operating system (&lt;a href="http://windows.microsoft.com/en-US/windows/home" target="_blank"&gt;Windows 8&lt;/a&gt; and &lt;a href="http://windows.microsoft.com/en-US/windows/rt-welcome" target="_blank"&gt;Windows RT&lt;/a&gt;) isn’t confusing enough, there are literally dozens of CPUs available and most have an affinity to one OS version or the other. Oh, and by the way, you’ve probably heard that Windows RT runs on ARM processors, right? So why do the tablet processors have names like &lt;em&gt;&lt;a href="http://www.nvidia.com/object/tegra.html" target="_blank"&gt;Tegra&lt;/a&gt;&lt;/em&gt; and &lt;em&gt;&lt;a href="http://www.qualcomm.com/snapdragon" target="_blank"&gt;Snapdragon&lt;/a&gt;&lt;/em&gt;?&lt;/p&gt; &lt;p&gt;First, let’s get some terminology out of the way. &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Chip&lt;/strong&gt; – a piece of silicon with an electronic circuit, and can also be referred to as a &lt;strong&gt;Microprocessor&lt;/strong&gt;. Often used to describe components like the central processing unit (CPU) and graphics processing unit (GPU).  &lt;li&gt;&lt;strong&gt;Chipset&lt;/strong&gt; – an architecture that may include multiple chips designed to work together.  &lt;li&gt;&lt;strong&gt;Instruction Set&lt;/strong&gt; – this is the part of a processor that relates to programming and includes instructions for the processor to execute, registers for storing data, among other features.  &lt;li&gt;&lt;strong&gt;Microarchitecture&lt;/strong&gt; – describes how a given processor implements an instruction set.  &lt;li&gt;&lt;strong&gt;Processor&lt;/strong&gt; – a specialized chip that can interpret instruction sets and perform tasks. For example, most devices have a CPU (Central Processing Unit) and a GPU (Graphics Processing Unit).&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;A quick glance at popular Windows 8 models reveals quite the mix of processor technologies. Here’s a quick rundown:&lt;/p&gt; &lt;table cellspacing="2" cellpadding="2" width="430" border="2"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;&lt;strong&gt;Tablet&lt;/strong&gt;&lt;/td&gt; &lt;td valign="top" width="200"&gt;&lt;strong&gt;Processor&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Acer Aspire S7&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i5-3317U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Acer Iconia W510&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Atom Z2760&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Acer Iconia W700&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i3-3217U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;ASUS VivoTab RT&lt;/td&gt; &lt;td valign="top" width="200"&gt;NVIDIA Tegra 3&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;ASUS VivoTab&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Atom Z2760&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;ASUS ZENBOOK UX31A Touch&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i7-3517U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Dell XPS 10&lt;/td&gt; &lt;td valign="top" width="200"&gt;Qualcomm Snapdragon S4&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Dell XPS 12&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i7-3517U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;HP ENVY x2&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Atom Z2760&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Lenovo IdeaPad Yoga 11&lt;/td&gt; &lt;td valign="top" width="200"&gt;NVIDIA Tegra 3&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Lenovo IdeaPad Yoga 13&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i7-3517U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Lenovo ThinkPad Tablet 2&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Atom Z2760&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Samsung ATIV Smart PC 500T&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Atom Z2760&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Samsung Series 5 Ultra 13 Touch&lt;/td&gt; &lt;td valign="top" width="200"&gt;Intel Core i3-3217U&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="top" width="220"&gt;Surface with Windows RT&lt;/td&gt; &lt;td valign="top" width="202"&gt;NVIDIA Tegra 3&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;That is by no means a comprehensive list but it does show a cross-section of chips you may encounter when searching for a portable Windows 8 device. The first step in understanding what the processors are is to take a look at the following chart. This is my attempt to lay out the processors in a “map” to show the hierarchy:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-5HmxD840H3A/UNRXJNvr7cI/AAAAAAAAA2I/BYlQgiDn534/s1600-h/chipsets3.png"&gt;&lt;img title="chipsets" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="chipsets" src="http://lh4.ggpht.com/-GUTe7UN72wo/UNRXKKIzacI/AAAAAAAAA2Q/iYWuBSI-LCY/chipsets_thumb1.png?imgmax=800" width="670" height="212"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;It’s interesting to note that the ARM chips are “white-labeled” with other companies. This is because they plug into an SoC, or “system-on-a-chip” architecture that allows for multiple components to be integrated onto a single chip. The &lt;a href="http://www.arm.com/products/processors/instruction-set-architectures/index.php" target="_blank"&gt;ARM architecture&lt;/a&gt; is an instruction set architecture that is integrated with other components such as the graphics processing unit (GPU) to provide a low-voltage, high performance experience. All of the chips to the right of the diagram use an ARM-based SoC architecture and only run Windows RT. To the left of the diagram, all of the Intel processors (including Atom) will run the full version of Windows 8. Atom is the SoC offering from Intel.&lt;/p&gt; &lt;h3&gt;Code Names&lt;/h3&gt; &lt;p&gt;You’ll hear quite a view code names for processors. The first two are easy: &lt;strong&gt;Snapdragon&lt;/strong&gt; and &lt;strong&gt;Tegra&lt;/strong&gt; are brands of SoC chips that are based on the ARM instruction set. They are specific implementations of those chips and tablets that use these chips run various devices and operating systems including Windows RT.&lt;/p&gt; &lt;p&gt;The Intel SoC platform was codenamed &lt;strong&gt;&lt;a href="http://download.intel.com/newsroom/kits/atom/z2760/pdfs/Intel-Atom-Z2760_FactSheet.pdf" target="_blank"&gt;Clover Trail&lt;/a&gt;&lt;/strong&gt; (the chipset is &lt;strong&gt;Cloverview&lt;/strong&gt;) and is now mostly referred to by the actual name, the Intel Atom (and as far as I can tell, the Z2760 is the only one out right now). Intel produced a series of chipset versions that handled low voltage (you’ll read about that in a bit) and then developed an even lower voltage set for Atom. Unfortunately, Atom-based tablets are experiencing some delays &lt;a href="http://www.informationweek.com/hardware/handheld/dell-hp-windows-8-atom-tablets-delayed-u/240145002?cid=RSSfeed_IWK_ALL" target="_blank"&gt;due to difficulties with drivers&lt;/a&gt;.&amp;nbsp; The advantage of the ARM-based and Intel Atom processors is that they run cool, eliminating the need for a fan. This allows for an extremely small/thin form factor, and tablets and laptops that use these chips are the thinnest available. My ASUS VivoTab RT is only 8.3 millimeters thick and weighs only 1.16 pounds. Compare that to the iPad3 at 9.4 millimeters thick and 1.43 pounds.&lt;/p&gt; &lt;p&gt;Next you can cross two bridges: &lt;strong&gt;Ivy Bridge&lt;/strong&gt; and &lt;strong&gt;Sandy Bridge&lt;/strong&gt;. These names may be confusing because they don’t refer to a specific processor, but a microarchitecture used by Intel to manufacture their chips. You might see processors listed as “2nd generation” or “3rd generation” Intel processors (all of the new ones are 3rd generation). The 2nd generation was codenamed Sandy Bridge, and the 3rd generation or current batch is called Ivy Bridge. Ivy Bridge is actually based on the Sandy Bridge architecture, but provides a smaller chip, lower voltage and hence less power usage, improved graphics and slightly faster processing speeds. Any i3, i5, or i7 chip you see in a portable device is likely a Sandy Bridge. &lt;/p&gt; &lt;p&gt;The Sandy Bridge family is “branded” as the Core series. This includes the Core i3, Core i5, and Core i7.&lt;/p&gt; &lt;h3&gt;Getting to the Core&lt;/h3&gt; &lt;p&gt;So what is the difference? First, you’ll notice that the specific sequence of each chip listed above includes a “U” at the end. This is simply the designation from Intel for a lower voltage version of the chip. While it sacrifices a bit of performance compared to desktop counterparts, it makes sense for a laptop, ultrabook, slate, or tablet form factor because of the lower power consumption. The difference between series numbers is more complicated but as you might expect, “more is better” in this case, i.e. you’ll likely see advantages to using a Core i7 over a Core i5.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Core i3&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;This is the budget or entry-level family. It is a dual-core chip that lacks a feature called Turbo Boost that allows the chip to overclock at a faster rate. It does have hyper-threading, a technology that allows a physical core to appear as two logical cores. This means the i3 supports four simultaneous threads. The 3217U clocks at 1.8 GHz.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Core i5&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Ironically, the i5 does &lt;u&gt;not&lt;/u&gt; support hyper-threading. The chip itself comes as a quad-core, however, so you still get four threads and these are physical, not logical, threads. While the clock speed for the i5 might be listed as 1.7 GHz it is capable of overclocking to 2.6 GHz.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Core i7&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;The i7 is very similar to the i5 but adds hyper-threading back to the mix. Therefore, this quad-core chip supports up to eight simultaneous threads. It’s important to note that unless software is written to specifically take advantage of multi-threading, this doesn’t necessarily add any benefit and may not justify the expense over the Core i5. It is faster, with a base of 2.0 GHz that can overclock to 3.2 GHz.&lt;/p&gt; &lt;h3&gt;The Atom Formerly Known as Clover Trail&lt;/h3&gt; &lt;p&gt;The Atom processor is the Intel SoC offering that &lt;a href="http://winsupersite.com/windows-8/windows-8-architecture-wars-part-1-clover-trail-vs-arm"&gt;some say could make ARM obsolete&lt;/a&gt;. It runs x86, clocks at 1.8 GHz (the same as the Core i3), supports up to 2 GB of memory and supports hyper-threading. According to Intel, it benchmarks faster than the NVIDIA Tegra 3 and Qualcomm Snapdragon S4. Basically it is a lower performing Intel chipset with the advantage that it consumes less power (making it ideal for thin form factors such as tablets and ultrabooks) and runs the full x86 chipset (allowing it to run the full Windows 8 versions and provide support for legacy Windows 7 and Windows XP applications). &lt;/p&gt; &lt;h3&gt;ARM Yourself&lt;/h3&gt; &lt;p&gt;The last set of chips follow the ARM instruction set. This is a completely different architecture than the Intel chipsets provide, so it is not compatible with the millions of lines of legacy code that was compiled to target x86 and x64 (32-bit and 64-bit Intel) systems. ARM licenses the instruction set architecture so other companies like NVIDIA and Qualcomm then provide their own chips. In addition to allowing for extremely low voltage implementations, ARM does provide a few advantages over the x86 instruction set that Intel processors use. &lt;/p&gt; &lt;p&gt;For example, the Intel chips take complicated x86 instructions and “decode” them into simpler, smaller instruction sets for the chip to follow. The ARM is streamlined to avoid the need for this approach. The x86 set relies heavily on branching logic (perform an operation, then branch based on the result). In the ARM instruction set, every instruction is conditional so if-then-else operations can be handled without branching.&lt;/p&gt; &lt;p&gt;ARM processors are used heavily in smart phones, disk drives, and set top devices. There are several builds of Linux, including Android, that support the ARM architecture, and Microsoft recently released the Windows RT OS specifically to provide ARM support. To make things even more confusing, chip maker AMD which produces, among other things, x86-based chipsets announced it will be &lt;a href="http://www.pcworld.com/article/257511/amd_adds_arm_processor_as_it_looks_beyond_x86.html" target="_blank"&gt;integrating ARM technology with its chips&lt;/a&gt;.&lt;/p&gt; &lt;h3&gt;Summary&lt;/h3&gt; &lt;p&gt;As you can see, there are quite a few options when shopping for a mobile device. Initially, it appeared the ultra-light, ultra-thin form factors would all run the more limited Windows RT OS on ARM architectures, but Intel’s introduction of the Atom processor may change the game. I believe we’ll see a plethora of devices “mature” in the Windows 8 space by the 2nd quarter of 2013 but if you insist on purchasing a device now, understanding the chipset will help you make a more informed decision. I plan to have two devices until the low voltage Intel-based chips can support a true development environment: an ARM-based device for travel and portability, and a Core i7 for my workstation.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=jKziKBDWk9Q:qJf-jMbtCVQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=jKziKBDWk9Q:qJf-jMbtCVQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=jKziKBDWk9Q:qJf-jMbtCVQ:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/jKziKBDWk9Q" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/1589026322747413520/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/12/the-mixed-bag-of-windows-8-chips.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1589026322747413520?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1589026322747413520?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/jKziKBDWk9Q/the-mixed-bag-of-windows-8-chips.html" title="The Mixed Bag of Windows 8 Chips" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-GUTe7UN72wo/UNRXKKIzacI/AAAAAAAAA2Q/iYWuBSI-LCY/s72-c/chipsets_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>2</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/12/the-mixed-bag-of-windows-8-chips.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIGQn4_cCp7ImA9WhNWGUw.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-637940575463330240</id><published>2012-12-19T06:45:00.001-05:00</published><updated>2012-12-19T06:45:23.048-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-19T06:45:23.048-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows phone 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows phone" /><title>The Future of Windows 8 and Windows Phone 8 Development</title><content type="html">&lt;p&gt;Does the snapped view required for Windows 8 apps provide insights into the future of Windows 8 and Windows Phone 8 development? &lt;/p&gt; &lt;p&gt;Windows 8 app developers are required to create a snapped view for their applications. This is the one option for on screen multi-tasking in the Windows 8 world. The usefulness of this view on either a tablet or a laptop form factor depends on how well it is implemented. For example, the Windows Store doesn’t offer any useful functionality when it is snapped – it simply resides on the side of the display with a static logo:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-HLFYfBHUaEc/UNGox_H-3PI/AAAAAAAAA1I/SmksJOu7FAA/s1600-h/storesnapped3.png"&gt;&lt;img title="storesnapped" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="storesnapped" src="http://lh5.ggpht.com/-Ro_v2MA1l6I/UNGoyQP6FDI/AAAAAAAAA1M/ACQuylDn-E0/storesnapped_thumb1.png?imgmax=800" width="652" height="382"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;On the other hand, Skype provides fairly useful snap views when you are chatting, as shown below, or making phone calls. I can use the desktop to work on my “main task” while keeping an eye on the chat or having fast access to mute a call on the side. &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-U0f0NKLruvE/UNGoy7cUAxI/AAAAAAAAA1Y/hueA9L_Avjk/s1600-h/skypesnap3.png"&gt;&lt;img title="skypesnap" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="skypesnap" src="http://lh6.ggpht.com/-V2sMEAJ2f1g/UNGozS2v6dI/AAAAAAAAA1g/LZvg_94y7bY/skypesnap_thumb1.png?imgmax=800" width="657" height="385"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is fairly useful. In fact, I use Skype snapped all of the time – having the control on the side allows me to text (now that it integrates with Messenger) and also makes it easy to mute and unmute as needed. I couldn’t help but notice that the snapped view reminds me of the full-blown application on Windows Phone:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-blBAfkS0YZ8/UNGozxdtIwI/AAAAAAAAA1o/8GZyoCoR--E/s1600-h/skypephone3.png"&gt;&lt;img title="skypephone" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="skypephone" src="http://lh3.ggpht.com/-ri8DzACj1L8/UNGo0cBgq-I/AAAAAAAAA1w/ivbAGSIRkmE/skypephone_thumb1.png?imgmax=800" width="249" height="421"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;So what does that have to do with the snapped view? Well, I got to thinking – what does the Microsoft guidance say about snapped view? You can read the &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465371(v=VS.85).aspx" target="_blank"&gt;guidelines at MSDN&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The snapped view is fixed at 320 pixels wide. This is a width that can scale well to most phone resolutions – the Windows Phone 7 width was 480 and goes up from there. So setting this as a fixed width means it automatically fits in any Windows Phone screen. Here’s what’s even more interesting: the guidance for snapped is that "the snapped app is your app resized! It is not a gadget or a minimized window. You want to maintain state, context, and interactivity for your users. Snapping and unsnapping should never destroy the user's work or state.” That means the snap view &lt;em&gt;should&lt;/em&gt; behave as a fully functional application.&lt;/p&gt; &lt;p&gt;At the very minimum, it seems that if you are targeting both Windows 8 and Windows Phone, then you have a point of parity that should be designed for: the snapped view. Shouldn’t the snapped view of your Windows 8 app behave pretty much the same as the full blown app on the phone form factor? There may be some nuances that you have to address (for example, the panorama control that works well on the phone isn’t necessarily available for the snapped view on Windows 8) but for the most part you are functioning in a similar form factor (while the strip goes “long” on large displays, this is easily a vertical scroll on the phone).&lt;/p&gt; &lt;p&gt;So then my next question is this: did Microsoft plan for this? Is the snapped view really just a convenient way to allow two apps to run side-by-side on Windows, or is it maybe a forward-looking approach to the eventual unification of the platforms? To me, it’s an interesting notion: if you write a Windows 8 app with a fully functional snapped view, couldn’t you potentially port that directly to the phone without changing a thing? &lt;/p&gt; &lt;p&gt;It’s an intriguing notion. Of course, it does have some flaws as well. For example, you can’t ignore the fact that a lot of the code and XAML for a given app will be focused on the full screen Windows 8 app experience, and that extra overhead makes no sense for the phone (it just takes up extra space that’s not needed). Then there is the issue with the 320 pixel width: modern phones support much higher resolutions, so the snap view could quickly become clunky and scaled on future phones. &lt;/p&gt; &lt;p&gt;So what to do? &lt;/p&gt; &lt;p&gt;My opinion is that the snapped view can provide the means to an approach for forward-thinking developers. The platform may or may not become fully unified in the future, but that doesn’t mean you don’t have the tools right now to build code in a way that takes advantage of both. Through the use of the &lt;a href="http://csharperimage.jeremylikness.com/2012/03/understanding-portable-library-by.html"&gt;Portable Class Library&lt;/a&gt; you can already &lt;a href="http://blogs.msdn.com/b/mvpawardprogram/archive/2012/11/26/shared-code-for-windows-8-and-windows-phone8.aspx" target="_blank"&gt;share code between Windows 8 and Windows Phone 8&lt;/a&gt;. It seems that you could structure your application to take advantage of snapped view and overlap the majority of logic that targets the smaller form factors, then target the full screen Windows 8 view as a separate experience. &lt;/p&gt; &lt;p&gt;What do you think?&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=47S6W8zqF3s:kKzbL4n3psc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=47S6W8zqF3s:kKzbL4n3psc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=47S6W8zqF3s:kKzbL4n3psc:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/47S6W8zqF3s" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/637940575463330240/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/12/the-future-of-windows-8-and-windows.html#comment-form" title="13 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/637940575463330240?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/637940575463330240?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/47S6W8zqF3s/the-future-of-windows-8-and-windows.html" title="The Future of Windows 8 and Windows Phone 8 Development" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-Ro_v2MA1l6I/UNGoyQP6FDI/AAAAAAAAA1M/ACQuylDn-E0/s72-c/storesnapped_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>13</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/12/the-future-of-windows-8-and-windows.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEEHSXg4fCp7ImA9WhNWF0k.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-3986637625254298118</id><published>2012-12-17T07:17:00.001-05:00</published><updated>2012-12-17T07:17:18.634-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-17T07:17:18.634-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows rt" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="vivotab" /><category scheme="http://www.blogger.com/atom/ns#" term="tablet" /><category scheme="http://www.blogger.com/atom/ns#" term="slate" /><category scheme="http://www.blogger.com/atom/ns#" term="asus" /><title>ASUS VivoTab RT Review</title><content type="html">&lt;p&gt;I recently purchased an &lt;a href="http://www.amazon.com/gp/product/B009F1INL8/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B009F1INL8&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;ASUS VivoTab RT&lt;/a&gt; (the TF600 SKU, 32 GB of storage). As it is one of the less popular &lt;a href="http://windows.microsoft.com/en-US/windows/rt-welcome" target="_blank"&gt;WindowsRT&lt;/a&gt; models I wanted to write a short review to explain why I made the purchase and how it is working out. &lt;/p&gt; &lt;h3&gt;Why Get a WindowsRT Device?&lt;/h3&gt; &lt;p&gt;The first question is, of course, “Why?” There are several reasons I decided to pick up this particular device. After using a &lt;a href="http://www.amazon.com/gp/product/B005OUQ9WO/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B005OUQ9WO&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Samsung Series 7 Slate&lt;/a&gt; running Windows 8 for over a year now, I’ve come to realize that we are not yet in a “one device” world. While there are a number of exciting new hybrid and convertible tablets, I’ve watched my own usage of an arguably “business ready” slate (capable of writing chapters, developing, and compiling production code as I did for my &lt;a href="http://www.amazon.com/gp/product/0321822161/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321822161&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Building Windows 8 Apps Book&lt;/a&gt;) I really … just … don’t use it that way. Even my bulky Dell Latitude E6510 ends up serving me mostly when it’s in the docking station so I have my large screen monitors and external keyboard and mouse. This is where I do my “productivity” work or engage in business use. That’s tasks like image editing, developing code, and heavy writing (ironically, there is just one app that we need on WindowsRT to shift the bulk of writing over, as I’ll explain in a bit). &lt;/p&gt; &lt;p&gt;Based on this, I came to the realization that I don’t need a device with lots of storage or processing power for my tablet. In fact, I don’t really want it. I’ve had a tablet capable of running those power apps I’m used to from Windows 7 and while I installed them and tinkered with them, I’m almost exclusively running Windows 8 apps. The tablet is absolutely for casual use. That includes casual writing, productive browsing (I can do a lot with web-based apps using Internet Explorer 10), watching movies, and checking and responding to email. If I can eke out just a few more tasks like going into Word, Excel, and PowerPoint, then it’s also good for portability. When I take short business trips or long vacations, I’d much rather lug around a light tablet than a heavy business laptop.&lt;/p&gt; &lt;p&gt;While I know I can run those fancy x86 apps using an Atom processor, I really don’t see the need to go outside of ARM. So for me, WindowsRT is a fine choice for one of two machines I’ll use. I’m not trying to make it my “main" machine.” I understand consumers can get confused about the choice, but I’d also argue many consumers will do just fine with what WindowsRT provides. I like to think of it as “that Windows 8 version that really only runs Windows 8 apps and Office.” I know that’s oversimplifying, but this is precisely what I use it for. &lt;/p&gt; &lt;p&gt;So then the next logical question is, “Why the ASUS VivoTab? Why not a Surface?” Let me preface by saying I love the &lt;a href="http://www.microsoft.com/Surface/" target="_blank"&gt;Surface&lt;/a&gt;. It’s an amazing piece of hardware. I love what they did with the keyboard and how even the touch keyboard responds so nicely and provides a very usable experience. There are some issues, however. The kickstand works great in commercials with students slapping it on flat surfaces, but what about propped up on my chest when I’m on the couch watching a movie? The kickstand really doesn’t do much for that … whereas the Samsung had a hard case I could arrange in a “tent mode”. Besides, a lot of people are picking up the Surface so I was interested in trying out some other form factors. &lt;/p&gt; &lt;p&gt;There was another practical reason. For the follow on book to my first one – a more in-depth volume that covers the Windows Runtime in advanced detail – I’ll need to write sample code and demonstrate the use of sensors. It turns out that the ASUS VivoTab has two that the Surface does not: GPS (and I mean freaky good GPS, as in “the blue dot is literally showing the room of my house I’m in” good) and NFC. While I could get devices to hook externally to test these, I liked that they come with the ASUS right out of the box.&lt;/p&gt; &lt;p&gt;Here’s me testing the accelerometer:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-Vy7FHE7VyxE/UM8NJNEBCZI/AAAAAAAAAzc/Y3rdPlysddY/s1600-h/accelerometer6.png"&gt;&lt;img title="accelerometer" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="accelerometer" src="http://lh5.ggpht.com/-ElkNoHooxQY/UM8NKX5k_JI/AAAAAAAAAzk/XO3tFA0l8mo/accelerometer_thumb2.png?imgmax=800" width="494" height="382"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;The Buying Experience&lt;/h3&gt; &lt;p&gt;My experience picking one up wasn’t too bad. I started by reading reviews and narrowing the field, then looking at prices. It turns out there is a great special and ASUS will throw in the keyboard dock for free when you order before 2013. I can’t imagine reviewing this device without the dock. It serves as a stabilizer (yes, I can rest it on my lap on the couch because it’s a firm dock with the keyboard) but also extends the battery life. I’m thinking “constant use on overseas flights.” It makes it into a nice little folding laptop. &lt;/p&gt; &lt;p&gt;I wanted to try out several machines (remember, I’m in the market for two … this is my casual/portable one but I’m looking for the main business-case one to use as well) so I drove to Best Buy first. They had two models on display. If I was an average consumer, I’d have stopped right there. These devices had been literally touched to death (salespeople, how about wiping them clean every once in awhile?). The touch was non-responsive – I couldn’t even get the &lt;a href="http://windows.microsoft.com/en-US/windows-8/charms#1TC=t1" target="_blank"&gt;Charms bar&lt;/a&gt; to show! That was both devices. They had so much crap running that trying to tap a tile or multitask was taking forever. My heart sank … no way I could use this … but it still seemed strange that none of those problems were discussed in any of the reviews I read or hands-on videos I watched.&lt;/p&gt; &lt;p&gt;It was funny hearing the sales representatives talk to customers. There was a huge gathering of people trying out Windows devices. Surface was in high demand, only the message was, “Wait.” Over and over I’d watch someone pick up the Surface and start to play with it, seem pleasantly surprised, then call over an assistant only to be told, “You don’t want to buy that. The Pro is coming out soon, that’s what you want.” Not, “What do you need?” or “What are you looking for?” but simply, “Wait.” No wonder sales aren’t that great, and I don’t think Best Buy is going to up those much if that is the message they were rolling out.&lt;/p&gt; &lt;p&gt;Instead of giving up, I made a few calls and located an Office Depot that had the model in stock. I drove there and was able to use that device. I really enjoyed it. The touch worked fine, it was super responsive, and I had no issues. Maybe I should be concerned about future wear and tear based on the Best Buy experience, but I suspect their tablets may have been abused slightly more than what mine will go through. Anyway, I was sold right there. I told the cashier what I wanted, and laughed when the reply was, “Um, sir, you know that’s a WindowsRT device, right? Are you SURE you want to buy that?” “Yes, please, let me give you my money.” They caved in and allowed me to purchase it. It was nice to get it from a store because I saved shipping, got to try the device out, and they honored the free keyboard right there (no rebates or mail-ins, just a second box to go with my new tablet).&lt;/p&gt; &lt;h3&gt;The Build Quality&lt;/h3&gt; &lt;p&gt;I got home and unboxed and was incredibly impressed with the device. I’m not one to go into heavy detail with the “unboxing experience” but ASUS really did a great job of packing it. When I picked up my first iPhone it felt like getting a piece of jewelry in a velvet box and this experience was no different. It’s in a nice, professional looking black box with a padded inside and crisp, tight presentation (the documents come enclosed in a glossy black cardboard box and everything is tightly packed and wrapped in plastic). The slate itself is incredibly thin and light. Here’s one of my not-so-professional pictures holding it from the side:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh4.ggpht.com/-h-LriZkwovg/UM8NLNGcGfI/AAAAAAAAAzs/zTk_126rpXI/s1600-h/asusside4.jpg"&gt;&lt;img title="" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="" src="http://lh3.ggpht.com/-CxQxKnaGY7M/UM8NMCYvtkI/AAAAAAAAAz0/Arce6j5W17I/asusside_thumb1.jpg?imgmax=800" width="436" height="337"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I love the rounded corners. The back has a brushed metal appearance and texture that just feels firm and sturdy. It is really easy to grip in both hands or with a single hand as needed. All of the outlets are well-positioned. I personally like that the thickness was not compromised for USB. Instead, you can use a dongle to bridge USB into the super-thin slot that serves as the power outlet. Once you get the hang of the volume rocker (it is tilted slightly so you have to press behind the device) it also makes perfect sense. &lt;/p&gt; &lt;p&gt;The first complaint I have is the power cord itself. It seemed simple and easy enough to plug in, but when I tried to pull it out the first time, the plastic sleeve literally started to come out while the internal connector remained snugly attached. I pushed the plastic down and gripped it farther back and it disengaged fine. There doesn’t appear to be any damage and I’ve used it several times for both the slate and keyboard dock. Ironically, even though I now know I have to grip it a certain way to remove it, when it is seated it appears to be slightly loose. I found myself checking the power indicator a few times to convince myself it was OK.&lt;/p&gt; &lt;p&gt;The keyboard is also impressive. I like the overall look and feel:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-l3myzD_gOT8/UM8NM73YA2I/AAAAAAAAAz8/-KH5248Q060/s1600-h/asuskeyboard4.jpg"&gt;&lt;img title="" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="" src="http://lh6.ggpht.com/-EglgqW15-2I/UM8NNvj8nPI/AAAAAAAAA0E/HjlQnT6iBXw/asuskeyboard_thumb1.jpg?imgmax=800" width="467" height="361"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;There are keys for about anything you’d like to do, but doing it is another story. While they have good travel and nice, chicklet-style feedback, they are also very cramped. While I can type quickly it takes some getting used to. The backspace button feels really small and out of place, and sometimes I found myself struggling to use the shift key in combination with a character. It is usable and I noticed that I was getting better with practice, but even the similarly sized Bluetooth keyboard I got with my Samsung feels more functional and productive.&lt;/p&gt; &lt;p&gt;I’ve heard some complaints about the track pad but I really enjoy it. It seems responsive and well calibrated in my opinion, and I found myself using it easily with a single finger or thumb while the tablet is docked. Using a single touch it works like you would expect as a replacement for a mouse pointer. Use two fingers, however, and you get gesture support. The main advantage here is that you can scroll as if you are swiping the screen. This works both horizontally and vertically, and I use it a bit. It is super sensitive, which I like because I can zoom through a list quickly and get to where I want to go – no more awkward scrollbar dragging or clicking to scroll.&lt;/p&gt; &lt;p&gt;The dock itself is sturdy. I consider it an advantage because I can set it down on my lap or on other unstable surfaces and still view the screen in an angle I desire. The docking experience itself is a little unsettling. While it does vibrate when turned on to indicate a successful dock, I find myself pressing a bit hard and worrying about damaging the ports if I’m not aligned. There isn’t a satisfying click when it snaps into place, so if you aren’t powered on you have to guess – you only get the vibration when you are powered on. Undocking it requires pressing a lever on the side to release it and pulling it up. The slate doesn’t detach easily and again I find myself worrying about damaging the unit. &lt;/p&gt; &lt;p&gt;Once docked, however, it works great as a miniature laptop. The hinge is hidden in a clamshell design and you can angle the display with a good degree of freedom and even close the “lid” to make it hibernate. I find this to be the easiest way to carry it around without worrying about the screen. Even with the keyboard it’s very light (less than 3 pounds) but the added bonus is battery life. I haven’t had a chance to run it down but the manufacturer states up to 19 hours and reviewers are saying around 15 hours of life when it is docked. That’s huge, and it’s done without any large or heavy batteries. This is a truly innovative design in my opinion and will come in handy when heading overseas. In the following snapshot, I’m not running a Commodore 64 emulator – it’s just the background I use to confuse strangers and start interesting conversations with other nostalgic 6502 hackers.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-eqVbxFgueRI/UM8NO2pDVaI/AAAAAAAAA0M/So0doqbrHPc/s1600-h/asuswithdock4.jpg"&gt;&lt;img title="" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="" src="http://lh6.ggpht.com/-uAqoK9xHxzk/UM8NPfpB-uI/AAAAAAAAA0U/g4Y_uUUXlHI/asuswithdock_thumb1.jpg?imgmax=800" width="565" height="436"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The speakers are built into the back of the slate and have a very clear, crisp sound. I started off the day this morning by loading up a Christmas station and playing Christmas songs. The built-in volume is plenty to hear throughout the house. The audio out is also crisp and clear and sounds great in my headphones. &lt;/p&gt; &lt;p&gt;The screen is only 1366 x 768 but it works – plenty of pixel density for a 10.1” screen. The display is incredibly bright and crisp. I tried several different modes, between working with applications, playing games, watching movies and reading books in the Kindle app. All modes worked great and are far more crisp and clear than what I’m used to (and no, I’m not an iPad user so I understand that may be old hat for some). Full screen video worked flawlessly (I tested Netflix streaming and local video at full screen). &lt;/p&gt; &lt;h3&gt;Usability&lt;/h3&gt; &lt;p&gt;So the most important part of the review is … how usable is it? If you’re not familiar with the Windows Store, it provides a nice feature that keeps all of your apps in a single location regardless of what device you are using if you sign in with a Windows Account. That makes it easy to find apps that I purchased or downloaded on my other devices and quickly install them on the new device. Some of the apps that came with it:&lt;/p&gt; &lt;h4&gt;Built-in Mail&lt;/h4&gt; &lt;p&gt;This comes “as is.” While it does not provide a version of Outlook in the preview, I really don’t care. I won’t use this for heavy business mail and it is perfectly fine for browsing and reading mails. I wired in all of my accounts easily (from Office 365 to Gmail and Live) and it ran fine. &lt;/p&gt; &lt;h4&gt;People&lt;/h4&gt; &lt;p&gt;The people hub picked up my social connections automatically through my Windows Account and works fine. Unfortunately, since the TweetRo debacle I haven’t found a good Twitter client for Windows 8. TweetRo has the features I want so this may just be the reason I’ve been looking for to slap down $9.99 for the pro version. I tried Rowi (don’t like the interface) and MetroTwit (kept crashing on me) so I’m a little stuck on that respect. The People Hub works fine for quick glances and notifications but I don’t consider it a replacement for the better native software we’ve all grown accustomed to.&lt;/p&gt; &lt;h4&gt;Office&lt;/h4&gt; &lt;p&gt;It is exciting to me that Office is available for this device. To me, that’s a key differentiator between WindowsRT and iOS devices. It’s not just the ability to view and work with Office documents, but to have a fully functional suite that allows you to create, edit, and consume them. The apps appear to work great – I opened several different types of documents. There were a few hiccups, however, that it is important to share.&lt;/p&gt; &lt;p&gt;The first happened when I opened a contract that had form fields and tried to print it to the native printer driver that was auto-recognized. My &lt;a href="http://www.amazon.com/gp/product/B001PM6RX6/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B001PM6RX6&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;HP Office Jet Pro 8500 A910&lt;/a&gt; was found automatically. The driver was not too happy, however, and I kept spitting out errors when I tried to print to it. I’d get a dialog telling me “the selection is invalid” that would keep popping up when dismissed and forced me to close the application through the Task Manager. I joined my Homegroup and the same printer showed up as a share from my Windows 8 laptop. Printing through the share worked fine and had no issues, so I’m not sure why the direct print had problems.&lt;/p&gt; &lt;h4&gt;Asus Software&lt;/h4&gt; &lt;p&gt;Asus adds some software that is surprisingly usable. There’s a connector to their WebStorage service that gives me 5 GB of extra space, a dictionary, a special camera app with built-in effects, a note-taking product (looks good but I’ll stick to OneNote), and a “fun center” that appears to feature various types of radio stations – I listened to a few and enjoyed them although the interface was terrible. Kindle was pre-installed and works well on the tablet and with the sharp, bright display is very readable even in direct sunlight.&lt;/p&gt; &lt;h4&gt;&lt;strong&gt;Stuff I Installed&lt;/strong&gt;&amp;nbsp;&lt;/h4&gt; &lt;p&gt;The &lt;strong&gt;Google Search app&lt;/strong&gt; is a must-have. It has great voice recognition and does a pretty good job of figuring out what you are asking for. I used it to test the built-in microphone and it scanned my voice with no problems. I installed &lt;strong&gt;Bank of America&lt;/strong&gt; to stay on top of my accounts (I love being able to deposit checks by taking pictures from my home office) and &lt;strong&gt;Lync&lt;/strong&gt; to stay connected with my business. &lt;strong&gt;Slacker Radio&lt;/strong&gt; is a personal radio station that I enjoy and has channels that I can customize and listen to that I can’t find on &lt;strong&gt;iHeartRadio&lt;/strong&gt; (which I also use). &lt;/p&gt; &lt;p&gt;Of course, I threw in a mess of games from &lt;strong&gt;Minesweeper&lt;/strong&gt; and &lt;strong&gt;Solitaire&lt;/strong&gt; to &lt;strong&gt;Card Games Chest&lt;/strong&gt; (a cool game that has Crazy 8s and an Uno knock-off). I installed &lt;strong&gt;LastPass&lt;/strong&gt; (it’s built-in browser is usable, but when push comes to shove I use the desktop browser and flip over to LastPass to cut/paste passwords for key sites). &lt;/p&gt; &lt;p&gt;For keeping up with news I use &lt;strong&gt;Nextgen Reader&lt;/strong&gt; which works just as well on the ASUS as it did on my Samsung slate. &lt;strong&gt;Netflix&lt;/strong&gt; is a must-have. I spend a few hours watching Battlestar Gallactica rebooted episodes in full screen. The image was crisp and clear with no stutter and the audio quality sounded even better than on the Samsung. &lt;/p&gt; &lt;p&gt;&lt;strong&gt;Xbox SmartGlass&lt;/strong&gt; is always fun to cut in when my daughter is watching a movie and randomly pause it from the next room. &lt;strong&gt;Skype&lt;/strong&gt; installed and I made a call to my wife’s cell phone. She heard me loud and clear. I haven’t tested video conferencing with Skype yet but I tested the video camera and it works fine. &lt;/p&gt; &lt;p&gt;I installed &lt;strong&gt;NovaMind’s Mind Map&lt;/strong&gt; software. It is built really well for the slate experience. I used it to create a mind map for writing this article, and printed it out to use as a reference. &lt;/p&gt; &lt;p&gt;The last thing I installed was &lt;strong&gt;Jack of Tools&lt;/strong&gt; to test out the various sensors. I found the accelerometer, GPS, and compass all work well. I see the ambient light sensor kicking on as well, but that particular app flags it as “not available.”&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-J2_1lnSgrXw/UM8NQDUDNdI/AAAAAAAAA0Y/mJurm6PZX7Y/s1600-h/compass3.png"&gt;&lt;img title="compass" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="compass" src="http://lh5.ggpht.com/-km-WrZMdQso/UM8NQ5V2QwI/AAAAAAAAA0k/u-LgbLkniGc/compass_thumb1.png?imgmax=800" width="497" height="267"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h4&gt;Usability Summary&lt;/h4&gt; &lt;p&gt;Overall I was worried that with an ARM processor and 2 GB of memory that I’d struggle using these applications. Maybe I haven’t had it long enough, but that simply wasn’t the case. Everything was fast and responsive and worked well, including heavy video, audio, and graphics. I really haven’t found anything yet that feels like it runs more slowly on this device. Perhaps that is one of the powerful benefits of the lifetime model that Windows 8 apps follow – they allow the foreground app to retain the majority of resources and only run things in the background that make sense like audio (who wants to lose their favorite jingle when they switch away from the music app to play games?) &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-rud6CFw9d-8/UM8NSAfeKII/AAAAAAAAA0s/fhgeT3iqsSQ/s1600-h/asusstartscreen4.jpg"&gt;&lt;img title="" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="" src="http://lh6.ggpht.com/-bzc-Vks_EWc/UM8NTKH-LGI/AAAAAAAAA0w/4XJDzehIuB8/asusstartscreen_thumb1.jpg?imgmax=800" width="517" height="361"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The touch is responsive and snappy, the touch pad does everything I need it to, and while my fingers fumble over each other on the small keyboard it can get the job done. As I wrote earlier, I haven’t tried to drain the battery but I spent several hours browsing mail, watching videos, printing documents and surfing the web and the battery didn’t look like it drained even a bit. &lt;/p&gt; &lt;h3&gt;Complaints&lt;/h3&gt; &lt;p&gt;I do have some complaints. You’ve already heard about my issues with the keyboard design and the power cord. Another complaint is the lack of stylus support. While my finger works fine in some cases, the stylus provides extra precision where touch and the touch pad fall short. There may be certain pens that work with the display but I don’t own any and am not aware of any. &lt;/p&gt; &lt;p&gt;I’ve read that the WiFi might be sub-par but I don’t see that in my tests. I have an 802.11n router and my laptop regularly clocks 25 Mbps download and 8 Mbps upload speeds. The same test on my ASUS tablet yielded 25 Mbps down and 4 Mbps. These are the same results I get on my Samsung Series 7 slate. The signal does drop a bit more with distance compared to the slate and laptop I own, and I don’t believe the VivoTab supports 5 GHz wireless.&lt;/p&gt; &lt;p&gt;The other issues I had are related to WindowsRT and not specific to the ASUS (I would have these same issues on a Surface). The Office suite is a preview and it shows – there are definitely some features that behave differently and are less stable than the RTM version that runs on x86 machines. Homegroup is a selfish experience on WindowsRT. You can join and tap into the network, but you can’t share your own libraries (you can take it in but you can’t dish it out). &lt;/p&gt; &lt;p&gt;None of these complaints is major, but there is one problem that does annoy me with WindowsRT. There is no decent blogging software. I tried using the blog feature in Word only to have it choke on my Blogger credentials and tell me I couldn’t use their picture provider, whatever that means. It wasn’t usable. &lt;/p&gt; &lt;p&gt;I would love to be able to start a draft of a blog post using LiveWriter on my slate, fill in major ideas or notes, then pull it up on the full laptop to fill in images or do heavy editing. Unfortunately, that simply isn’t possible at the moment. Instead, I settled with laying out my thoughts using the mind map software, printing it from the slate and then heading back over to the laptop to run LiveWriter. If I could get a workable version of LiveWriter on this machine I could say it does everything I want it to.&lt;/p&gt; &lt;h3&gt;Bottom Line&lt;/h3&gt; &lt;p&gt;Bottom line? I think this is a terrific device. It is lighter than the iPad but still feels firm and projects a sense of precision and high quality engineering. I prefer the clam shell docking design over the Bluetooth option, and the battery life simply can’t be beat. With a crisp, clear display, highly responsive touch, and the built-in apps that address most of the things I want to do like watch videos and play music, I would already consider this an iPad contender. Add to that fully functional copies of Word, Excel, PowerPoint, and OneNote, and I consider it a winner.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=aqzgJltY9p0:gjNRi9WDxEA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=aqzgJltY9p0:gjNRi9WDxEA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=aqzgJltY9p0:gjNRi9WDxEA:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/aqzgJltY9p0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/3986637625254298118/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/12/asus-vivotab-rt-review.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3986637625254298118?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3986637625254298118?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/aqzgJltY9p0/asus-vivotab-rt-review.html" title="ASUS VivoTab RT Review" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-ElkNoHooxQY/UM8NKX5k_JI/AAAAAAAAAzk/XO3tFA0l8mo/s72-c/accelerometer_thumb2.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/12/asus-vivotab-rt-review.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMCRHc4fip7ImA9WhNXGEU.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-6270317079267996684</id><published>2012-12-07T08:37:00.001-05:00</published><updated>2012-12-07T08:37:45.936-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-12-07T08:37:45.936-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="old school" /><title>Going Old School on Windows 8</title><content type="html">&lt;p&gt;The other day I was browsing some archives on an old disk drive and came across the &lt;a href="http://www.c64emulator.co.uk/d64andt64files.htm" target="_blank"&gt;T64 formatted binaries&lt;/a&gt; of some &lt;a href="http://en.wikipedia.org/wiki/Demoscene" target="_blank"&gt;demo software&lt;/a&gt; I wrote for the Commodore 64 in the 1980s. Demo software is fun to write and is more about tricks and optimizations than business rules or data models. I had written a few fun projects in Silverlight a few years back and decided to convert some over to Windows 8. This particular project involved using a &lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/br210192.aspx" target="_blank"&gt;plane projection&lt;/a&gt; on six different rectangles to provide the illusion of a cube (it is an illusion because it’s not true 3D rendering, but instead the manipulation of the rectangles to give the illusion of a 3D construct). This was overlaid on a classic sine-based &lt;a href="http://en.wikipedia.org/wiki/Plasma_effect" target="_blank"&gt;plasma field&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-Kjy2ElTURD4/UMHxJfVW5EI/AAAAAAAAAzA/2OmLugCvbbE/s1600-h/SplashScreen3.png"&gt;&lt;img title="SplashScreen" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="SplashScreen" src="http://lh3.ggpht.com/-Z60h2Ewukq0/UMHxJ9cKrEI/AAAAAAAAAzI/oobTT_jB6tY/SplashScreen_thumb1.png?imgmax=800" width="644" height="327"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once again, I was amazed at how quickly and easily I was able to port the code over to Windows 8. Essentially, the only real work was changing the implementation of the plasma effect because the older version was able to manipulate pixels directly in the bitmap object, whereas in Windows 8 this must be done in a buffer and transferred over. By no means is this code optimized and efficient – you’ll certainly see the CPU spike – but it’s a neat and fun effect to watch and coding it was a nice break from typical line of business work.&lt;/p&gt; &lt;p&gt;The first step was creating the cube. A style defines the properties of a “side”: &lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Style&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; TargetType&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Rectangle"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Setter&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Property&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Margin"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Value&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"170,50"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Setter&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Property&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Height"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Value&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"150"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Setter&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Property&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Width"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Value&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"150"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Setter&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Property&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Opacity"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Value&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0.5"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Style&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Next, the sides are positioned to simulate the actual surface of a cube – here are just two of the six sides as an example. Note two sides are wrapped in the grid to facilitate the necessarily transformations to project properly:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Fill&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Orange"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle.Projection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;PlaneProjection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; x&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Rectangle4Projection"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&lt;br&gt;             CenterOfRotationZ&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"-75"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; RotationX&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"90"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle.Projection&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Margin&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"170,50"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid.Projection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;PlaneProjection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; x&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Rectangle5Projection"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;&amp;nbsp;&lt;br&gt;         CenterOfRotationZ&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"-75"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; RotationY&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"-90"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid.Projection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Margin&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Fill&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Yellow"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; RenderTransformOrigin&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0.5,0.5"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle.RenderTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;TransformGroup&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;ScaleTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;SkewTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RotateTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; x&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Rectangle5Rotation"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Angle&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;TranslateTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;TransformGroup&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle.RenderTransform&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Rectangle&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;With the sides in place, the control itself wires into two events. The first event, the&lt;font face="Consolas"&gt; &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.media.compositiontarget.rendering.aspx" target="_blank"&gt;&lt;font face="Consolas"&gt;CompositionTarget.Rendering&lt;/font&gt;&lt;/a&gt; event, fires each time a frame is rendered for the application. This is one way to handle animations by “cheating” on the render loop rather than depending on a dispatcher timer. It also means the cube will move at different rates based on the speed of your machine. That event is used to update the projections for the sides:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; CompositionTargetRendering(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle1Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle2Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle3Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle4Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle5Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle6Projection.RotationY += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.X - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualWidth) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle1Projection.RotationX += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle2Projection.RotationX += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle3Projection.RotationX += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle4Projection.RotationX += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle5Rotation.Angle -= ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Rectangle6Rotation.Angle += ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt.Y - (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight / 2)) / &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot.ActualHeight) * 10;&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;You’ll notice there is a reference to a &lt;font face="Consolas"&gt;pt&lt;/font&gt; instance that impacts the offsets applied to the cube. This instance is updated by the &lt;font face="Consolas"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.pointermoved.aspx" target="_blank"&gt;PointerMoved&lt;/a&gt;&lt;/font&gt; event, and used to allow you to change the speed and direction of rotation of the cube by swiping your finger, mouse, or stylus across the cube.&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; LayoutRootPointerMoved(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;br&gt;       Windows.UI.Xaml.Input.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;PointerRoutedEventArgs&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pt = e.GetCurrentPoint(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LayoutRoot).Position;&lt;br&gt;}&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;The plasma effect is also a control. An &lt;font face="Consolas"&gt;Image&lt;/font&gt; is used to host the plasma background:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Image&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; x&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"PlasmaImage"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Stretch&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Fill"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;br&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Each frame, a new wave of sine data is computed, mapped into a pixel buffer, and applied to the &lt;font face="Consolas"&gt;Image&lt;/font&gt;. A virtual size of 320 x 200 is used and then simply expanded. This keeps the computation down but scales well to large screens because the constant movement and color shifts keep you from seeing individual pixels. A sine table is generated for the effect:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; CreateSineTable()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; i = 0; i &amp;lt; 512; i++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; rad = (i * 0.703125) * 0.0174532;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.sine[i] = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Math&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Sin(rad) * 1024);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;As well as a color palette:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; CreatePalette()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; i = 0; i &amp;lt; 64; ++i)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; r = i &amp;lt;&amp;lt; 2;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; g = 255 - ((i &amp;lt;&amp;lt; 2) + 1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.palette[i] = Color.FromArgb(255, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)r, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)g, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g = (i &amp;lt;&amp;lt; 2) + 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.palette[i + 64] = Color.FromArgb(255, 255, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)g, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; r = 255 - ((i &amp;lt;&amp;lt; 2) + 1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g = 255 - ((i &amp;lt;&amp;lt; 2) + 1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.palette[i + 128] = Color.FromArgb(255, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)r, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;)g, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; g = (i &amp;lt;&amp;lt; 2) + 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.palette[i + 192] = Color.FromArgb(255, 0, (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;byte&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)g, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Then some math is applied to generate the effect (I’ll let you inspect the code for that, it’s fairly common although in the old days, optimizing it to run on slow processors was where a lot of the magic happened). One the buffer is set, it is rendered into a &lt;font face="Consolas"&gt;WriteableBitmap&lt;/font&gt; and set as the source of the &lt;font face="Consolas"&gt;Image&lt;/font&gt;:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; image = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;WriteableBitmap&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;(ScreenWidth, ScreenHeight);&lt;br&gt; &lt;/font&gt;&lt;br&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;using&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; stream = image.PixelBuffer.AsStream())&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Seek(0, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SeekOrigin&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Begin);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Write(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.pixelBuffer, 0, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;.pixelBuffer.Length);&lt;br&gt;}&lt;br&gt; &lt;br&gt;image.Invalidate();&lt;/font&gt;&lt;br&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.plasmaImage = image;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Now there is a plasma effect “control” and a cube control available to drop on the canvas. If I had more hours in the day, I’d optimize this by updating the plasma field in a background thread so the UI thread would simply perform the buffer operation. There may be opportunity to use the parallel features of the TPL as well – just haven’t had time to dig into that. The effect works well as coded even if it does take up a few cycles. The main page simply overlays the cube on the plasma background and then uses a &lt;font face="Consolas"&gt;Viewbox&lt;/font&gt; to stretch the effects to fill the full screen:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Background&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;="{&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;StaticResource&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; ApplicationPageBackgroundThemeBrush&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;}&lt;/span&gt;&lt;span style="color: "&gt;"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;local&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Plasma&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; HorizontalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; VerticalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Viewbox&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; HorizontalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; VerticalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Margin&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"50"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;local&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Cube&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Viewbox&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;br&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;It was a fun little side project. You can &lt;a href="http://sites.google.com/site/jeremyliknessextras/source-code/QubeWindows8Source.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;download the full source here&lt;/a&gt; or &lt;a href="http://sites.google.com/site/jeremyliknessextras/source-code/QubeSideloadWindows8.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;sideload with the package here&lt;/a&gt;.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=R2xUX1EkZYM:Kfpj-TR624Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=R2xUX1EkZYM:Kfpj-TR624Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R2xUX1EkZYM:Kfpj-TR624Y:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/R2xUX1EkZYM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/6270317079267996684/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/12/going-old-school-on-windows-8.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6270317079267996684?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6270317079267996684?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/R2xUX1EkZYM/going-old-school-on-windows-8.html" title="Going Old School on Windows 8" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-Z60h2Ewukq0/UMHxJ9cKrEI/AAAAAAAAAzI/oobTT_jB6tY/s72-c/SplashScreen_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>4</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/12/going-old-school-on-windows-8.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE4HRn46eip7ImA9WhNXEE8.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-2992229490266462820</id><published>2012-11-27T09:35:00.001-05:00</published><updated>2012-11-27T09:35:37.012-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-27T09:35:37.012-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><title>Dogfooding Windows 8: I Tell All</title><content type="html">&lt;p&gt;The other day I read an article about Windows 8 and “&lt;a href="http://www.zdnet.com/dogfooding-windows-8-six-long-term-windows-8-users-tell-all-7000007850/" target="_blank"&gt;six long-term Windows 8 users tell all&lt;/a&gt;.” The premise? Several columnists over at &lt;a href="http://www.zdnet.com/" target="_blank"&gt;ZDNet&lt;/a&gt; had been using Windows 8 for quite some time, and were interviewed about the experience. You can read about the results in the original article. I am also a writer. In addition, I sling code and manage software projects. I’ve also been “dogfooding” Windows 8 since I could first get my hands on it, so I thought it might be interesting to compare my own experience. &lt;/p&gt; &lt;p&gt;The first part of the article summarized the questions at a high level. If you want to use that chart to compare to my answers, I have them here in bullet form:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;How much have you used Windows 8?&lt;/strong&gt; 14 months.  &lt;li&gt;&lt;strong&gt;Use Metro vs. Desktop? &lt;/strong&gt;Both.  &lt;li&gt;&lt;strong&gt;Using Modern UI apps? &lt;/strong&gt;Internet Explorer, People, Calendar, Weather, Skype, TweetRo, Bing, Google Search, Netflix, iHeartRadio, Bank of America, Kayak, Nextgen Reader, Music, Video, Flow Free, Pew Pew, Mahjong Deluxe, Card Games Chest, NASA Be a Martian, Dictionary.com, Lync, //BUILD  &lt;li&gt;&lt;strong&gt;Miss or replaced the classic Start menu? &lt;/strong&gt;Don’t miss it a bit.  &lt;li&gt;&lt;strong&gt;Tweaked Windows 8?&lt;/strong&gt; Not really.  &lt;li&gt;&lt;strong&gt;Using touch hardware? &lt;/strong&gt;Yes and no (used it both laptop without touch, and slate with)  &lt;li&gt;&lt;strong&gt;Which OS to install on a new machine? &lt;/strong&gt;Windows 8.  &lt;li&gt;&lt;strong&gt;Prefer Win7 or Win8? &lt;/strong&gt;Windows 8.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;While the questions didn’t ask specifically about desktop, it’s important to make this note: I wrote the first five chapters of my book &lt;a href="http://bit.ly/win8design" target="_blank"&gt;Building Windows 8 Apps with C# and XAML&lt;/a&gt; on a Samsung Series 7 Slate (then switched to a laptop when I finally upgraded that from Windows 7). I also used it to develop the &lt;a href="http://windows8applications.codeplex.com/" target="_blank"&gt;sample applications&lt;/a&gt; for the book. In addition, I use the slate to carry around the house and as you can see, am quite a “power user” of the Windows Store apps, so I believe I can speak from hands-on experience. I am also very aware I am a developer, so my view/opinion and approach will &lt;em&gt;not &lt;/em&gt;translate well to an “average consumer.”&lt;/p&gt; &lt;p&gt;Here is the detailed list of questions and my answers:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #1: How long have you been using Windows 8 (and previews) for day-to-day desktop use?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I pitched my Windows 8 book right as //BUILD happened in September 2011. I downloaded the Developer Preview the night it was released, then used my slate as the means to develop applications and write the first several chapters. Once the Consumer Preview came out, I switched to a dual boot on my main laptop and finally upgraded wholesale to Windows 8 when it went RTM.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #2: Do you use the Metro [sic] tile interface, or live completely in the desktop?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I live and switch easily between both. On my laptop, I’m mostly in the desktop interface, with a twist. I use the Skype app to make phone calls. I have an interesting set-up because I use a Kinect sensor for my audio. The audio array is phenomenal and most people tell me I sound like I’m on a headset even though I’m using the sensor “hands free.” When I dial the call, I move Skype into snapped mode. This allows me to have two screens for my desktop (one full screen and most of the second) with a small strip to monitor my call, mute when necessary, or respond to messages. &lt;/p&gt; &lt;p&gt;At the same time, my tablet is always next to me as a “third screen.” I often use the TweetRo app to display the “signal” group I’ve made (a filter for people who don’t add a lot of noise to their timeline). It will auto-refresh so I can always stay up to date on the stock-ticker that is social networking while I’m working. On the slate, I’m almost always in the Modern UI interface and that’s as it should be (do you see what I did there, fixing the terminology in the answer?) I still fallback to desktop mode for the Office suite of tools and for occasional development.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #3: Are you using relying [sic] on any Modern UI apps for day-to-day use? Which ones?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;That would be an empathetic, “yes.” I use Internet Explorer and the Calendar quite a bit, as well as Skype and Lync. I use Skype to make most of my calls and Lync is what our company uses for group meetings and screen sharing. I use the Modern UI for both. What you might find more interesting is how I keep up to date with news. I have a ton of feeds and alerts set up in Google Reader. I love the &lt;a href="http://www.wpcentral.com/tags/nextgen-reader" target="_blank"&gt;Nextgen Reader app&lt;/a&gt; for browsing and reading news stories. When I’m in “reading mode” though I’m not necessarily into tweeting mode, so I have a simple system for synchronizing between my slate and laptop. On the slate, I browse the stories in the reader and if I’m interested in exploring further or want to share the item, I’ll star it. On the laptop, I can use the web interface to pull starred items and use that view to compose my tweets.&lt;/p&gt; &lt;p&gt;The Bank of America app keeps me from having to drive to an ATM or local bank. When I have a check to deposit, I go into the app, take a picture of the front and back of the check, and there it is – deposited. When the girls are watching a show I’m not interested in on the big TV, a set of headphones and my slate lets me watch my own Netflix movies without disturbing them. The games are great for killing time in the airport, and the radio and music apps I use whenever I’m hanging out on the deck or just relaxing and want some music. Yes, I’m a power user of the Windows Store apps.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #4: Do you miss the Start menu or have you replaced it?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;No, I don’t miss it. About the only thing I ever used it for was the search feature, and that hasn’t gone anywhere. I never liked having to find a folder and drill down and click on something to open an app. I far prefer tapping the Windows Key, starting to type part of a program name, then hitting the Enter key and launching it. I can get to any app lightning fast. Are there icons it would be easier to click on? Sure. For those, I pin them to the taskbar. I have a big monitor, so my taskbar has lots of icons. Honestly I think if I used more than I have space for, I’d have bigger issues than worrying about where the start menu went. If you’re curious, here’s my taskbar-pinned apps that I can launch with a tap or click:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Internet Explorer  &lt;li&gt;File Explorer  &lt;li&gt;Visual Studio 2012  &lt;li&gt;Blend 2012  &lt;li&gt;Developer Command Prompt  &lt;li&gt;Google Reader (web link)  &lt;li&gt;FireFox  &lt;li&gt;Chrome  &lt;li&gt;Fiddler  &lt;li&gt;GMail (web link)  &lt;li&gt;Hyper-V MMC Snap-in (for those customers I have to run Windows 7 for)  &lt;li&gt;Office 365 Web Link  &lt;li&gt;LinqPad  &lt;li&gt;IETester (for those customers I need to test IE7+)  &lt;li&gt;Balsamiq  &lt;li&gt;Outlook  &lt;li&gt;Lync  &lt;li&gt;LiveWriter (for writing what you’re reading right now) &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;strong&gt;Question #5: How have you tweaked your environment for day-to-day productive use of Windows 8 (add-ons, settings, etc.)? &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I really haven’t done much tweaking at all. I make sure I have roaming enabled, so it’s always fun when I install Windows 8 on a new machine, log in, and suddenly see a Commodore 64 BASIC prompt waiting for me (that’s my lock screen of choice, and it confuses enough people I don’t see myself changing it any time soon). The only other tweak has really just been pinning some items to the taskbar for ease of launching from the desktop interface, and I constantly rearrange tiles based on which ones are live and static, what their functionality is and how often I use them.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #6: Have you added any touch hardware (like a touch mouse or trackpad)? Do you find that improves productivity or just simply makes Windows 8 usable?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I haven’t added any touch hardware other than what comes “as is.” Before Windows 8, I did quite a bit of slate development so one of my two monitors is touch-enabled. Sometimes it’s fun to use touch (for example, when I run the Windows Store Skype app and it shows me that big Modern UI dial pad, I just have to use it instead of the numeric keypad on my keyboard) but otherwise I use what I’ve got. My biggest secret has been learning all of the &lt;a href="http://windows.microsoft.com/en-US/windows-8/new-keyboard-shortcuts#1TC=t1" target="_blank"&gt;Windows 8 shortcut keys&lt;/a&gt; that make it easy to open the Charms bar, search, swap primary monitors, etc. on the laptop, then using all of the touch gestures on my slate.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Question #7: So you’re going to go out and buy your new, hot primary work machine. Would you put Windows 7 or Windows 8 on it, and why? &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;Hands down Windows 8. No doubt in my mind. There are a million enhancements to the desktop that I just can’t live without now. On top of faster boot, stable sleep and resume, native mounting of ISO and VHD images, USB 3.0 support, etc., I actually do enjoy the Modern UI and the apps that run on it. I don’t want you to think it’s all wonderful. There are certainly some nasty quirks like clicking a mail link in Outlook only to have it pop open the Windows Store Mail app, but those are few and far between for me. In the case of customers who don’t support Windows 8 (mostly from a security perspective, so the VPN access policy for example might reject a connection from a Windows 8 host) I use the built-in Hyper-V and run a Windows 7 image. It works great. I’m talking a huge enterprise web solution with dozens of projects and I work, compile, build, deploy and test without any problems on the VM. Better yet, the newer machines are optimized for Windows 8 and come with SSD drives. Windows 8 + SSD = killer productivity combo.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Last question [or question #8]: do you prefer Windows 7 or Windows 8?&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;What do you think? Windows 8. I get everything I had in Windows 7 (I’ve read some of the amusing articles saying it should be called “Window” because the Windows don’t overlap, and that’s simply not true – I get full overlapped, multi-tasking goodness on the desktop) plus the new features of Windows 8. Look, my favorite &lt;a href="http://www.ccs64.com/" target="_blank"&gt;Commodore 64 emulator&lt;/a&gt; runs fine on Windows 8, so why would I ever go back?&lt;/p&gt; &lt;p&gt;That’s it. I started eating the Windows 8 dog food a long time ago and am enjoying every bite.&lt;/p&gt; &lt;p&gt;Thanks to &lt;a href="http://www.zdnet.com/meet-the-team/us/david.gewirtz/" target="_blank"&gt;David Gewirtz&lt;/a&gt; for the original article that inspired this post.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=M6PNbmlDAqs:-JzgSLekrAw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=M6PNbmlDAqs:-JzgSLekrAw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=M6PNbmlDAqs:-JzgSLekrAw:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/M6PNbmlDAqs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/2992229490266462820/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/11/dogfooding-windows-8-i-tell-all.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2992229490266462820?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2992229490266462820?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/M6PNbmlDAqs/dogfooding-windows-8-i-tell-all.html" title="Dogfooding Windows 8: I Tell All" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/11/dogfooding-windows-8-i-tell-all.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0QCSHg9eSp7ImA9WhNQGUk.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-3931386329263766851</id><published>2012-11-26T09:49:00.001-05:00</published><updated>2012-11-26T09:49:29.661-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-26T09:49:29.661-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="silverlight" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="xaml" /><category scheme="http://www.blogger.com/atom/ns#" term="Koch" /><category scheme="http://www.blogger.com/atom/ns#" term="path" /><title>Koch Snowflakes on Windows 8 with XAML</title><content type="html">&lt;p&gt;A few years back I wrote a little program that would &lt;a href="http://csharperimage.jeremylikness.com/2009/12/fractal-koch-snowflakes-in-silverlight.html" target="_blank"&gt;generate Koch snowflakes in Silverlight&lt;/a&gt;. After brisk walk in the cold weather today, I decided it was time to port it over to Windows 8, more just to see how easy it would be. It turns out it only took about 5 minutes to have the program up and running. I made a few tweaks, and it works. I spent some more time just changing how the snowflakes are updated. It is definitely far from perfect (there is an occasional unhandled exception I haven’t debugged and it pegs the CPU) but it’s still a fun little project to run and see.&lt;/p&gt; &lt;p&gt;The Koch curve is simple. You start with a line segment, break it into thirds, and extend the middle third into a triangle. You then repeat the process with the outer line segments recursively. This image depicts the process:&lt;/p&gt; &lt;p&gt;&lt;img src="http://gallery.jeremylikness.com/main.php?g2_view=core.DownloadItem&amp;amp;g2_itemId=147&amp;amp;g2_serialNumber=1"&gt;&lt;/p&gt; &lt;p&gt;Working backwards, the implementation for the Windows Store app starts with a helper method that takes a set of points and turns them into a path so we can render the snowflake on the XAML surface:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Path&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; CreatePath(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;IReadOnlyList&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt; points)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; segments = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;PathSegmentCollection&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;foreach&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; point &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;in&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; points.Skip(1))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; segments.Add(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;LineSegment&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point = point&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; pathGeometry = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;PathGeometry&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// pull the segments into the geometry&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; pathGeometry.Figures.Add(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;PathFigure&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IsClosed = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; StartPoint = points[0],&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Segments = segments&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Path&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; { Data = pathGeometry };&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;The points turn into segments then are collapsed into a closed path. Next, two points need to be split into thirds with a triangle in the middle. The following method does that. It turns 2 points into 5, so the first and last are returned “as is” while the middle triangle is produced using some trigonometry and randomness:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt; RefactorPoints(Point a, Point b)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// first point&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;yield&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; a;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; dX = b.X - a.X;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; dY = b.Y - a.Y;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// 1/3 of the way from first point to second point&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;yield&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Point(a.X + (dX / 3.0), a.Y + (dY / 3.0));&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; factor = Random.NextDouble() - 0.5;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; vX = ((a.X + b.X) / (2.0 + factor)) + ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Math&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Sqrt(3.0 + factor) * (b.Y - a.Y)) / (6.0 + (factor * 2.0)));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; vY = ((a.Y + b.Y) / (2.0 + factor)) + ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Math&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Sqrt(3.0 + factor) * (a.X - b.X)) / (6.0 + (factor * 2.0)));&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// apex of the middle triangle&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;yield&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Point(vX, vY);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// 1/3 of the way from the second point to the first point&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;yield&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; Point(b.X - (dX / 3.0), b.Y - (dY / 3.0));&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// second point&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;yield&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; b;&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Now we know how to break down a side. This is done recursively for several levels and the points are aggregated back:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;IEnumerable&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt; RecurseSide(Point a, Point b, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;int&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; level)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// iterations are done, so return this line segment&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (level == 0)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt; { a, b };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// first we need to build a list of points that make the refactoring of the side&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; newPoints = RefactorPoints(a, b).ToList();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// this breaks down the segment into 5 points&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; aggregatePoints = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt;();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; x = 0; x &amp;lt; newPoints.Count; x++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; y = x + 1 == newPoints.Count ? 0 : x + 1;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggregatePoints.AddRange(RecurseSide(newPoints[x], newPoints[y], level - 1));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; aggregatePoints;&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Now the whole process is kicked off by a triangle – not a perfect triangle and the midpoint is randomized a bit, but enough to get the process started to generate a snowflake. As I noted in my post a few years back, you could probably eliminate the second and third calls for recursion and simply reflect a single side:&lt;/p&gt;&lt;pre style="font-family: ; background: white; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Path&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Create()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// something to start with&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; a = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Point(0, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; b = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Point((Random.NextDouble() * 70.0) + 15.0, 0);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; c = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Point(0, b.X);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// now we refactor as many times as needed&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; levels = Random.Next(Min, Max);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// first set of points (first triangle)&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; points = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;List&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;lt;Point&amp;gt;();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; points.AddRange(RecurseSide(a, b, levels));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; points.AddRange(RecurseSide(b, c, levels));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; points.AddRange(RecurseSide(c, a, levels));&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// walk the sides and iterate them&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; retVal = CreatePath(points);&lt;br&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#000000" face="Consolas"&gt;}&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;The original example had colorful snowflakes. This time I’m going for a more black and white effect, so I generate a random gradient based on some shades of gray with a random transparency value.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-2tf-sNOOUKU/ULOBdU4ErEI/AAAAAAAAAyo/a2I3F3foh0M/s1600-h/kochsnowflakes3.png"&gt;&lt;img title="kochsnowflakes" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="kochsnowflakes" src="http://lh4.ggpht.com/-O4z7xfnBWi0/ULOBdx_FDJI/AAAAAAAAAyw/PUN06D4CdWQ/kochsnowflakes_thumb1.png?imgmax=800" width="676" height="550"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I then wrap the snowflake entity in a class that knows how to insert itself into a canvas (a delegate is passed in so it doesn’t have to take a hard reference on the canvas):&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; SnowFlakeEntity(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Action&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;lt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Path&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;gt; insert, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;bool&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; fromTop)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeFactory&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Create();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity = Random.NextDouble();&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// set velocity, initial x and y&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.velocity = (Random.NextDouble() * 10.0) + 1.0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x = Random.NextDouble() * Left;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.y = fromTop ? -100.0 : Random.NextDouble() * Top;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// set it&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.SetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LeftProperty, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.SetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.TopProperty, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.y);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// place onto surface&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; insert(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.snowflake);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// remember parent&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.surface = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.Parent &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.NextTick = DateTime.Now.Add(Interval);&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;It is set up with an initial position and velocity, as well as an interval to update it. If I wasn’t randomizing the motion, I could get away with a storyboard (and potentially have much better performance and less CPU utilization) but the motions are randomized to appear more “organic” as you can see in the following method. The &lt;em&gt;affinity&lt;/em&gt; affects the drift direction and the rate of spinning/twisting. The snowflake falls and drifts, and when it is “out of bounds” is removed from the canvas so a new flake can be born:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;public&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Frame()&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// fall&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.y = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.y + &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.velocity + (3.0 * Random.NextDouble()) - 1.0;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// is it offscreen?&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.y &amp;gt; Gone)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.surface.Children.Remove(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.snowflake);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// notify the outside world that things changed&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; handler = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.SnowflakeDied;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (handler != &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; handler(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EventArgs&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Empty);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;else&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// nudge it&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; factor = 10.0 * &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity &amp;lt; 0.45)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; factor *= -1.0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.x = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x + (Random.NextDouble() * factor);&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// left edge&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x &amp;lt; 0)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x = 0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.affinity = 1.0 - &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// right edge&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x &amp;gt; Left)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x = Left;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.affinity = 1.0 - &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.SetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.LeftProperty, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.x);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.SetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.TopProperty, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.y);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// spin&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; rotate = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RotateTransform&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.GetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;UIElement&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.RenderTransformProperty);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotate.Angle += Random.NextDouble() * 4.0 * &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.affinity;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// rotate&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; plane = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;PlaneProjection&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;)&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.snowflake.GetValue(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;UIElement&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.ProjectionProperty);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; rotateFactor = 6.0 * &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;.affinity;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; plane.RotationX += Random.NextDouble() * rotateFactor;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; plane.RotationY += Random.NextDouble() * rotateFactor;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; plane.RotationZ += Random.NextDouble() * rotateFactor;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.NextTick = DateTime.Now.Add(Interval);&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;This is all managed by a behavior that attaches to the canvas. The behavior can update the size when the canvas changes, so the snowflakes fall within the confines of the surface regardless of the orientation or if the app is snapped (when you snap it, you just get a greater density of snowflakes). You can see the adjustment happening when you unsnap as snowflakes fall off the bottom and begin to appear in the additional space provided by the unsnapped view. &lt;/p&gt;
&lt;p&gt;The older implementation used a set of dispatcher timers unique to each snowflake to update them. This felt a little unwieldy for a store app so I centralized it to a single task. If the application is suspended the task simply freezes and resumes when restarted, and if the app is terminated, so is the task and the entire thing can simply start over again when the user returns. I don’t like infinite loops so I could probably set a variable that is updated on suspension, but this gets the job done for now:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;async&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; ThinkLoop(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;CoreDispatcher&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; dispatcher)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;while&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; now = DateTime.Now;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; snowFlake = Snowflakes.FirstOrDefault(s =&amp;gt; s.NextTick &amp;lt;= now);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;while&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (snowFlake != &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; flake = snowFlake;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;await&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; dispatcher.RunAsync(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;CoreDispatcherPriority&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Normal, flake.Frame);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; now = DateTime.Now;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; snowFlake = Snowflakes.FirstOrDefault(s =&amp;gt; s.NextTick &amp;lt;= now);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;await&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Task&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;.Delay(1);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Notice the task simply loops and finds the next flake that is eligible to update, then dispatches the update to the UI thread. The await is important to avoid clogging the thread (if I were to simply spam the dispatcher with tons of requests, the dispatcher would hit its quote and the app would get terminated). The delay is also fairly arbitrary but keeps the loop from spinning non-stop and instead adds a little bit of a break.&lt;/p&gt;
&lt;p&gt;The behavior attaches to the canvas loaded event (and the resized to notify the snowflakes where they are allowed to drift) and kicks off the task, like this (notice the delegate being passed to attach the snowflake to the canvas): &lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; CanvasLoaded(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;RoutedEventArgs&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; canvas = sender &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (canvas == &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Left = canvas.ActualWidth;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Top = canvas.ActualHeight + 50.0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.Gone = canvas.ActualHeight;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; index = 0; index &amp;lt; Snowflakes.Capacity; index++)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; snowflake = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;(o =&amp;gt; canvas.Children.Add(o));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; snowflake.SnowflakeDied += SnowflakeSnowflakeDied;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Snowflakes.Add(snowflake);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;Task&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;.Run(() =&amp;gt; ThinkLoop(canvas.Dispatcher));&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;When a snowflake “dies” it is removed from the collection that the behavior is tracking as well as the canvas surface:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;private&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;static&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; SnowflakeSnowflakeDied(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;object&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; sender, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;EventArgs&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; e)&lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; snowflake = sender &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;as&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#008000"&gt;// get the surface so we can add the next snowflake to the same surface&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (snowflake == &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;null&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; canvas = snowflake.Surface;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Snowflakes.Remove(snowflake);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; newFlake = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#2b91af"&gt;SnowFlakeEntity&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(o =&amp;gt; canvas.Children.Add(o), &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;true&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; newFlake.SnowflakeDied += SnowflakeSnowflakeDied;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Snowflakes.Add(newFlake);&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;The XAML uses the behavior to kick everything off. A light gradient helps the flakes show up with more contrast. There is also an event that fires when the size of the canvas changes to update the bounds of the clip. The clip ensures snowflakes don’t appear outside of the row designated for snowflake activity.&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Background&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;="{&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;StaticResource&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; ApplicationPageBackgroundThemeBrush&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;}&lt;/span&gt;&lt;span style="color: "&gt;"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid.RowDefinitions&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RowDefinition&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Height&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Auto"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RowDefinition&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RowDefinition&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Height&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"*"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RowDefinition&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid.RowDefinitions&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;TextBlock&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Text&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Koch Snowflakes"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Style&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;="{&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;StaticResource&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; HeaderTextStyle&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;}&lt;/span&gt;&lt;span style="color: "&gt;"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Margin&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"12"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;TextBlock&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Grid.Row&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"1"&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; HorizontalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; VerticalAlignment&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Stretch"&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; SizeChanged&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"FrameworkElement_OnSizeChanged"&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; local&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;SnowFlakeBehavior.AttachSnowFlake&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"True"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas.Background&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;LinearGradientBrush&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStopCollection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStop&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Color&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Black"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Offset&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStop&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStop&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Color&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"#888888"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Offset&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"1.0"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStop&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;GradientStopCollection&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;LinearGradientBrush&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas.Background&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas.Clip&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;RectangleGeometry&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; x&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;:&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;Name&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"CanvasClipper"&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt; Rect&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"0,0,9999,9999"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas.Clip&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Canvas&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;Grid&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;That’s it. You can download the &lt;a href="http://sites.google.com/site/jeremyliknessextras/source-code/KochSnowflakesWin8.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;full source here&lt;/a&gt;. Don’t have Visual Studio or don’t care to compile it? You can side load it with the &lt;a href="http://sites.google.com/site/jeremyliknessextras/source-code/KochSnowflakeExecutableWin8.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;app package here&lt;/a&gt;. I’m sure I could create a much better experience using Direct2D but this was literally an attempt to port an existing app. I was very pleasantly surprised to find so little had to be changed from my Silverlight implementation. Enjoy the snowflakes!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=96QmnO4i3hk:HWDVKZi9WYk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=96QmnO4i3hk:HWDVKZi9WYk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=96QmnO4i3hk:HWDVKZi9WYk:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/96QmnO4i3hk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/3931386329263766851/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/11/koch-snowflakes-on-windows-8-with-xaml.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3931386329263766851?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3931386329263766851?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/96QmnO4i3hk/koch-snowflakes-on-windows-8-with-xaml.html" title="Koch Snowflakes on Windows 8 with XAML" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-O4z7xfnBWi0/ULOBdx_FDJI/AAAAAAAAAyw/PUN06D4CdWQ/s72-c/kochsnowflakes_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>1</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/11/koch-snowflakes-on-windows-8-with-xaml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEQFQXczcCp7ImA9WhNQE04.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-5373057882572581893</id><published>2012-11-19T08:38:00.001-05:00</published><updated>2012-11-19T08:38:30.988-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-19T08:38:30.988-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="events" /><category scheme="http://www.blogger.com/atom/ns#" term="event aggregator" /><category scheme="http://www.blogger.com/atom/ns#" term="typescript" /><title>Building a JavaScript Event Aggregator using TypeScript</title><content type="html">&lt;p&gt;The event aggregator is a useful mechanism for decoupling notifications. Typically, notifications happen through events. In JavaScript, an event is a notification that happens as the result of an action. You can think of it as a notification that is triggered by something. We call the triggering of the event “raising” the event. Events are a simple notification mechanism that contain a collection of handlers. A handler is really just a function that is called when the event is raised. The event may pass some information to the handler, and your function must react to the event. &lt;/p&gt; &lt;p&gt;Perhaps the most popular event in JavaScript is the “click” event. Events can be wired directly in HTML markup, like this: &lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;&amp;lt;a id="homeLink" href="#home" onclick="alert('Go Home!')"&amp;gt;Go Home&amp;lt;/a&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;A more sophisticated way to provide a handler is to do something like this: &lt;/p&gt; &lt;p&gt;&lt;font face="Consolas"&gt;var homeLink = document.getElementById('homeLink');&lt;br&gt;homeLink.onclick = function(e) {&lt;br&gt;&amp;nbsp;&amp;nbsp; alert('Go Home!');&lt;br&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here, the handler is assigned to the onclick function that is raised when the link is clicked.&lt;/p&gt; &lt;p&gt;Events are the core of interacting with HTML DOM. Many JavaScript frameworks provide a mechanism for you to extend JavaScript objects to participate in the event model as well. For example, using &lt;a href="http://backbonejs.org/#Events" target="_blank"&gt;Backbone’s events&lt;/a&gt; you can register to an event that is triggered by a business object, and raise the event from the business object. This allows you to have events that are not tied to specific user actions in the DOM.&lt;/p&gt; &lt;p&gt;The event model makes sense for most cases. One complaint about this model is that it does force coupling. To register for an event, you must have a reference to the object or DOM element that triggers the event. You provide your handler directly to the source of the event. This is appropriate in most cases, because coupling isn’t always a bad thing. A common example of this is entering search criteria for a grid and pressing the search button.&lt;/p&gt; &lt;p&gt;The search criteria is often bound to a view model that contains properties for the search criteria. The search event will fire, and this will trigger a call to a service that passes the criteria and returns the results for the grid. While these actions should be decoupled to an extent (i.e. the view model will remain free of view-specific code to keep it testable and maintainable, and the service call is probably implemented in a separate function), it makes sense for the view model to be aware of the service because there is a direct action/reaction taking place – the action is to request the list of results and the reaction is to receive the list. Decoupling these (for example, simply sending a message that states, “I want data” and then having a completely separate mechanism to listen for the message “I have data”) can make the code confusing to follow, hard to troubleshoot and difficult to maintain.&lt;/p&gt; &lt;p&gt;There are a few scenarios such as cross-module communication and extensibility that make more sense from a highly decoupled perspective. For cross-module communication, for example, you may want to use an event aggregator. One module may focus on the process of searching for items and adding them to a shopping cart, while another module handles tracking the shopping cart. You may eventually add a third module and extend the application by providing a shipping estimation calculator that responds with a new total whenever items are added to the cart. In these cases, you can decouple the modules by sending a generic message that an item is selected, then build the other modules to receive that message and act on it.&lt;/p&gt; &lt;p&gt;To facilitate this, you can use the publisher/subscriber model as implemented by the &lt;em&gt;event aggregator&lt;/em&gt;. The concept of an event aggregator is simple: you have a “broker” that manages notifications. All modules know about the broker, but not about each other, and publish messages to the broker. The broker maintains a list of subscriptions (modules “subscribe” to messages) and notifies the subscribers when a message is listed.&lt;/p&gt; &lt;p&gt;This pattern is a perfect example of how &lt;a href="http://www.typescriptlang.org/" target="_blank"&gt;TypeScript&lt;/a&gt; can be used to build a facility without compromising the flexibility of the JavaScript language. TypeScript is a superset of JavaScript, so all valid JavaScript is also valid TypeScript code. Instead of trying to replace the language or force typing, TypeScript allows you to define contracts and types where they make sense and are expected, but retain full control over the power of the dynamic and function-oriented aspects of JavaScript.&lt;/p&gt; &lt;p&gt;I decided to start by developing an MVVM module I’ll call &lt;em&gt;Gom&lt;/em&gt; because it’s the glue that we can use on the client to hold things together. I’m exploring this solely as a learning exercise as there are plenty of fantastic frameworks like &lt;a href="http://knockoutjs.com/" target="_blank"&gt;KnockoutJS&lt;/a&gt;, &lt;a href="http://angularjs.org/" target="_blank"&gt;AngularJS&lt;/a&gt;, and the framework built into &lt;a href="http://www.kendoui.com/" target="_blank"&gt;Kendo UI&lt;/a&gt; that handle data-binding and enterprise concerns. In TypeScript, a module is like a namespace and can be simply defined like this:&lt;/p&gt;&lt;pre style="background: white; margin: 0in 0in 0pt; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 10pt"&gt;module&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;span style="font-family: ; color: "&gt;&lt;font style="font-size: 10pt" color="#000000"&gt; Gom {&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;&lt;pre style="background: white; margin: 0in 0in 0pt; line-height: normal"&gt;&lt;span style="font-family: ; color: "&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 10pt" color="#000000"&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;That’s it – now I can start defining classes and methods that are specific to my module. The first thing I want to keep track of is subscriptions. A subscription is simply a callback – it’s a function that should be called when a notification is sent (or an event is raised). In this model, I’ll give the subscription an identifier as well so the listener can unsubscribe if it is no longer interested in the notification:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Subscription {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;constructor&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; id: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;, &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; callback: (payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) =&amp;gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Note the signature for a function can be declared using a lambda-style expression, showing the parameters that are expected and the return type. The implementation of the class in JavaScript is a self-invoking function scoped to the Gom module:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; Subscription = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Subscription(id, callback) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.id = id;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;.callback = callback;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Subscription;&lt;br&gt;})();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;What’s nice is that I don’t have to worry about things like creating a constructor or wrapping the function – TypeScript does that for me. Next, I’ll create an interface for a message. Think of a message as a “channel.” I can send a type of message (giving it a name), and I’ll keep track of all subscriptions for that message. It is assumed that both publishers and subscribers understand how to deal with the content of messages that have the same name. In TypeScript, interfaces have no actual JavaScript implementation. They simply provide compile-time checks, design-time auto-completion and help keep your code clean and make it easier to build and maintain.&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff" face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;interface&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; IMessage {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subscribe(callback: (payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) =&amp;gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;): &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unSubscribe(id: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;): &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; notify(payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;): &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;;&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;The subscription takes a callback which has the signature of expecting any type of object (optional) and returning nothing (this is the function the listener will implement) and returns a number (the token for the subscription so it can be unsubscribed). The unsubscribe function takes the identifier, and the notify function takes an optional payload.&lt;/p&gt;
&lt;p&gt;We can now implement the interface:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;class&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; Message &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;implements&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; IMessage {&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; _subscriptions: Subscription[];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; _nextId: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;constructor&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; message: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions = [];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._nextId = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;0&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; subscribe(callback: (payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) =&amp;gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; subscription = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Subscription(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._nextId++, callback);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions[subscription.id] = subscription;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; subscription.id;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; unSubscribe(id: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions[id] = undefined;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;public&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; notify(payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; index;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (index = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;0&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;; index &amp;lt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions.length; index++) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;._subscriptions[index]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._subscriptions[index].callback(payload);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Notice how the message maintains it’s own list of subscriptions. For efficiency, it keeps the subscriptions in their assigned slots and simply sets them to undefined when they are unsubscribed. A notification simply iterates through the array and sends the payload to the subscriptions. Empty slots are skipped.&lt;/p&gt;
&lt;p&gt;The implementation in JavaScript is again as self-invoking function that scopes the variables appropriately. Note the public functions are class-wide and therefore assigned to the underlying prototype for the object:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; Message = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Message(message) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;.message = message;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions = [];&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._nextId = 0;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message.prototype.subscribe = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (callback) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; subscription = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Subscription(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._nextId++, callback);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions[subscription.id] = subscription;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; subscription.id;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message.prototype.unSubscribe = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (id) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions[id] = undefined;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Message.prototype.notify = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (payload) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; index;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;for&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(index = 0; index &amp;lt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions.length; index++) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._subscriptions[index]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;._subscriptions[index].callback(payload);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; Message;&lt;br&gt;})();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;All of the classes so far have been scoped internally to the module. This means they are local to the self-invoked function that defines the module, but not available externally. You can’t directly create a Message instance. Instead, I expose an EventManager class. This is &lt;em&gt;exported&lt;/em&gt; in TypeScript so it can be referenced externally from the module. The event manager handles a list of messages and exposes the various operations:&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;export&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;class&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; EventManager {&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;private&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; _messages: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;;&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;constructor&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages = {};&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; subscribe(message: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, callback: (payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;) =&amp;gt; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;void&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; ) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; msg: IMessage;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message] ||&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;IMessage&amp;gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._messages[message] = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Message(message));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; msg.subscribe(callback);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; unSubscribe(message: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, token: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;number&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;lt;IMessage&amp;gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message])).unSubscribe(token);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; publish(message: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;string&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, payload?: &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;any&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;._messages[message]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&amp;lt;IMessage&amp;gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._messages[message])).notify(payload);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Now you can see some more powerful TypeScript features at work. The subscriptions simply exist as properties on the main _messages object. When a subscription comes in, the existence of the Message instance for that subscription is checked, otherwise it is created. The &lt;font face="Consolas"&gt;&amp;lt;IMessage&amp;gt;&lt;/font&gt; casts the result so you can use auto-complete (type msg and hit the period and you’ll see the list of available methods). This example passes the subscription through to the message.&lt;/p&gt;
&lt;p&gt;To unsubscribe the function first checks that the message exists, and only if it does, it passes the token down to unsubscribe. Finally, the publication checks for the existence of subscriptions (if no one subscribed, there is no one to notify) and then passes the payload through. The generated JavaScript (note the assignment to the Gom module so it is available for external consumption): &lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt; EventManager = (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; EventManager() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages = {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventManager.prototype.subscribe = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (message, callback) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; msg;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._messages[message] || (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;._messages[message] = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Message(message));&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; msg.subscribe(callback);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventManager.prototype.unSubscribe = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (message, token) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message])).unSubscribe(token);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; EventManager.prototype.publish = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; (message, payload) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;if&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;._messages[message]) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;this&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#000000"&gt;._messages[message])).notify(payload);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;return&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; EventManager;&lt;br&gt;})();&lt;br&gt;Gom.EventManager = EventManager;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Now I can demonstrate the pub/sub model through a simple page. Here is the full mark-up. The TypeScript is compiled to a corresponding JavaScript file that is referenced.&lt;/p&gt;&lt;pre style="font-family: ; background: white; color: ; line-height: normal"&gt;&lt;font face="Consolas"&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&lt;font style="font-size: 9.8pt"&gt;&amp;lt;!&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;DOCTYPE&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;html&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;html&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;xmlns&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;head&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;GOM - MVVM Glue for JavaScript&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;title&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;br&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;head&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;body&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;input&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"txtMessage"&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;""&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;input&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"button"&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"btnSubmit"&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;value&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Publish"&lt;/span&gt;&lt;span style="color: "&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;h1&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"header"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;Pub/Sub Example&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;h1&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;p&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;id&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"paragraph"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;font color="#000000"&gt;Type a message in the box and click "publish" to continue.&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;p&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;div&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;src&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"Scripts/GomEvents.js"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;&amp;nbsp;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;/span&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;=&lt;/span&gt;&lt;span style="color: "&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;/font&gt;&lt;br&gt;&lt;font color="#000000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; events = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;new&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt; Gom.EventManager();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;var&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt; token = events.subscribe(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"message"&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;(msg) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"header"&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;).innerText = msg;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;(tok) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; events.subscribe(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"message"&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;(msg) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"paragraph"&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;).innerText = msg;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; events.unSubscribe(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"message"&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;, tok);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; })(token);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; document.getElementById(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"btnSubmit"&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;).onclick = &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;function&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; events.publish(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"message"&lt;/font&gt;&lt;/span&gt;&lt;font color="#000000"&gt;, document.getElementById(&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#a31515"&gt;"txtMessage"&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#000000"&gt;).value);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;/span&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;script&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;body&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/font&gt;&lt;font face="Consolas"&gt;&lt;font style="font-size: 9.8pt"&gt;&lt;font color="#0000ff"&gt;&lt;span style="color: "&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;span style="color: "&gt;&amp;lt;/&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font color="#800000"&gt;html&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;span style="color: "&gt;&lt;font style="font-size: 9.8pt" color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/span&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;This is a very simple example but it illustrates the working event aggregator. Two subscriptions are made, one that will listen for the message called “message” and update an H1 tag, another that listens to the same message and updates the P tag. The second listener will also try to unsubscribe the first listener. The result is that the first message will update the H1 and P tags, while subsequent messages only update the P tag. Finally, a click event is wired to obtain the contents of the text box and publish the message. This is of course a contrived example to illustrate the implementation.&lt;/p&gt;
&lt;p&gt;While you would never use the event aggregator for such as simple case, let’s go back to the original scenario of a shopping cart. The payload can be any type of object. In the shopping cart example, you could serialize an item added to the cart into JSON, then publish a “cartAdded” message with that as the payload. The cart module could then receive and track that item, while the shipping estimation module receives the same payload and uses it to estimate the shipping costs.&lt;/p&gt;
&lt;p&gt;I believe TypeScript made it easier to design and build the implementation by using a class structure, while still generating clean JavaScript code. The resulting code can be consumed by any other code and doesn’t require TypeScript. More importantly, however, developers in a large enterprise project will now be able to reference the module and consume the contents with full IntelliSense, making it a lot easier to explore APIs and understand what they expect. Here’s an example of auto-completion in the IDE – note that I get a list of available functions as well as their complete signature:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://lh5.ggpht.com/-56MdftEbxOI/UKo2U6UXNNI/AAAAAAAAAyQ/VTKFwvNH9wM/s1600-h/typescriptintellisense3.png"&gt;&lt;img title="typescriptintellisense" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="typescriptintellisense" src="http://lh6.ggpht.com/-aZ79wXwecn0/UKo2VX7u0aI/AAAAAAAAAyY/MqENYA9Pdks/typescriptintellisense_thumb1.png?imgmax=800" width="555" height="169"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can download the source for this post &lt;a href="http://sites.google.com/site/jeremyliknessextras/source-code/gomeventaggregator.zip?attredirects=0&amp;amp;d=1" target="_blank"&gt;here&lt;/a&gt;. I leave you with this working example: &lt;/p&gt;
&lt;p&gt;&lt;iframe height="240" src="http://jeremylikness.com/apps/TypeScriptEventAgg/gom.html" width="640"&gt;&lt;br /&gt;&lt;a href="http://jeremylikness.com/apps/TypeScriptEventAgg/gom.html" target="_blank"&gt;Click here to view in a new window.&lt;/a&gt;&lt;/iframe&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=8Ogd2zFJwm8:pKYCdP28-Io:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=8Ogd2zFJwm8:pKYCdP28-Io:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=8Ogd2zFJwm8:pKYCdP28-Io:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/8Ogd2zFJwm8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/5373057882572581893/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/11/building-javascript-event-aggregator.html#comment-form" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5373057882572581893?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5373057882572581893?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/8Ogd2zFJwm8/building-javascript-event-aggregator.html" title="Building a JavaScript Event Aggregator using TypeScript" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-aZ79wXwecn0/UKo2VX7u0aI/AAAAAAAAAyY/MqENYA9Pdks/s72-c/typescriptintellisense_thumb1.png?imgmax=800" height="72" width="72" /><thr:total>3</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/11/building-javascript-event-aggregator.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08ER30zcSp7ImA9WhNRGE4.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-1066593639189143338</id><published>2012-11-12T06:44:00.001-05:00</published><updated>2012-11-13T13:36:46.389-05:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-11-13T13:36:46.389-05:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><title>Answering your Windows 8 Questions</title><content type="html">&lt;p&gt;I’m &lt;a href="http://lh4.ggpht.com/-U6K0uSVc09M/UKDhGa02gxI/AAAAAAAAAx4/eaOlCJ273e0/s1600-h/Win8-Twitter3.jpg"&gt;&lt;img title="Win8-Twitter" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 10px 15px 0px 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Win8-Twitter" align="left" src="http://lh6.ggpht.com/-qwgZqZqAwlM/UKDhGhfjs1I/AAAAAAAAAx8/rl-2fSyeURg/Win8-Twitter_thumb1.jpg?imgmax=800" width="375" height="383"&gt;&lt;/a&gt;extremely excited to be a part of an event this coming Tuesday, November 13th, geared towards answering your questions about Windows 8. An estimated 4 million PC users upgraded to Windows 8 during the first weekend of its release. I’m assuming several of you reading this blog were a part of that wave. While developers tend to be quite savvy when it comes to “bricking their machine” and installing fresh or updating the OS, it can be a challenge to consumers, especially if there are peripherals involved.&lt;/p&gt; &lt;p&gt;On November 13th I’ll be teaming up with the Windows team and HP for a Twitter chat to discuss Windows 8. The goal is to help users make a smooth transition to the new OS and take full advantage of its new features and benefits. The conversation will be co-moderated by &lt;a href="http://twitter.com/windowsblog" target="_blank"&gt;@WindowsBlog&lt;/a&gt; and &lt;a href="http://www.twitter.com/hpsupport" target="_blank"&gt;@HPSupport&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;The talk takes place on &lt;strong&gt;Tuesday, November 13th from 1pm – 2pm PST (4pm – 5pm EST) right after the regularly scheduled time for the popular &lt;/strong&gt;&lt;a href="https://twitter.com/search?q=%23winchat&amp;amp;src=hash" target="_blank"&gt;&lt;strong&gt;#WinChat&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;. &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;I hope you’ll be able to join me along with colleagues: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;Peter Bright &lt;a href="http://www.twitter.com/DrPizza" target="_blank"&gt;@DrPizza&lt;/a&gt;) of &lt;a href="http://arstechnica.com/" target="_blank"&gt;Arstechnica&lt;/a&gt;&lt;li&gt;Tim Fisher (&lt;a href="http://www.twitter.com/aboutpcsupport" target="_blank"&gt;@AboutPCSupport&lt;/a&gt;) of the About.com &lt;a href="http://pcsupport.about.com/" target="_blank"&gt;PC Support Guide&lt;/a&gt;  &lt;li&gt;Richard Hay (&lt;a href="http://twitter.com/winobs" target="_blank"&gt;@winobs&lt;/a&gt;) of &lt;a href="http://windowsobserver.com" target="_blank"&gt;WindowsObserver.com&lt;/a&gt;  &lt;li&gt;David Murphy &lt;a href="http://www.twitter.com/thedavidmurphy" target="_blank"&gt;(@thedavidmurphy&lt;/a&gt;) of &lt;a href="http://www.pcworld.com/" target="_blank"&gt;PC World&lt;/a&gt;  &lt;li&gt;Paul Thurrott (&lt;a href="http://www.twitter.com/thurrott" target="_blank"&gt;@thurrott&lt;/a&gt;) of &lt;a href="http://winsupersite.com/" target="_blank"&gt;WinSuperSite.com&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Please share this with friends, family, co-workers and anyone else you may know who either already upgraded to Windows 8 or is looking to make the switch. We will do our best to answer all of theirs (and your) Windows 8 related questions.&lt;/p&gt; &lt;p&gt;Thanks, and I hope to tweet you there! &lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=MOJ5j9fBZyc:m-sYkt0mH8k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=MOJ5j9fBZyc:m-sYkt0mH8k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=MOJ5j9fBZyc:m-sYkt0mH8k:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/MOJ5j9fBZyc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/1066593639189143338/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/11/answering-your-windows-8-questions.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1066593639189143338?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/1066593639189143338?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/MOJ5j9fBZyc/answering-your-windows-8-questions.html" title="Answering your Windows 8 Questions" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh6.ggpht.com/-qwgZqZqAwlM/UKDhGhfjs1I/AAAAAAAAAx8/rl-2fSyeURg/s72-c/Win8-Twitter_thumb1.jpg?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/11/answering-your-windows-8-questions.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkMHSXczfSp7ImA9WhNSFk8.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-4318910980141611619</id><published>2012-10-30T14:04:00.001-04:00</published><updated>2012-10-30T14:07:18.985-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-30T14:07:18.985-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term=".net framework 4.5" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><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="winrt" /><title>Building Windows 8 Apps with C# and XAML is Here!</title><content type="html">&lt;blockquote&gt; &lt;p&gt;&lt;em&gt;“Jeremy builds real apps for real customers. That’s why I can heartily recommend this book. Go out and write some great apps … and keep this book handy.” – &lt;/em&gt;from the forward by Jeff Prosise.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-1UH2htKzgOk/UJAWsosONBI/AAAAAAAAAxg/RFZgmAY3K_o/s1600-h/WP_000097%25255B8%25255D.jpg"&gt;&lt;img title="WP_000097" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 5px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="WP_000097" align="left" src="http://lh4.ggpht.com/-6BqybAjRLHA/UJAWtfiqFQI/AAAAAAAAAxo/CPl9epbGdJQ/WP_000097_thumb%25255B2%25255D.jpg?imgmax=800" width="184" height="244"&gt;&lt;/a&gt;When my wife stuck her head in the office and said, “Honey, there’s a UPS truck in front of the house” I knew exactly what it was. I ran downstairs and practically kicked down the door to grab my box that contained the initial copies of my latest book, &lt;a href="http://www.amazon.com/gp/product/0321822161/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321822161&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Building Windows Apps with C# and XAML&lt;/a&gt;.This is my third full-length book and it is still amazing to see the final result. I pitched the project back in October of 2011 on the heels of the first //BUILD conference. I started with the idea of pushing out a comprehensive reference manual but quickly realized that project would take way too long to deliver in time for the official release of Windows 8. Therefore, I decided instead to focus on the core story necessary to go from an idea to a complete app successfully accepted in the Windows Store. I’m happy I did because I was able to cover all of the key areas in what I believe is an easy to read narrative that gives you everything you need to get started, while connecting to other resources and references to “go deeper” when and where needed.&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;If you’re curious about just what is covered, here is the detailed table of contents:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;The New Windows Runtime&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Looking Back: Win32 and .NET  &lt;li&gt;Looking Forward: Rise of the NUI  &lt;li&gt;Introducing the Windows Store Application  &lt;ol&gt; &lt;li&gt;Windows 8 Design  &lt;li&gt;Fast and Fluid  &lt;li&gt;Snap and Scale  &lt;li&gt;Use of Right Contracts  &lt;li&gt;Great Tiles  &lt;li&gt;Connected and Alive  &lt;li&gt;Embrace Windows 8 Design Principles&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Windows 8 Tools of the Trade  &lt;ol&gt; &lt;li&gt;Blend for Visual Studio  &lt;li&gt;HTML5 and JavaScript  &lt;li&gt;C++ and XAML  &lt;li&gt;VB/C# and XAML  &lt;li&gt;Behind the Scenes of WinRT  &lt;li&gt;WPF, Silverlight, and the Blue Stack&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Getting Started&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Setting Up Your Environment  &lt;ol&gt; &lt;li&gt;Windows 8  &lt;li&gt;Visual Studio 2012  &lt;li&gt;Blend&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Hello, Windows 8  &lt;ol&gt; &lt;li&gt;Creating Your First Windows 8 Application  &lt;li&gt;Templates&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;The ImageHelper Application  &lt;ol&gt; &lt;li&gt;Under the Covers&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Extensible Application Markup Language (XAML)&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Declaring the UI  &lt;ol&gt; &lt;li&gt;The Visual Tree  &lt;li&gt;Dependency Properties  &lt;li&gt;Attached Properties  &lt;li&gt;Data-Binding  &lt;li&gt;Value Converters&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Storyboards  &lt;li&gt;Styles and Resources  &lt;li&gt;Layout  &lt;ol&gt; &lt;li&gt;Canvas  &lt;li&gt;Grid  &lt;li&gt;StackPanel  &lt;li&gt;VirtualizingPanel and VirtualizingStackPanel  &lt;li&gt;WrapGrid  &lt;li&gt;VariableSizedWrapGrid  &lt;li&gt;ContentControl  &lt;li&gt;ItemsControl  &lt;li&gt;ScrollViewer  &lt;li&gt;ViewBox  &lt;li&gt;GridView  &lt;li&gt;ListView  &lt;li&gt;FlipView  &lt;li&gt;ListBox&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Common Controls  &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Windows 8 Applications&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Layouts and Views  &lt;ol&gt; &lt;li&gt;The Simulator  &lt;li&gt;The Visual State Manager  &lt;li&gt;Semantic Zoom&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Handling User Input  &lt;ol&gt; &lt;li&gt;Pointer Events  &lt;li&gt;Manipulation Events  &lt;li&gt;Mouse Support  &lt;li&gt;Keyboard Support  &lt;li&gt;Visual Feedback  &lt;li&gt;Targeting  &lt;li&gt;Context Menus&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;The Application Bar  &lt;li&gt;Icons and Splash Screens  &lt;li&gt;About Page  &lt;li&gt;Sensors  &lt;ol&gt; &lt;li&gt;Accelerometer  &lt;li&gt;Compass  &lt;li&gt;Geolocation  &lt;li&gt;Gyrometer  &lt;li&gt;Inclinometer  &lt;li&gt;Light Sensor  &lt;li&gt;Orientation Sensor&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Application Lifecycle&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Process Lifetime Management (PLM)  &lt;ol&gt; &lt;li&gt;Activation  &lt;li&gt;Suspension  &lt;li&gt;Termination  &lt;li&gt;Resume  &lt;li&gt;Navigation  &lt;li&gt;Application Data API&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Connected and Alive  &lt;li&gt;Custom Splash Screen  &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Data&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Application Settings  &lt;li&gt;Accessing and Saving Data  &lt;ol&gt; &lt;li&gt;The Need for Speed and Threading  &lt;li&gt;Understanding async and await  &lt;li&gt;Lambda Expressions  &lt;li&gt;IO Helpers  &lt;li&gt;Embedded Resources&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Collections  &lt;ol&gt; &lt;li&gt;Language Integrated Query (LINQ)&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Web Content  &lt;li&gt;Syndicated Content  &lt;li&gt;Streams, Buffers, and Byte Arrays  &lt;li&gt;Compressing Data  &lt;li&gt;Encrypting and Signing Data  &lt;li&gt;Web Services  &lt;ol&gt; &lt;li&gt;OData Support&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Tiles and Toasts&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Basic Tiles  &lt;li&gt;Live Tiles  &lt;li&gt;Badges  &lt;li&gt;Secondary Tiles  &lt;li&gt;Toast Notifications  &lt;li&gt;Windows Notification Service  &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Giving Your Application Charm&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;Searching  &lt;li&gt;Sharing  &lt;ol&gt; &lt;li&gt;Sourcing Content for Sharing  &lt;li&gt;Receiving Content as a Share Target&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Settings  &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;MVVM and Testing&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;UI Design Patterns  &lt;ol&gt; &lt;li&gt;The Model  &lt;li&gt;The View  &lt;li&gt;The View Model&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;The Portable Class Library  &lt;li&gt;Why Test?  &lt;ol&gt; &lt;li&gt;Testing Eliminates Assumptions  &lt;li&gt;Testing Kills Bugs at the Source  &lt;li&gt;Testing Helps Document Code  &lt;li&gt;Testing Makes Extending and Maintaining Applications Easier  &lt;li&gt;Testing Improves Architecture and Design  &lt;li&gt;Testing Makes Better Developers  &lt;li&gt;Conclusion: Write Those Unit Tests!&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Unit Tests  &lt;ol&gt; &lt;li&gt;Windows Store Unit Testing Framework  &lt;li&gt;Mocks and Stubs&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;&lt;strong&gt;Packing and Deploying&lt;/strong&gt;  &lt;ol&gt; &lt;li&gt;The Windows Store  &lt;ol&gt; &lt;li&gt;Discovery  &lt;li&gt;Reach  &lt;li&gt;Business Models  &lt;li&gt;Advertising  &lt;li&gt;Preparing Your App for the Store  &lt;li&gt;The Process  &lt;li&gt;The Windows App Certification Kit (WACK)  &lt;li&gt;What to Expect&lt;/li&gt;&lt;/ol&gt; &lt;li&gt;Side-Loading  &lt;li&gt;Summary&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;Of course, you can also download and check out the source code from all chapters - it's available free as an open source project at &lt;a href="http://windows8applications.codeplex.com/" target="_blank"&gt;http://Windows8Applications.CodePlex.com&lt;/a&gt;.&lt;p&gt;My publisher did a great job pulling together the content, including the dozens of figures and screenshots I included to illustrate every step of the process. Besides your local book store (and if they don’t have it, be sure to let them know they need to fill a shelf with copies), where can you pick this up? There are several options available and various sites will be running different specials and discounts, so check them out: &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://click.linksynergy.com/link?id=dHbiJXhg3ec&amp;amp;offerid=145238.1772510&amp;amp;type=2&amp;amp;murl=http%3A%2F%2Fwww.informit.com%2Fstore%2Fproduct.aspx%3Fisbn%3D0321822161" target="_blank"&gt;Publisher Website (InformIT – Print and eBook editions, separate or bundled together)&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.amazon.com/gp/product/0321822161/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321822161&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Amazon.com – Print Copy&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.amazon.com/gp/product/B009WQ44Q4/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B009WQ44Q4&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Amazon.com – Kindle Version&lt;/a&gt;  &lt;li&gt;&lt;a href="http://www.barnesandnoble.com/w/building-windows-8-apps-with-c-and-xaml-jeremy-likness/1112722434" target="_blank"&gt;Barnes and Noble – Print and Nook Version&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Thanks again for all of your support!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=QKDrTU4D-ck:H2aXa9qKB3g:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=QKDrTU4D-ck:H2aXa9qKB3g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=QKDrTU4D-ck:H2aXa9qKB3g:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/QKDrTU4D-ck" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/4318910980141611619/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/building-windows-8-apps-with-c-and-xaml.html#comment-form" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4318910980141611619?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4318910980141611619?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/QKDrTU4D-ck/building-windows-8-apps-with-c-and-xaml.html" title="Building Windows 8 Apps with C# and XAML is Here!" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh4.ggpht.com/-6BqybAjRLHA/UJAWtfiqFQI/AAAAAAAAAxo/CPl9epbGdJQ/s72-c/WP_000097_thumb%25255B2%25255D.jpg?imgmax=800" height="72" width="72" /><thr:total>7</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/building-windows-8-apps-with-c-and-xaml.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIFSH87eyp7ImA9WhNSEEo.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-3706275952629466810</id><published>2012-10-24T07:17:00.001-04:00</published><updated>2012-10-24T07:18:39.103-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-24T07:18:39.103-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows rt" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="windows runtime" /><category scheme="http://www.blogger.com/atom/ns#" term="winrt" /><title>Windows 8 Hands-On Videos from Engadget Round-Up</title><content type="html">&lt;p&gt;With the launch of Windows 8 right around the corner, OEMs are releasing a ton of exciting hardware. In fact, there are so many options for Windows 8 machines that it is causing information overload. I thought I’d help simplify things by pulling together some of the hands-on videos I’ve watched over the past few weeks from one of my favorite technology sources, &lt;a href="http://www.engadget.com/" target="_blank"&gt;Engadget&lt;/a&gt;. This should help pull together the Windows 8 experience in one place. Here, in alphabetical order, are a slew of videos to help get you started.&lt;/p&gt; &lt;p&gt;Weigh in with comments at the bottom, and if I missed a hands-on you think belongs here, let me know!&lt;/p&gt;
&lt;p&gt;Note: if you are not seeing embedded videos, try going to the &lt;a href="http://csharperimage.jeremylikness.com/2012/10/windows-8-hands-on-videos-from-engadget.html" target="_blank"&gt;original site&lt;/a&gt; for this article by &lt;a href="http://csharperimage.jeremylikness.com/2012/10/windows-8-hands-on-videos-from-engadget.html" target="_blank"&gt;clicking here&lt;/a&gt;.
 &lt;h3&gt;Acer Iconia W510 and W700&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-816f4f5b" height="349" src="//www.viddler.com/embed/816f4f5b/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=84543402&amp;amp;disablebranding=0&amp;amp;view_secret=84543402" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;&lt;iframe id="viddler-d54c5646" height="349" src="//www.viddler.com/embed/d54c5646/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=71163275&amp;amp;disablebranding=0&amp;amp;view_secret=71163275" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;ASUS VivoTab RT &lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-3fe32a09" height="349" src="//www.viddler.com/embed/3fe32a09/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=68871413&amp;amp;disablebranding=0&amp;amp;view_secret=68871413" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;&lt;a href="http://www.engadget.com/2012/10/12/dell-xps-12-pricing-availability/" target="_blank"&gt;Dell XPS 12 Windows 8 Convertible&lt;/a&gt; (Link, no video)&lt;/h3&gt; &lt;p&gt;Follow &lt;a href="http://www.engadget.com/2012/10/12/dell-xps-12-pricing-availability/" target="_blank"&gt;this link&lt;/a&gt; to see the hands-on write-up.&lt;/p&gt; &lt;h3&gt;Fujitsu Lifebook UH75&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-83b0c0e1" height="349" src="//www.viddler.com/embed/83b0c0e1/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=10968140&amp;amp;disablebranding=0&amp;amp;view_secret=10968140" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Fujitsu Stylistic Q702 and LifeBook T902 Convertibles&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-49e2ee76" height="349" src="//www.viddler.com/embed/49e2ee76/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=38371923&amp;amp;disablebranding=0&amp;amp;view_secret=38371923" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Kupa UltraNote Modular Tablet&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-a76cd450" height="349" src="//www.viddler.com/embed/a76cd450/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=14535046&amp;amp;disablebranding=0&amp;amp;view_secret=14535046" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Lenovo ThinkPad Tablet&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-da289af" height="349" src="//www.viddler.com/embed/da289af/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=40132381&amp;amp;disablebranding=0&amp;amp;view_secret=40132381" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;Check out the video “&lt;a href="http://www.lenovo.com//products/us/laptop/ideapad/yoga/yoga-13/?video_id=1897430669001" target="_blank"&gt;The Pursuit.&lt;/a&gt;” &lt;/p&gt; &lt;h3&gt;Microsoft Surface&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-23c131d2" height="349" src="//www.viddler.com/embed/23c131d2/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=19454831&amp;amp;disablebranding=0&amp;amp;view_secret=19454831" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Panasonic AX series Ultrabook&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-aa1659e5" height="349" src="//www.viddler.com/embed/aa1659e5/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=73722468&amp;amp;disablebranding=0&amp;amp;view_secret=73722468" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Samsung Series 5 and Series 7&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-952eef55" height="349" src="//www.viddler.com/embed/952eef55/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=44155626&amp;amp;disablebranding=0&amp;amp;view_secret=44155626" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;Samsung Windows RT ATIV&lt;/h3&gt; &lt;p&gt;&lt;iframe id="viddler-bdc25e64" height="349" src="//www.viddler.com/embed/bdc25e64/?f=1&amp;amp;offset=0&amp;amp;autoplay=0&amp;amp;secret=86513476&amp;amp;disablebranding=0&amp;amp;view_secret=86513476" frameborder="0" width="545" webkitallowfullscreen="true" mozallowfullscreen="true"&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;h3&gt;&lt;a href="http://www.engadget.com/2012/09/27/zte-shows-off-the-v98-windows-8-slate-we-go-hands-on/" target="_blank"&gt;ZTE V98 Windows 8 Slate&lt;/a&gt; (Link, no video)&lt;/h3&gt; &lt;p&gt;Follow &lt;a href="http://www.engadget.com/2012/09/27/zte-shows-off-the-v98-windows-8-slate-we-go-hands-on/" target="_blank"&gt;this link&lt;/a&gt; to see the hands-on write-up.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=0aeY3zzar0o:QIL_jwyk1fA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=0aeY3zzar0o:QIL_jwyk1fA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=0aeY3zzar0o:QIL_jwyk1fA:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/0aeY3zzar0o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/3706275952629466810/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/windows-8-hands-on-videos-from-engadget.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3706275952629466810?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/3706275952629466810?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/0aeY3zzar0o/windows-8-hands-on-videos-from-engadget.html" title="Windows 8 Hands-On Videos from Engadget Round-Up" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/windows-8-hands-on-videos-from-engadget.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUUHR34yfSp7ImA9WhNTFUs.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-2225658476511721282</id><published>2012-10-18T08:27:00.001-04:00</published><updated>2012-10-18T08:27:16.095-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-18T08:27:16.095-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><title>How to Play DVDs on Windows 8 (Even on your tablet that doesn’t have a DVD Player)</title><content type="html">&lt;p&gt;I recently picked up a new DVD that I wanted to watch … only I was hoping I could tap into the convenience of my tablet and take it with me. Of course, the tablet doesn’t have the form factor to host a DVD player. Compound that with the problem that Windows 8 doesn’t ship with DVD support, and it could have been a major issue.&lt;/p&gt; &lt;p&gt;Only, it wasn’t.&lt;/p&gt; &lt;p&gt;Getting support to play DVDs on Windows 8 is easy. Just download a copy of &lt;a href="http://www.videolan.org/" target="_blank"&gt;VLC media player&lt;/a&gt; (click on the text for the link). This is a free, open-source multimedia player that handles almost any protocol you can think of. With the software, it’s easy to pop in a disc and start playing it, and it renders beautifully on my Windows 8 laptop.&lt;/p&gt; &lt;p&gt;But what happens when I want to watch in another room? That’s easy enough. I install a copy on my slate device as well, and then perform a few easy steps.&lt;/p&gt; &lt;p&gt;First, I open the disc.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-6SroXqKQsh0/UH_1d-FzKYI/AAAAAAAAAvg/YkzfCaM76j0/s1600-h/vlc1%25255B2%25255D.png"&gt;&lt;img title="vlc1" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc1" src="http://lh5.ggpht.com/-MGr-yj67dCk/UH_1efCoMoI/AAAAAAAAAvo/d-DjPk97RZ0/vlc1_thumb.png?imgmax=800" width="244" height="78"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Next, I tick the mark for “No disc menus” and choose the “Stream” option.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-5YmJWWztYjg/UH_1fFSHD_I/AAAAAAAAAvw/JNI93nWireI/s1600-h/vlc2%25255B3%25255D.png"&gt;&lt;img title="vlc2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc2" src="http://lh5.ggpht.com/-wdNHxZiNgSg/UH_1f4pGBEI/AAAAAAAAAv4/mcJstMDzWYE/vlc2_thumb%25255B1%25255D.png?imgmax=800" width="469" height="450"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The first dialog just sources the disc – you can click next to set up the destination. Here, choose HTTP and click the Add button.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-ZTs82ku9KRA/UH_1guon1EI/AAAAAAAAAwA/8lI-jSVeVfk/s1600-h/vlc3%25255B4%25255D.png"&gt;&lt;img title="vlc3" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc3" src="http://lh3.ggpht.com/-TbxxmNdB334/UH_1iKNHJsI/AAAAAAAAAwI/z9xKk0kLOac/vlc3_thumb%25255B2%25255D.png?imgmax=800" width="656" height="178"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;You can select a port and an optional path … here I’m using the default 8080 port with no path. Remember that you must have the port opened on your firewall (the first time you launch, you should get a dialog prompting you to allow that firewall access). &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/--ykeezUQelQ/UH_1iohY1WI/AAAAAAAAAwQ/QlcZpFjg_YA/s1600-h/vlc3a%25255B3%25255D.png"&gt;&lt;img title="vlc3a" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc3a" src="http://lh4.ggpht.com/-Ut_xk7apD-w/UH_1jYZbkrI/AAAAAAAAAwY/pVbCDEXSzUM/vlc3a_thumb%25255B1%25255D.png?imgmax=800" width="629" height="178"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Under the profile, you can pick the type of stream. I had to experiment on my local network but VP80 + Voris (Webm) seemed to work best for me. &lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-lxeo9vVEBLI/UH_1k8uYpqI/AAAAAAAAAwg/e6TFXnDsYOc/s1600-h/vlc4%25255B3%25255D.png"&gt;&lt;img title="vlc4" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc4" src="http://lh5.ggpht.com/-Fu2w_f1BeHo/UH_1lcQUQ-I/AAAAAAAAAwo/_eWSLkVgeiw/vlc4_thumb%25255B1%25255D.png?imgmax=800" width="605" height="254"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I click Next and then on the final screen I simply leave the defaults and click the “Stream” button at the lower right of the dialog. Once it starts streaming, I open VLC on my tablet. I choose the option to open a network stream:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh5.ggpht.com/-t8ynQeyr1nY/UH_1mPQ5wVI/AAAAAAAAAww/uLvhCxmsz_0/s1600-h/vlc5%25255B3%25255D.png"&gt;&lt;img title="vlc5" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="vlc5" src="http://lh6.ggpht.com/-Zdo5pXgU0qg/UH_1nMh2LKI/AAAAAAAAAw4/5Q9FMcAo2Og/vlc5_thumb%25255B1%25255D.png?imgmax=800" width="343" height="149"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I enter the name of my host computer (the one that is playing the DVD) and the port, then click play:&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh3.ggpht.com/-VONahdFn46U/UH_1oDK3zLI/AAAAAAAAAxA/aXxLVyeFBjU/s1600-h/vlc6%25255B4%25255D.png"&gt;&lt;img title="vlc6" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="vlc6" src="http://lh5.ggpht.com/-KEy4JfQmiPs/UH_1olF3vdI/AAAAAAAAAxI/wKgvtblK-KE/vlc6_thumb%25255B2%25255D.png?imgmax=800" width="588" height="472"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now I have streaming goodness, and can watch the DVD from anywhere in the house using my tablet. I’d show you a screen cap of Spartacus playing but I’m pretty sure that image would be under copyright. &lt;/p&gt; &lt;p&gt;Of course, there are other more advanced options with controls that will be available through media center, XBox and Smartglass, but for now that is a quick and dirty solution that works well for me.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=AerYnQKTkgM:AmzxVDaEvxM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=AerYnQKTkgM:AmzxVDaEvxM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=AerYnQKTkgM:AmzxVDaEvxM:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/AerYnQKTkgM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/2225658476511721282/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/how-to-play-dvds-on-windows-8-even-on.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2225658476511721282?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2225658476511721282?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/AerYnQKTkgM/how-to-play-dvds-on-windows-8-even-on.html" title="How to Play DVDs on Windows 8 (Even on your tablet that doesn’t have a DVD Player)" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-MGr-yj67dCk/UH_1efCoMoI/AAAAAAAAAvo/d-DjPk97RZ0/s72-c/vlc1_thumb.png?imgmax=800" height="72" width="72" /><thr:total>4</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/how-to-play-dvds-on-windows-8-even-on.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0MMRXo6fSp7ImA9WhNTFEo.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-4422914733059771732</id><published>2012-10-17T08:35:00.001-04:00</published><updated>2012-10-17T09:11:24.415-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-17T09:11:24.415-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8 apps" /><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><title>The Microsoft Surface and Apple iPad 3 Head to Head</title><content type="html">&lt;p&gt;I was in a recent discussion about the &lt;a href="http://www.surface.com/" target="_blank"&gt;Microsoft Surface&lt;/a&gt; and how it will be received by the consumer market. Obviously there are a lot of emotional reactions. Everyone is speculating about the price points, comparing features, and wondering if average consumers will even care. I would argue that there is a technical aspect to this that does make sense to discuss and debate … after all, you can compare screen resolutions or count apps in the app store … but then there is a purely marketing aspect that overrides any technical considerations. No, it doesn’t mean the specs don’t matter, but it does mean that you can have poor specs and great marketing and still succeed, and the best specs in the world won’t fix a poor marketing campaign.&lt;/p&gt; &lt;p&gt;All of the discussion and speculation got me wondering, how &lt;em&gt;does&lt;/em&gt; this offering compare to the iPad? I can’t offer an objective opinion because I’m not an iPad user. I have a &lt;a href="http://www.amazon.com/gp/product/B005OUQ9WO/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=B005OUQ9WO&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Samsung Series 7 slate&lt;/a&gt; that I purchased to write my book, and have been using Windows 8 on it since the Developer Preview. I love it. It does exactly what I want. When I am heads down writing prose or code, I’m on my dual screen monitors with a big external keyboard. When I’m casually browsing emails, participating in social networks, editing or commenting on manuscripts or watching videos, I’ve got my slate in hand. The battery lasts a long time (I enjoy watching movies any time I’m flying from Atlanta to Seattle, and always have plenty of battery left over) and the experience is just nice.&lt;/p&gt; &lt;p&gt;That, however, doesn’t mean it is not lacking or inferior. Of course this is a full version of Windows 8 on a Pentium chip that requires a fan to cool it so it is a lot thicker than an iPad. I have friends with iPads who love it. It’s thin. It’s easy to carry around. It is fast, snappy, and does the trick … so from that perspective, it’s tough for me to say one really “wins” over the other. The people used to the iPad, love it, the ones used to the Windows 8 slate, love it. Having said that, I &lt;em&gt;was&lt;/em&gt; a former iPhone user and switched to Windows Phone 7 and had no desire to go back (no, didn’t receive anything from Microsoft for that statement, either, I truly had the choice and ended up turning it over to my daughter because I loved the Windows Phone so much).&lt;/p&gt; &lt;p&gt;OK, enough about speculation, let’s see what we can be objective about. Here’s a technical comparison that I believe accurately reflects the two models. Disclaimer: this is what I’ve gathered to the best of my ability by examining the data available online. I do not warrant the accuracy here and I welcome all feedback and updates. The specs here do not represent any official statement or correspondence from either Microsoft nor Apple. Here’s what I came up with:&lt;/p&gt; &lt;table cellspacing="0" cellpadding="0" border="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt;&amp;nbsp;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;&lt;b&gt;iPad $499&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;&lt;b&gt;Surface $499&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;&lt;b&gt;iPad $599&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;&lt;b&gt;Surface $599&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;&lt;b&gt;iPad $699&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;&lt;b&gt;Surface $699&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Storage&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;16 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;32 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;32 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;32 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;64 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;64 GB&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Display&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;2048x1536&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;1366x768&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;2048x1536&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1366x768&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;2048x1536&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;1366x768&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Camera&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1080p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;1080p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1080p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Back Camera&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;720p&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Weight&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1.44 lbs&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;1.5 lbs&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;1.44 lbs&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1.5 lbs&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1.44 lbs&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;1.5 lbs&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Thickness&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;9.4mm&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Includes keyboard?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;RAM&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;2 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;1 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;2 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;1 GB&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;2 GB&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;CPU&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;2-core 1 GHz&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;4-core 1.5 GHz&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;2-core 1 GHz&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;4-core 1.5 GHz&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;2-core 1 GHz&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;4-core 1.5 GHz&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Battery&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;10 hours&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;8 hours&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;10 hours&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;8 hours&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;10 hours&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;8 hours&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;HD Video out?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;USB 2.0?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Ambient light?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Accelerometer?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Gyroscope?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Compass?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td valign="bottom" width="155"&gt; &lt;p&gt;&lt;b&gt;Microsoft Office?&lt;/b&gt;&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="128"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="113"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="120"&gt; &lt;p&gt;No&lt;/p&gt;&lt;/td&gt; &lt;td valign="bottom" width="95"&gt; &lt;p&gt;Yes&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Again, I welcome any corrections or updates if I’m off. Let’s take a look line by line: &lt;/p&gt; &lt;h2&gt;Storage&lt;/h2&gt; &lt;p&gt;This one was interesting to me. The entry level model for Surface actually has twice the storage of it’s counterpart, and other models are on par with the price. &lt;/p&gt; &lt;h2&gt;Display and Cameras&lt;/h2&gt; &lt;p&gt;Clearly the iPad3 wins in this category. With a super high resolution display it blows the Surface out of the water, and has a higher resolution front camera to boot. I would have to really hold two of these devices side by side to determine how much of a difference that makes – the video really doesn’t concern me, I am perfectly fine with 720p, but the display is something that can make a major difference if you are staring at the tablet all day long.&lt;/p&gt; &lt;h2&gt;Weight and Thickness&lt;/h2&gt; &lt;p&gt;These appear to be so close that you can’t really declare a winner. Right on par in both aspects.&lt;/p&gt; &lt;h2&gt;CPU and RAM&lt;/h2&gt; &lt;p&gt;Unless my information is off, it looks like all price points of the Surface are double RAM of the iPad3 (2 GB vs. 1 GB). The CPU is a quad core NVidia T30 that clocks up to 1.5 GHz compared to a dual-core A5x that clocks up to 1.0 GHz but I wouldn’t read that as a win for one over the other – regardless of cores or clock (which changes, by the way, to preserve battery) we’d have to see head-to-head bench marks to determine if the CPUs are really being utilized in a way that makes one truly faster than the other.&lt;/p&gt; &lt;h2&gt;Battery&lt;/h2&gt; &lt;p&gt;These are all based on claims and not actual data, so it’s tough to say the 2 hour difference is significant. Microsoft may be conservative or they may be off – you’d have to set up an experiment with comparable streaming video, browsing, or other “high cost” activities on both devices to truly compare. It looks like on paper the batteries should be comparable.&lt;/p&gt; &lt;h2&gt;Peripheral Support&lt;/h2&gt; &lt;p&gt;To me the Surface wins hands-down here. If you don’t care, it’s a moot point, but I like my USB drives and other peripherals and the fact that the Surface has a USB 2.0 port I can plug them right into.&lt;/p&gt; &lt;h2&gt;Sensors&lt;/h2&gt; &lt;p&gt;The systems appear to have a similar array of sensors.&lt;/p&gt; &lt;h2&gt;Microsoft Office&lt;/h2&gt; &lt;p&gt;This is to me hands-down the most important comparison. This is not based on my personal bias, but practical experience. My Samsung slate is often mistaken for an iPad on planes just because it’s a tablet and Apple has certainly marketed their product well enough to make it seem that all tablets are iPads. What gets interesting, however, is when I’m editing PowerPoint presentations, book manuscripts in Word, or catching up on Outlook emails on my device. That’s when people lean over and go, “Oh, wow, how did you get Office on there?” When I explain it’s the Windows version on a Windows machine, I consistently get “oohs” and “ahhhs.” Of course, I have mixed feelings about this one. WindowsRT will be limited to Windows Store apps, which include Office, so that’s good … but the next thing I typically say, which is “Yeah, I can run ALL of my Windows 7 software on this” simply won’t hold true for Surface until the Pro version comes out later next year.&lt;/p&gt; &lt;p&gt;First Windows 8 ad:&lt;/p&gt; &lt;p&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/i1GNDs7DCTw" frameborder="0" width="560" allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;First Surface ad:&lt;/p&gt; &lt;p&gt;&lt;iframe height="315" src="http://www.youtube.com/embed/8mSckyoAMHg" frameborder="0" width="560" allowfullscreen&gt;&lt;/iframe&gt;&lt;/p&gt; &lt;p&gt;So what’s the bottom line?&lt;/p&gt; &lt;p&gt;I think this appears to be a very innovative product that I’m excited to try out. I just may get one for my wife or daughter and see how they enjoy it and whether or not they feel limited by the available apps. Whether we decide it’s awesome and far better than the iPad3 doesn’t really matter, however. Sure, it makes a difference, but what will determine overall success is how well Microsoft markets the product … and that’s still up in the air, although the hype is now beginning for both Windows 8 and Surface.&lt;/p&gt; &lt;p&gt;What do you think about the recent announcements? What are your thoughts on features, specifications, and price points? How about all of the other manufacturers releasing their line of Windows 8 products … is any particular model standing out as a clear leader in innovation, design, and, yes, I’ll say it, ability to kick iPad’s ass?&lt;/p&gt; &lt;p&gt;Comment below.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=REQ_DwptgVo:Vt-9owcPf9c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=REQ_DwptgVo:Vt-9owcPf9c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=REQ_DwptgVo:Vt-9owcPf9c:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/REQ_DwptgVo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/4422914733059771732/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/the-microsoft-surface-and-apple-ipad-3.html#comment-form" title="19 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4422914733059771732?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4422914733059771732?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/REQ_DwptgVo/the-microsoft-surface-and-apple-ipad-3.html" title="The Microsoft Surface and Apple iPad 3 Head to Head" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://img.youtube.com/vi/i1GNDs7DCTw/default.jpg" height="72" width="72" /><thr:total>19</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/the-microsoft-surface-and-apple-ipad-3.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4BRH46eip7ImA9WhJaGUw.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-5405649791217548155</id><published>2012-10-10T20:22:00.001-04:00</published><updated>2012-10-10T20:22:35.012-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-10T20:22:35.012-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 8" /><category scheme="http://www.blogger.com/atom/ns#" term="winrt" /><title>Windows Runtime Components in a .NET World</title><content type="html">&lt;p&gt;The new type of program known as a Windows Store app—optimized to run on Windows 8 devices—has a default view with a full-screen window and no distracting chrome, so the content is the focal point. Windows Store apps support fluid layouts that adapt and scale to a variety of screen sizes and resolutions. They provide a touch-first experience while providing full support for the traditional keyboard and mouse.
&lt;p&gt;MSDN recently released a &lt;a href="http://msdn.microsoft.com/en-us/magazine/jj660298.aspx" target="_blank"&gt;special Windows 8 issue&lt;/a&gt; that covers Windows Store apps. It includes an article I contributed about creating managed Windows Runtime (WinRT) components that can be consumed by Windows Store apps written using any of the available language options, including C++ and HTML/JavaScript. Learn about the requirements needed to create a Windows Runtime Component in C#, how to reference and use it, and how it impacts other language selections when developing Windows Store apps.
&lt;p&gt;The article includes a full example for creating a special component that generates thumbnails and is consumed by C#, C++, and a HTML/JavaScript application as well. The team at Microsoft also provided a VB version. 
&lt;p&gt;Read the full article online at &lt;a href="http://msdn.microsoft.com/en-us/magazine/jj651570.aspx" target="_blank"&gt;Windows Runtime Components in a .NET World&lt;/a&gt;.
&lt;p&gt;&lt;a href="http://jeremylikness.com/" title="Jeremy Likness"&gt;&lt;img border="0" src="http://jeremylikness.com/signature.gif" alt="Jeremy Likness" title="Jeremy Likness"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=R1IE_WFpjkI:KN1ZlnQ0Tlk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=R1IE_WFpjkI:KN1ZlnQ0Tlk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=R1IE_WFpjkI:KN1ZlnQ0Tlk:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/R1IE_WFpjkI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/5405649791217548155/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/windows-runtime-components-in-net-world.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5405649791217548155?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/5405649791217548155?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/R1IE_WFpjkI/windows-runtime-components-in-net-world.html" title="Windows Runtime Components in a .NET World" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/windows-runtime-components-in-net-world.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EBR3g7cCp7ImA9WhJaFUg.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-6876405309292171044</id><published>2012-10-06T16:30:00.000-04:00</published><updated>2012-10-06T16:34:16.608-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-06T16:34:16.608-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="inversion of control" /><category scheme="http://www.blogger.com/atom/ns#" term="dependency injection" /><category scheme="http://www.blogger.com/atom/ns#" term="ioc" /><category scheme="http://www.blogger.com/atom/ns#" term="di" /><category scheme="http://www.blogger.com/atom/ns#" term="portable library" /><title>A Tiny Portable Inversion of Control Container for Multiple Windows Platforms</title><content type="html">&lt;p&gt;As part of the cross-platform example in my &lt;a href="http://bit.ly/win8design" target="_blank"&gt;book&lt;/a&gt;, I built a tiny IOC container mainly to avoid having to reference and explain MEF, Unity, or any of the other choices. This is not a full-fledged container with tons of services like injection. It is simply an easy way to create things that depend on other things and manage their lifetime.
&lt;p&gt;The "portable" part is evident in the targets. You can reference the exact same DLL from any Windows Phone, .NET Framework 4.x, Windows Store (Windows 8), or Silverlight 4+ project to use the container. That's it - completely portable, no recompiling necessary, and you now get to keep the same API on your view models when you're wiring dependencies (yes, I'm looking at providing a simple portable MVVM implementation too, but a portable &lt;a href="http://sterling.codeplex.com/" target="_blank"&gt;Sterling&lt;/a&gt; will probably be my next focus since I get so many requests for it on Windows 8). 
&lt;p&gt;If you are dubious about what is possible across platforms, download the Chapter 9 source code from &lt;a href="http://windows8applications.codeplex.com/" target="_blank" title="Windows 8 App Source Code"&gt;Windows8Applications.CodePlex.com&lt;/a&gt; (it's free, regardless of whether or not you get the book) and look at the Wintellog example. This is a full blown RSS feed reader implemented for both WPF and Windows Store (Windows 8) that uses most of the same code (even part of the networking stack). It includes a very basic version of the container that I used in the book. 
&lt;p&gt;The container is less than 200 lines of code. Many of the lines are there for design-by-contract checks and some thread-safety mechanisms to ensure unregistering and resolving from separate threads doesn't clobber the container.
&lt;p&gt;It has a few features: 
&lt;ul&gt;&lt;li&gt;Uses a simple lambda expression to describe how to create implementations for types 
&lt;li&gt;Passes itself to the instance delegates so they can recursively resolve other references
&lt;li&gt;Provides labels so you can segregate different definitions (or consider everything under a "label" as a different "container" 
&lt;li&gt;Allows you to unregister a definition (and register it as something different, though I can't imagine why you'd do that) 
&lt;li&gt;Allows you receive a shared or a non-shared instance (lifetime management
&lt;li&gt;Allows you to destroy the shared instance and generate a new one 
&lt;li&gt;Provides a TryResolve to test and resolve in one operation
&lt;/ul&gt;
&lt;p&gt;The use of it is fairly straightforward and can be inferred from the tests:
&lt;pre&gt;
[TestInitialize]
public void TestInitialize()
{
    _target = new PortableIoc();
}
&lt;/pre&gt;
&lt;p&gt;Register and resolve:
&lt;pre&gt;
[TestMethod]
public void GivenTypeRegisteredWhenRequestedThenShouldReturnInstance()
{
    var expected = new SimpleBar();
    _target.Register&amp;lt;IBar&gt;(ioc =&gt; expected);
    var actual = _target.Resolve&amp;lt;IBar&gt;();
    Assert.AreSame(expected, actual, "Test failed: same instance was not returned.");
}
&lt;/pre&gt;
&lt;p&gt;Test that you can resolve it:
&lt;pre&gt;
[TestMethod]
public void GivenTypeRegisteredWhenCanResolveCalledThenShouldReturnTrue()
{
    _target.Register&amp;lt;IBar&gt;(ioc =&gt; new SimpleBar());
    Assert.IsTrue(_target.CanResolve&amp;lt;IBar&gt;(),
                    "Test failed: can resolve should return true when the type is registered.");
}
&lt;/pre&gt;
&lt;p&gt;Try to resolve it:
&lt;pre&gt;
[TestMethod]
public void GivenTypeIsNotRegisteredWhenTryResolveCalledThenShouldReturnFalse()
{
    IBar barInstance;
    var result = _target.TryResolve(out barInstance);
    Assert.IsNull(barInstance, "Test failed: bar instance should be null when type is not registered");
    Assert.IsFalse(result, "Test failed: result should be false when type is not registered.");
}
&lt;/pre&gt;
&lt;p&gt;Generate a non-shared instance:
&lt;pre&gt;
[TestMethod]
public void GivenTypeIsRegisteredWhenNewInstanceIsRequestedThenShouldReturnNewInstance()
{
    _target.Register&amp;lt;IBar&gt;(ioc =&gt; new SimpleBar());
    var actual1 = _target.Resolve&amp;lt;IBar&gt;();
    var actual2 = _target.Resolve&amp;lt;IBar&gt;(true);
    Assert.AreNotSame(actual1, actual2, "Test failed: create new should not return the same shared instance.");
}
&lt;/pre&gt;
&lt;p&gt;Use constructor injection:
&lt;pre&gt;
target.Register&amp;lt;IBar&gt;(ioc =&gt; new SimpleBar());            
_target.Register&amp;lt;IFoo&gt;(ioc =&gt; new SimpleFoo(ioc.Resolve&amp;lt;IBar&gt;()));
&lt;/pre&gt;
&lt;p&gt;Or property injection:
&lt;pre&gt;
target.Register&amp;lt;IBar&gt;(ioc =&gt; new SimpleBar());            
_target.Register&amp;lt;IFoo&gt;(ioc =&gt; new SimpleFoo { Bar = ioc.Resolve&amp;lt;IBar&gt;() });
&lt;/pre&gt;
&lt;p&gt;That's about it - you can grab the source and/or binary (sorry, no NuGet package yet) over at &lt;a href="http://portableioc.codeplex.com/" target="_blank"&gt;PortableIoC.CodePlex.com&lt;/a&gt;. Now let's get some work done on Sterling ...
&lt;p&gt;&lt;a href="http://jeremylikness.com/" title="Jeremy Likness"&gt;&lt;img border="0" src="http://jeremylikness.com/signature.gif" alt="Jeremy Likness" title="Jeremy Likness"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=y8cuRz7hkto:E2tX7Lu82IQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=y8cuRz7hkto:E2tX7Lu82IQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=y8cuRz7hkto:E2tX7Lu82IQ:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/y8cuRz7hkto" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/6876405309292171044/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/a-tiny-portable-inversion-of-control.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6876405309292171044?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6876405309292171044?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/y8cuRz7hkto/a-tiny-portable-inversion-of-control.html" title="A Tiny Portable Inversion of Control Container for Multiple Windows Platforms" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/a-tiny-portable-inversion-of-control.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CE4HSHo-fip7ImA9WhJaEkw.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-6581061058718348553</id><published>2012-10-02T17:18:00.001-04:00</published><updated>2012-10-02T17:22:19.456-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-10-02T17:22:19.456-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="javascript" /><category scheme="http://www.blogger.com/atom/ns#" term="backbone" /><category scheme="http://www.blogger.com/atom/ns#" term="JSON" /><category scheme="http://www.blogger.com/atom/ns#" term="coffeescript" /><category scheme="http://www.blogger.com/atom/ns#" term="mvc" /><category scheme="http://www.blogger.com/atom/ns#" term="ajax" /><category scheme="http://www.blogger.com/atom/ns#" term="typescript" /><title>Building Backbone Applications with TypeScript</title><content type="html">&lt;p&gt;Hot off the press, &lt;a href="http://www.typescriptlang.org/" target="_blank"&gt;TypeScript&lt;/a&gt; was announced earlier this week and has resulted in an explosion of commentary over Twitter and various blogs. The language claims to be tailored for application-scale development using JavaScript by providing a typed superset. It compiles to JavaScript so it will work in any browser. The promise is to make it easier to organize and structure code, as well as get rid of those annoying errors that leave users hunting through hundreds of lines of code seeking out an errant comma or issue with case sensitivity. &lt;/p&gt; &lt;p&gt;Ironically, I was speaking with an attendee at our &lt;a href="http://www.devscovery.com/" target="_blank"&gt;Devscovery&lt;/a&gt; conference about the future of JavaScript right before TypeScript was announced. It’s obvious that JavaScript is here to stay, and it’s not going to get any better. It may get better parts, but backwards compatibility is going to force the bad parts to remain for a long time. What’s worse, there is nothing that convinces me browser vendors will play nice with the specifications when we’ve had a standard for almost 20 years and it is still implemented differently in different browsers. My take having come from a heavy JavaScript background before I was spoiled for several years by the ease of writing solid Silverlight business applications is that if we have to deal with it, we need to tackle it on three fronts:&lt;/p&gt; &lt;ol&gt; &lt;li&gt;&lt;strong&gt;Education: &lt;/strong&gt;JavaScript is a dynamic language where functions, not classes, rule. Developers need to stop trying to play object-oriented developer in the client space and learn how to play by the client rules.  &lt;li&gt;&lt;strong&gt;Moderation&lt;/strong&gt;: Having said that, there are features that simply make it far too easy to shoot yourself in the foot. While there are decent solutions to address this like running JSHint/JSLint, I personally welcome an approach to catch issues at compile (or even better, development) time and keep us all honest. Bugs are easier to fix the closer to the source and the earlier in the process you are. One of the things I mentioned was that something like &lt;a href="http://coffeescript.org/" target="_blank"&gt;CoffeeScript&lt;/a&gt; should be implemented that helps protect us from the bad parts as we develop, but still generates to that friendly backwards-compatible JavaScript all of the browsers love.  &lt;li&gt;&lt;strong&gt;Better Glue&lt;/strong&gt;. Yes, I said it. Silverlight developers know what I’m talking about *cough* RIA Services *cough* … now that we have very standard ways of exposing APIs, there should be easier ways to glue the client to the server so that developers are working on “what’s different” and not spending 75% of their time building controller methods and writing AJAX calls on the client.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;I believe TypeScript is a tool that preserves the first item (it honors JavaScript and doesn’t try to hide the dynamic and flexible nature) and addresses the second item (it allows us to declare intent far more clearly and then have feedback right away) and probably does nothing for the last item.&lt;/p&gt; &lt;p&gt;Instead of debating whether or not we need another language or if it is good or bad (and hey, I love C#, and I loved TurboPascal, so the fact that it was developed by &lt;a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg" target="_blank"&gt;Anders Hejlsberg&lt;/a&gt; doesn’t hurt) I would rather jump into using it so I can start to get a feel for how it helps or hurts. Tomorrow I’ll be speaking for three hours on this specific topic (how to leverage libraries in JavaScript development to help scale for large projects and with large teams) so I decided to grab an example I created with &lt;a href="http://backbonejs.org/" target="_blank"&gt;Backbone.JS&lt;/a&gt; to see what it would take to port over. Here we go!&lt;/p&gt; &lt;p&gt;Step one was simply implementing the VS 2012 plug-in. I’m sure I failed miserably at this. I get syntax highlighting but no template to add a new TypeScript file, no automatic compilation and no effective IntelliSense. I’m sure it’s operator error so stay tuned. You can grab whatever you need (or I should say, “Whatever is available”) from &lt;a href="http://www.typescriptlang.org/#Download" target="_blank"&gt;the TypeScript downloads link&lt;/a&gt;. Next, I added a JavaScript file and renamed it to have a .ts extension and added a post-build script to compile it:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;tsc $(ProjectDir)/Scripts/app.ts&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Next, I grabbed the language specification and went to work. First, I found I had to declare some variables to allow for external modules:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;declare var $: any;&lt;br&gt;declare var _: any;&lt;/font&gt;&lt;br&gt;&lt;/p&gt; &lt;p&gt;That was easy! Using Backbone however was a little more complicated. I cheated by taking a look at the existing &lt;a href="http://www.typescriptlang.org/Samples/#TodoMVC" target="_blank"&gt;TodoMVC&lt;/a&gt; sample from the TypeScript site. To allow Backbone to play nicely with TypeScript, I have to define a module and export classes that describe the API. It doesn’t have to be the full API, but can focus on the pieces I’ll be using. Here’s an example of exporting the Backbone Model object as a class:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;declare module Backbone {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; export class Model {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; constructor (attr? , opts? );&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get(name: string): any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(name: string, val: any): void;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set(obj: any): void;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; save(attr? , opts? ): void;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; destroy(): void;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bind(ev: string, f: Function, ctx?: any): void;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; toJSON(): any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Notice that I have optional parameters in the constructor. I can declare intention by providing a type for named parameters and the return type of the function. Pretty cool. I like to use Backbone.Events as well, and TypeScript allows me to define interfaces. Here is the interface for events specifying the signature for “on” and “off” (register and unregister):&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;interface HasEvents {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: (event: string, callback: (parms?: any, moreParms?: any) =&amp;gt; any) =&amp;gt; any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; off: (event: string) =&amp;gt; any;&lt;br&gt;}&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The easiest way to read this in my opinion is right to left. A function that returns any type takes the parameters of, well, in the case of the first one, a function that has two optional parameters and returns any type, and the first parameter is a string. I also made an interface for the simple version of a contact to make it clear when I am expecting an instance of this:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;interface ContactInterface {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id?: number;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstName: string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastName: string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; email: string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; address: string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; city: string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; state: string;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;};&lt;/font&gt;&lt;/p&gt; &lt;p&gt;You can also declare static properties on classes, so I created a template class just to hold the compiled templates I am using:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;class Templates {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static contact: (json: any) =&amp;gt; string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static editContact: (json: any) =&amp;gt; string;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static contacts: (json: any) =&amp;gt; string;&lt;br&gt;};&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Note that the compiled template takes any type of object and returns a string. Finally, I created a global object to host cross-cutting events in lieu of using a pub/sub library like &lt;a href="http://freshbrewedcode.com/jimcowart/2011/12/05/client-side-messaging-with-postal-js-part-1/" target="_blank"&gt;Postal&lt;/a&gt;. Note the implementation of the &lt;font face="Courier New"&gt;HasEvents&lt;/font&gt; interface.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;class AppEvents implements HasEvents &lt;br&gt;{&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: (event: string, callback: (model: Contact, error: any) =&amp;gt; any) =&amp;gt; any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; off: (event: string) =&amp;gt; any;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; trigger: (event: string, data: any) =&amp;gt; any;&amp;nbsp; &lt;br&gt;};&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Finally, you get to see some plain JavaScript – I create the object and extend it to have events:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;var appEvents = new AppEvents();&lt;br&gt;_.extend(appEvents, Backbone.Events);&lt;/font&gt; &lt;br&gt;&lt;br&gt;So now let’s tackle how we did it the “old way” vs. “the new way.” Here is the old way I defined my contact model:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;App.Models.Contact = Backbone.Model.extend({&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialize: function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Contact init.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaults: function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: null,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; email: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; city: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state: ''&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; validate: function (attrs) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.firstName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "First name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.lastName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Last name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.email)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Email is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attrs.email.indexOf("@") &amp;lt; 1 ||&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrs.email.indexOf(".") &amp;lt; 1) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "The email address appears to be invalid.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;});&lt;/font&gt;&lt;br&gt;&lt;br&gt;Basically I’m logging something to the console, providing a template for a contact instance, and declaring my validations. Notice that there is no way to guarantee what I return from the function (I could just as easily send back &lt;font face="Courier New"&gt;{ foo: “bar” }&lt;/font&gt;) and that the attributes for the validation could be anything as well. With TypeScript, I can be more specific and even generate development-time (and compile-time) errors if I’m not doing what I expect:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;class Contact extends Backbone.Model implements HasEvents {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: (event: string, callback: (model: Contact, error: any) =&amp;gt; any) =&amp;gt; any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;font face="Courier New"&gt;off: (event: string) =&amp;gt; any;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; isValid: () =&amp;gt; bool;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialize() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Contact init.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; defaults() : ContactInterface {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: null,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; email: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; city: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state: ''&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; validate(attrs: ContactInterface) {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.firstName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "First name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.lastName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Last name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (_.isEmpty(attrs.email)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Email is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (attrs.email.indexOf("@") &amp;lt; 1 ||&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; attrs.email.indexOf(".") &amp;lt; 1) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "The email address appears to be invalid.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;};&lt;br&gt;&lt;/font&gt;&lt;br&gt;Notice that I implement the events in a more specific way, providing a detailed signature for the callback. Functions are simply declared similar to how they are defined on C# classes and I don’t have to worry about exposing the property name. Finally, I can type the return value and the parameters for the various functions. Pretty cool, no? I’m still using JavaScript and the object can still be dynamic, but I can at least constrain it to the specific interface I’m going to use within my method.&lt;/p&gt; &lt;p&gt;Here’s the old definition for the collection, passing in the options to configure it to point to the REST API on my server:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;App.Collections.Contacts = Backbone.Collection.extend({&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; model: App.Models.Contact,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "/api/Contacts",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialize: function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Contacts init.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;});&lt;/font&gt;&lt;br&gt;&lt;br&gt;Here’s the new definition that derives from the base class and uses a constructor instead. I also make it very clear I’m using events on the collection as well, which isn’t evident in the original JavaScript.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;class Contacts extends Backbone.Collection implements HasEvents {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on: (event: string, callback: (parms?: any, moreParms?: any) =&amp;gt; any) =&amp;gt; any;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; off: (event: string) =&amp;gt; any;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: string;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; model: Contact;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; initialize() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Contacts init.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; constructor(options?: any) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.url = "/api/Contacts";&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; super(options);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;};&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Another cool feature is that I can declare types and then cast calls that aren’t apparent to a type. For example, I haven’t informed TypeScript that jQuery can return a DOM element, but on my declaration for views I do use the HTMLElement type. To reconcile this, I can simply cast the result like this: &lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;this.el = &amp;lt;HTMLElement&amp;gt;$("#contact");&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/p&gt; &lt;p&gt;I know, it looks like an HTML tag but that is because it’s not a true cast, only a tip that this is the return type we expect. After several more models and views, I define an overall application object that spins up the initial collection in the constructor. Note how I also set the static template properties – very straightforward syntax. Creating the object kicks off the application:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;class Application {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static editContactView: EditContactView;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; constructor() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Templates.contact = _.template($("#contactTemplate").html());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Templates.editContact = _.template($("#editContactTemplate").html());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Templates.contacts = _.template($("#contactsTemplate").html());&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var contacts = new Contacts();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contacts.fetch();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var contactsView = new ContactList({&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; collection: contacts&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contactsView.render();&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;};&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;// host container&lt;br&gt;var App = new Application();&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The application demonstrates CRUD with a list that populates a form with validation where the user can edit, delete, and add new contacts.&lt;/p&gt; &lt;p&gt;&lt;a href="http://lh6.ggpht.com/-1ZxrUxpOjlE/UGtaEa-VgAI/AAAAAAAAAvE/_OnG3CkgQU4/s1600-h/backbonetypescriptexample%25255B4%25255D.png"&gt;&lt;img title="backbonetypescriptexample" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="backbonetypescriptexample" src="http://lh5.ggpht.com/-DYe8X-n342E/UGtaE55mYYI/AAAAAAAAAvM/wksCdkpDJhg/backbonetypescriptexample_thumb%25255B2%25255D.png?imgmax=800" width="647" height="281"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The build process compiles the TypeScript to a JavaScript file that is actually referenced from the MVC view. You won’t see interfaces or definitions because those help enforce things at development and compile time. What does the output look like? Here’s the compiled application-wide event object I created:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;var AppEvents = (function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function AppEvents() { }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return AppEvents;&lt;br&gt;})();&lt;br&gt;; ;&lt;br&gt;var appEvents = new AppEvents();&lt;br&gt;_.extend(appEvents, Backbone.Events);&lt;br&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here is the contact model definition – note how the Backbone Model is passed in for extension:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;var Contact = (function (_super) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; __extends(Contact, _super);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; function Contact() {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _super.apply(this, arguments);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contact.prototype.initialize = function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log("Contact init.");&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contact.prototype.defaults = function () {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; id: null,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lastName: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; email: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; address: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; city: '',&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; state: ''&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Contact.prototype.validate = function (attrs) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(_.isEmpty(attrs.firstName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "First name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(_.isEmpty(attrs.lastName)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Last name is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(_.isEmpty(attrs.email)) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "Email is required.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(attrs.email.indexOf("@") &amp;lt; 1 || attrs.email.indexOf(".") &amp;lt; 1) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "The email address appears to be invalid.";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "";&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Contact;&lt;br&gt;})(Backbone.Model);&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Jeremy, where’s the full download?&lt;/strong&gt; Sorry, right now the project is reserved for attendees at Devscovery – I may have a full project to make available after this week, but for now you can take a look at the full TypeScript source (this is the entire client application) by &lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/app.ts?attredirects=0&amp;amp;d=1" target="_blank"&gt;clicking here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Thanks! What do I think? So far my thoughts are very positive. I see this being a useful tool that enables teams to write the code they are used to, with options to add safeguards and types where necessary to avoid errors and make the code easier to organize, read, and comprehend. I’ll have to use it some more but this short project of converting an application over has me raising both thumbs up.&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=GBBWFYc0xC8:xTDMOIdTSks:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=GBBWFYc0xC8:xTDMOIdTSks:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=GBBWFYc0xC8:xTDMOIdTSks:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/GBBWFYc0xC8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/6581061058718348553/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/10/building-backbone-applications-with.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6581061058718348553?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/6581061058718348553?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/GBBWFYc0xC8/building-backbone-applications-with.html" title="Building Backbone Applications with TypeScript" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/-DYe8X-n342E/UGtaE55mYYI/AAAAAAAAAvM/wksCdkpDJhg/s72-c/backbonetypescriptexample_thumb%25255B2%25255D.png?imgmax=800" height="72" width="72" /><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/10/building-backbone-applications-with.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEcMRns8eSp7ImA9WhJbF0g.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-2399541341193587537</id><published>2012-09-27T09:18:00.001-04:00</published><updated>2012-09-27T09:21:27.571-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-27T09:21:27.571-04:00</app:edited><title>Modern Web and Desktop App Development</title><content type="html">&lt;p&gt;Free stuff! Got your attention? Read on to learn more …&lt;/p&gt; &lt;p&gt;Last year I focused on completing my book about enterprise solutions using Silverlight. Since the release of &lt;a href="http://www.amazon.com/gp/product/0321810414/ref=as_li_ss_tl?ie=UTF8&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321810414&amp;amp;linkCode=as2&amp;amp;tag=cei0e-20" target="_blank"&gt;Designing Silverlight Business Applications&lt;/a&gt;, much has changed. The book itself was well-received (currently well-rated at Amazon, thanks to my readers who take the time to leave their feedback) but the market itself shifted as executives concerned with the unclear future of Silverlight began to focus more heavily on HTML5. Technology moves fast so companies have had enough time to process the fact that HTML5 was a lot of marketing and hype but failed to deliver on the promise of writing once and running everywhere. Part of the uncertainty was compounded by the release of Windows 8 and the shift to WinRT.&lt;/p&gt; &lt;p&gt;I’ve been fortunate to have projects that have allowed me to focus on both aspects of leading edge technology. In addition to working “behind the scenes” with Wintellect founders Jeff Prosise and Jeffrey Richter on Windows 8 as it evolved over the past year, I’ve also been heavily involved in a large enterprise web-based application that is built on HTML5 technologies and follows a Single Page Application (SPA) paradigm which means lots of client-side JavaScript code. The project integrates libraries like &lt;a href="http://backbonejs.org/" target="_blank"&gt;Backbone.js&lt;/a&gt;, &lt;a href="http://requirejs.org/" target="_blank"&gt;RequireJS&lt;/a&gt;, &lt;a href="http://amplifyjs.com/" target="_blank"&gt;AmplifyJS&lt;/a&gt;, and leverages controls and MVVM features from &lt;a href="http://www.kendoui.com/" target="_blank"&gt;Kendo UI&lt;/a&gt;. We are using the latest Visual Studio 2012 and TFS Server 2012 features to manage an agile project with a large development team located literally around the world. &lt;/p&gt; &lt;p&gt;I learned the hard way that JavaScript is difficult to manage and scale almost a decade ago. It was one of the reasons I shifted to Silverlight and was delighted to discover the teams could produce quality code about 4x faster than using the traditional web stack. The focus has shifted back to JavaScript but the problem with scaling applications based on JavaScript is not unique so a number of amazing libraries and solutions have been created to make it easier to control the quality of applications that have a heavy client JavaScript component. &lt;/p&gt; &lt;p&gt;On the other side of the spectrum, as I work with companies moving their existing technologies from Silverlight and WPF to Windows 8 and smartphones, the common question is how to leverage as much of the existing codebase as possible. I’ve had plenty of experience working both with the Portable Class Library (PCL) and the team at Microsoft driving that project to help build portable assemblies that can provide 80% of the functionality required across multiple platforms without recompiling. I think the PCL is one of the least understood and most underused features of Visual Studio 2012.&lt;/p&gt; &lt;p&gt;The reason I’m sharing all of this is because I’m excited to present on both of these topics next week at Wintellect’s own &lt;a href="http://www.devscovery.com/" target="_blank"&gt;Devscovery&lt;/a&gt; conference. This is an event that is unique in many ways. First, the focus is less on presenting and more on training … it’s a subtle difference but the &lt;a href="http://www.wintellect.com/devscovery/agenda" target="_blank"&gt;sessions&lt;/a&gt; dive deep into technologies including Windows 8 and WinRT, HTML5, jQuery, JavaScript, ASP.NET MVC, .NET 4.5, C# 5, Visual Studio 2012, advanced debugging and testing, and more. You can view the full agenda &lt;a href="http://www.wintellect.com/devscovery/agenda" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;The second reason this event is unique is because of the expert presenters. It’s one of the few places you’ll find Jeffrey Richter, Jeff Prosise, and John Robbins under the same roof and not only attend sessions but meet with them one-on-one to get your questions answered. You can view the full list of presenters &lt;a href="http://www.wintellect.com/devscovery/speakers" target="_blank"&gt;here&lt;/a&gt;. Add to that a powerful &lt;a href="http://www.wintellect.com/devscovery/keynote" target="_blank"&gt;keynote&lt;/a&gt; and what’s not to like? I’ll be there as well, presenting on &lt;a href="http://www.wintellect.com/Devscov/DevscoveryScheduleDetail.aspx#d3-c1-3" target="_blank"&gt;Enterprise JavaScript&lt;/a&gt; and the &lt;a href="http://www.wintellect.com/Devscov/DevscoveryScheduleDetail.aspx#d3-c5-1" target="_blank"&gt;Portable Class Library&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I mentioned free stuff at the beginning of this blog post. &lt;a href="http://www.wintellect.com/Devscovery/Registration" target="_blank"&gt;Registration is still open&lt;/a&gt; for this event, but I realize for some it may be short notice, so I’ve got a special offer. If you can swing the travel, we can swing the entrance fee. I have two free passes to give away on a first come, first serve basis. These are for new participants who have not yet registered but are interested in attending the event. You have to be committed and able to attend, so if you think you can swing it and would like the pass, please tweet the hash tag #DevHouston12 with your pass request and the link to the agenda (&lt;a title="http://bit.ly/Pvityp" href="http://bit.ly/Pvityp" target="_blank"&gt;http://bit.ly/Pvityp&lt;/a&gt;) … for example, “I would like a pass to #DevHouston12 – check out the agenda &lt;a title="http://bit.ly/Pvityp" target="_blank" href="http://bit.ly/Pvityp"&gt;http://bit.ly/Pvityp&lt;/a&gt;” – you must include the hash tag and a link that ends up on the agenda page. Our marketing director will monitor the hash tag and the first two to tweet and verify they can attend will get the passes. &lt;/p&gt; &lt;p&gt;Thanks!&lt;/p&gt;  &lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=uJCT5-xve6M:Pg4aJVZFGhU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=uJCT5-xve6M:Pg4aJVZFGhU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=uJCT5-xve6M:Pg4aJVZFGhU:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/uJCT5-xve6M" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/2399541341193587537/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/09/modern-web-and-desktop-app-development.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2399541341193587537?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/2399541341193587537?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/uJCT5-xve6M/modern-web-and-desktop-app-development.html" title="Modern Web and Desktop App Development" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>0</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/09/modern-web-and-desktop-app-development.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08AQHo4eCp7ImA9WhJbEEw.&quot;"><id>tag:blogger.com,1999:blog-8944256652433533647.post-4038835229815046710</id><published>2012-09-18T07:47:00.000-04:00</published><updated>2012-09-18T21:57:21.430-04:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-09-18T21:57:21.430-04:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="lambda expression" /><category scheme="http://www.blogger.com/atom/ns#" term="entity framework" /><category scheme="http://www.blogger.com/atom/ns#" term="linq" /><category scheme="http://www.blogger.com/atom/ns#" term="expression tree" /><title>Entity Framework: Expressing the Missing LINQ</title><content type="html">&lt;p&gt;I have worked on quite a few projects that use the Entity Framework. It is a powerful ORM and does quite a lot out of the box. I've worked with code-first, database-first, and every other flavor in between. If I were to name the one reason I believe developers enjoy working with LINQ the most, it would be the support for LINQ via &lt;a href="http://msdn.microsoft.com/en-us/library/bb386964.aspx" target="_blank"&gt;LINQ to Entities&lt;/a&gt;.
&lt;p&gt;&lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/LinqLambdaExpression.zip?attredirects=0&amp;d=1" target="_blank"&gt;Download Source Code for this post&lt;/a&gt;
&lt;p&gt;What's not to like? You can query data in a very easy, straightforward manner that is consistent. Unfortunately, the Entity Framework can wreak havoc on an otherwise stable web application if it is not handled with care. There are a number of "gotchas" you will run into (updateable materialized views, anyone?) ranging from improper use of the context used to access the database to "features" of LINQ that can become defects in production. In this post I will focus on two very subtle LINQ problems I see people run into quite often. 
&lt;p&gt;&lt;h2&gt;It Will Be Deferred&lt;/h2&gt;
&lt;p&gt;The first is probably the easiest to understand and the fastest to catch in testing. Consider a very contrived model called &lt;code&gt;Thing&lt;/code&gt;: 
&lt;pre&gt;
public class Thing
{
    public int Id { get; set; }
    public string Value { get; set; }
}
&lt;/pre&gt;
&lt;p&gt;The code-first definition for a database of things is simple enough: 
&lt;pre&gt;
public class SampleContext : DbContext 
{
    public DbSet&amp;lt;Thing&gt; Things { get; set; }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        modelBuilder.Conventions.Remove&amp;lt;PluralizingTableNameConvention&gt;();
    }
}
&lt;/pre&gt;
&lt;p&gt;I could use an initializer to then seed the data but I got really lazy and created a controller instead that does this (not recommended for production code but will work perfectly well to illustrate the points in this blog post): 
&lt;pre&gt;
public class ThingsController : ApiController
{
    public ThingsController()
    {
        using (var context = new SampleContext())
        {
            if (context.Things.Any()) return;

            for (var x = 0; x &amp;lt; 1000; x++)
            {
                var thing = new Thing
                                {
                                    Value = Guid.NewGuid().ToString()
                                };
                context.Things.Add(thing);
            }
            context.SaveChanges();
        }

    }
}
&lt;/pre&gt;
&lt;p&gt;As you can see, I'm ensuring we have at least 1000 things to deal with. You'll notice this is an &lt;code&gt;ApiController&lt;/code&gt; that makes it very easy to expose a REST service on top of the collection. In fact, I'm going to do just that - first with a method that returns the full list: 
&lt;pre&gt;
public IEnumerable&amp;lt;Thing&gt; GetThings()
{
    using (var context = new SampleContext())
    {
        return (from thing in context.Things select thing);
    }
}
&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;Get&lt;/code&gt; convention will automatically map this to &lt;code&gt;/api/Things&lt;/code&gt; and then I can get a nice list of them by navigating to the local URL, correct? Not quite. This is the first and most common mistake made: forgetting about &lt;a href="http://msdn.microsoft.com/en-us/library/bb738633.aspx" target="_blank"&gt;deferred execution&lt;/a&gt;. The query is passed back to the controller, which faithfully tries to serialize it by enumerating the list ... only by that time, you have left the &lt;code&gt;using&lt;/code&gt; block for the context and therefore the connection is closed. This will fail every time until you find a way to force execution before disposing the context ... the easiest way is by converting it to a list like this: 
&lt;pre&gt;
public IEnumerable&amp;lt;Thing&gt; GetThings()
{
    using (var context = new SampleContext())
    {
        return (from thing in context.Things select thing).ToList();
    }
}
&lt;/pre&gt;
&lt;p&gt;Casting to a list ensures it is enumerated (and thus executed) immediately to populate the list. 
&lt;p&gt;&lt;h2&gt;Expressive Functions&lt;/h2&gt;
&lt;p&gt;The second issue is far more subtle. It is very easy to get excited about using LINQ to access your queries, and it's not uncommon to have a strategy that involves passing in filters and order clauses to your repository. Consider a basic LINQ query that looks like this: 
&lt;pre&gt;
var query = from thing
                in context.Things
            orderby thing.Value                            
            select thing;
&lt;/pre&gt;
&lt;p&gt;Now, what if you wanted to dynamically filter this based on various options? You might go down this path: 
&lt;pre&gt;
Func&amp;lt;Thing,bool&gt; filter;
&lt;/pre&gt;
&lt;p&gt;You can then assign the filter: 
&lt;pre&gt;
filter = thing =&gt; thing.Value.Contains("-e");
&lt;/pre&gt;
&lt;p&gt;And attach it to the query, execute it, then return the result: 
&lt;pre&gt;
var modifiedQuery = query.Where(filter);
return modifiedQuery.ToList();
&lt;/pre&gt;
&lt;p&gt;In fact, if you pull down the sample code from &lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/LinqLambdaExpression.zip?attredirects=0&amp;d=1" target="_blank"&gt;this link&lt;/a&gt; and use the following URL: &lt;code&gt;http://localhost:XXXX/api/Things/?useFunction=true&lt;/code&gt; you will see the result (replace XXXX with your port number), something like this: 
&lt;pre&gt;
[{"Id":229,"Value":"031662bd-14be-4562-9b34-e13ab193b112"},{"Id":330,"Value":"04a35727-9b64-4b5d-99fd-e421fe7340d7"}...]
&lt;/pre&gt; 
&lt;p&gt;If you compare this to the full result set, you'll see the filter worked fine. Many developers will be satisfied at this point and move onto other things &amp;mdash; even integration tests for the filter will likely pass. But is this doing what you want? If you are like me, you never trust the ORM. You always want to know how it is interpreting what you send so you will profile and trace and verify results. If you run a trace on the above code (in the sample project, it will write to the console in case you don't have a profiler handy) you'll find the query that is passed to SQL looks like this: 
&lt;pre&gt;
SELECT 
[Extent1].[Id] AS [Id], 
[Extent1].[Value] AS [Value]
FROM [dbo].[Thing] AS [Extent1]
ORDER BY [Extent1].[Value] ASC
&lt;/pre&gt;
&lt;p&gt;At this point you probably see the problem. We're dealing with 1000 records in this example, but what would happen if we had 1000000? The problem is the query is loading &lt;i&gt;all&lt;/i&gt; records from the database, then filtering the resulting list. No matter how clever your filter is, you are always pulling the entire table and then using LINQ to Objects to filter it in memory. Probably won't scale, you think? 
&lt;p&gt;The solution is very simple. What you created above was a function that is passed to the query. The LINQ to Entities provider doesn't know how to map a function to the database, so it handles the part it understands and then applies the function. (As a reader was kind enough to comment below, technically the filter never gets passed to the Entity Framework ... there is an extension method for expressions, but not functions, so the query is cast to an enumerable after the call to EF and then the filter is applied.) There is only one change you need to make for this to work: 
&lt;pre&gt;
Expression&amp;lt;Func&amp;lt;Thing,bool&gt;&gt; filter;
&lt;/pre&gt;
That's it! Change the definition. You can assign and execute it exactly the same way:
&lt;pre&gt;
filter = thing =&gt; thing.Value.Contains("-e");
var modifiedQuery = query.Where(filter);
return modifiedQuery.ToList();
&lt;/pre&gt;
&lt;p&gt;While the returned result is the same, the SQL is slightly different. Hit the URL &lt;code&gt;http://localhost:XXXX/api/Things?useFunction=false&lt;/code&gt; instead, and what you'll find is:
&lt;pre&gt;
SELECT 
[Extent1].[Id] AS [Id], 
[Extent1].[Value] AS [Value]
FROM [dbo].[Thing] AS [Extent1]
WHERE [Extent1].[Value] LIKE N'%-e%'
ORDER BY [Extent1].[Value] ASC
&lt;/pre&gt;
&lt;p&gt;Now the filter is being passed to SQL, so it can do what SQL is good at: filtering and ordering records. It's a subtle but important difference. In both cases, you designated the filter using a &lt;a href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" target="_blank"&gt;lambda expression&lt;/a&gt;, but the first forced it into a function whereas the second method loaded it into an &lt;a href="http://msdn.microsoft.com/en-us/library/bb335710.aspx" target="_blank"&gt;expression tree&lt;/a&gt;. The LINQ to SQL provider &lt;i&gt;does&lt;/i&gt; know how to parse an expression tree and map it to SQL, so you get the desired result by using LINQ to Entities and SQL rather than LINQ to Objects as a fallback.
&lt;p&gt;&lt;h2&gt;Summary&lt;/h2&gt; 
&lt;p&gt;The bottom line is that ORM tools make it very easy to interact with data, and even easier to have side effects that can lead to performance issues and production defects. It is very important to understand the technology you are working with and dig into the nuances of how LINQ works under the covers and the relationship between delegates, lambda expressions, and expression trees. I've heard it come up in interviews that I sometimes ask "academic" or "textbook" questions, but more often than not those questions are related to real world scenarios and knowing the answer is the difference between 20 and 1000000 records in a single database call.
&lt;p&gt;&lt;a href="https://sites.google.com/site/jeremyliknessextras/source-code/LinqLambdaExpression.zip?attredirects=0&amp;d=1" target="_blank"&gt;Download Source Code for this post&lt;/a&gt;
&lt;p&gt;&lt;a href="http://jeremylikness.com/" title="Jeremy Likness"&gt;&lt;img border="0" src="http://jeremylikness.com/signature.gif" alt="Jeremy Likness" title="Jeremy Likness"/&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;(c) 2011-2013 Jeremy Likness.&lt;/div&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=Dl8gsudRV08:-p9Dgv92Uog:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?i=Dl8gsudRV08:-p9Dgv92Uog:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/CSharperImage?a=Dl8gsudRV08:-p9Dgv92Uog:I9og5sOYxJI"&gt;&lt;img src="http://feeds.feedburner.com/~ff/CSharperImage?d=I9og5sOYxJI" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/CSharperImage/~4/Dl8gsudRV08" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://csharperimage.jeremylikness.com/feeds/4038835229815046710/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://csharperimage.jeremylikness.com/2012/09/entity-framework-expressing-missing-linq.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4038835229815046710?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/8944256652433533647/posts/default/4038835229815046710?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/CSharperImage/~3/Dl8gsudRV08/entity-framework-expressing-missing-linq.html" title="Entity Framework: Expressing the Missing LINQ" /><author><name>Jeremy Likness</name><uri>https://plus.google.com/104681642850492486855</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh3.googleusercontent.com/-zVEO4BsSOjc/AAAAAAAAAAI/AAAAAAAAAAA/ocZyKfGEY-Y/s512-c/photo.jpg" /></author><thr:total>6</thr:total><gd:extendedProperty name="commentSource" value="1" /><gd:extendedProperty name="commentModerationMode" value="FILTERED_POSTMOD" /><feedburner:origLink>http://csharperimage.jeremylikness.com/2012/09/entity-framework-expressing-missing-linq.html</feedburner:origLink></entry></feed>
