<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Fear and Loathing</title><link>http://weblogs.asp.net/bsimser/default.aspx</link><description>Gonzo blogging from the Annie Leibovitz of the software development world.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bsimser" /><feedburner:info uri="bsimser" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>50.35</geo:lat><geo:long>113.52</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license><image><url>http://www.feedburner.com/fb/images/pub/fb_pwrd.gif</url></image><feedburner:feedFlare href="http://www.plusmo.com/add?url=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://plusmo.com/res/graphics/fbplusmo.gif">Subscribe with Plusmo</feedburner:feedFlare><feedburner:feedFlare href="http://www.thefreedictionary.com/_/hp/AddRSS.aspx?http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://img.tfd.com/hp/addToTheFreeDictionary.gif">Subscribe with The Free Dictionary</feedburner:feedFlare><feedburner:feedFlare href="http://www.bitty.com/manual/?contenttype=rssfeed&amp;contentvalue=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://www.bitty.com/img/bittychicklet_91x17.gif">Subscribe with Bitty Browser</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><feedburner:feedFlare href="http://mix.excite.eu/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://image.excite.co.uk/mix/addtomix.gif">Subscribe with Excite MIX</feedburner:feedFlare><feedburner:feedFlare href="http://www.webwag.com/wwgthis.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://www.webwag.com/images/wwgthis.gif">Subscribe with Webwag</feedburner:feedFlare><feedburner:feedFlare href="http://www.podcastready.com/oneclick_bookmark.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://www.podcastready.com/images/podcastready_button.gif">Subscribe with Podcast Ready</feedburner:feedFlare><feedburner:feedFlare href="http://www.wikio.com/subscribe?url=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://www.wikio.com/shared/img/add2wikio.gif">Subscribe with Wikio</feedburner:feedFlare><feedburner:feedFlare href="http://www.dailyrotation.com/index.php?feed=http%3A%2F%2Ffeeds.feedburner.com%2Fbsimser" src="http://www.dailyrotation.com/rss-dr2.gif">Subscribe with Daily Rotation</feedburner:feedFlare><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site, subject to copyright and fair use.</feedburner:browserFriendly><item><title>Code to Interfaces. Right. What’s an Interface?</title><link>http://feedproxy.google.com/~r/bsimser/~3/BQYwTNim6oo/code-to-interfaces-right-what-s-an-interface.aspx</link><pubDate>Thu, 17 May 2012 02:48:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8490114</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8490114</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8490114</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/05/16/code-to-interfaces-right-what-s-an-interface.aspx#comments</comments><description>&lt;p&gt;The premise of coding to interfaces has been around for awhile now. The concept is simple. Given a definition of something you create things based on that definition. That might be a horrible description of an interface but I didn’t want to go all Computer Science on you.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Interface? What’s an Interface?&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Here’s a simple interface:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ICustomerService&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     IEnumerable&amp;lt;Customer&amp;gt; GetAllCustomers();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Pretty basic. We have a Customer class somewhere and this interface describes a method called GetAllCustomers that will return you a list of Customer objects.&lt;/p&gt;

&lt;p&gt;With an interface you don’t have an implementation. There’s no code here to say where we get the customers from, just that we expect this to return us a list of them.&lt;/p&gt;

&lt;p&gt;Now in our code we can write something like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DisplayAllCustomers(ICustomerService service)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var customer &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; service.GetAllCustomers())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #008000"&gt;// Output whatever customer info here&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The method here expects an object that implements the ICustomerService interface. That’s how we can build and compile this but we have yet to build an implementation of this method. Of course the code won’t run because your application doesn’t know how to create an object that implements ICustomerService.&lt;/p&gt;

&lt;p&gt;Like I said, the implementation is up to you but you’ll probably be driving it from requirements or what the user needs to see or whatever. Here’s a sample implementation:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; CustomerRepository : ICustomerService&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IEnumerable&amp;lt;Customer&amp;gt; GetAllCustomers()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; List&amp;lt;Customer&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;                     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Customer {Name = &lt;span style="color: #006080"&gt;&amp;quot;Harold&amp;quot;&lt;/span&gt;}, &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;                         &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Customer {Name = &lt;span style="color: #006080"&gt;&amp;quot;Kumar&amp;quot;&lt;/span&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;                     };&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;So if we created an object of this CustomerRepository class and passed it to the DisplayAllCustomers method above, we would output Harold and Kumar’s names (or whatever your display code was).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The $10,000 Question&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;People will stare at the code and say, why? Why create that ICustomerService and then have to go to the trouble of creating it and passing it along to the DisplayAllCustomers. More code to maintain they say. More work.&lt;/p&gt;

&lt;p&gt;Let’s try to dispel some myths here.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Coding to Interfaces is Hard&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Really? Do you understand the code above? That’s coding to an interface. Could you do that yourself? Sure you can. Let’s move on.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Coding to Interfaces Constrains Me&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It’s true. If you added the method “void AddCustomer(Customer customer)” to your inteface, you wouldn’t be able to compile your code. The CustomerRepostory class (and any other class that implemented the ICustomerService interface) would require it. Stop thinking about this as a constraint, it’s a design choice. It’s like the Architect giving you a window or door on the side of your house. You don’t go cutting open another hole because you want another window. You have to take into account load bearing walls, structural integrity, etc. which is what the Architect does (I know, I used to be one). Just because it looks good or you need it, doesn’t mean it should be done (at least in the way you might want it).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Coding to Interfaces makes you do extra work&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Yes, you have to create those interfaces so yeah, that’s extra work. Some might argue that if your implementation is simple then you’re writing double the code. Again, all true. There are benefits that will outweigh this which we’ll look at in a moment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Where are the Benefits?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s talk some benefits here. First coding to an interface is giving you a layer of abstraction. Remember that ICustomerService above? The implementation is sort of silly but shows that we can write code that does what the system intends. We could also build an implementation that reads from a database. Or Active Directory. Or SAP. Or a Web Service. Each time we write a new implementation, we don’t have to change our DIsplayAllCustomers method.&lt;/p&gt;

&lt;p&gt;That’s abstraction. You don’t have to worry in your DisplayAllCustomers method where the data came from or what infrastructure may or may not exist. All you care about is that you expect a list of customers to come back.&lt;/p&gt;

&lt;p&gt;Now multiply that by 10 or 100 and you get the benefits of abstraction against a real codebase.&lt;/p&gt;

&lt;p&gt;Some people will talk about future proofing and interfaces and while that may be a benefit down the road, and it can happen, consider it icing on the cake. Imagine if you had coded to an IEnumerable interface instead of ArrayList? Now you *might* not have to rewrite a lot of code (or any if you’re really lucky). &lt;/p&gt;

&lt;p&gt;I do believe, and have rarely seen, entire implementations changed. For example one classic is the “build a database interface so we can swap between SQL and Oracle”. You build an abstraction over a database to make it simpler to code to but not necessarily swap out technologies.&lt;/p&gt;

&lt;p&gt;Just don’t use the future proofing claim as a crutch to not code to interfaces claiming YAGNI or something. There are different reasons for this. &lt;/p&gt;

&lt;p&gt;The other big thing is testing. Going back to our CustomerRepository. It’s an in-memory representation to a list of customers. Imagine you had additional methods on your interface like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ICustomerService&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     IEnumerable&amp;lt;Customer&amp;gt; GetAllCustomers();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AddCustomer(Customer newCustomer);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; DeleteCustomer(Customer customerToDelete);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And now with your in-memory representation you can write tests that ensure items are added and deleted in your repository and the counts all match and the list comes back with the right names. Now you’re starting to test against your interface, which is a good thing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Testing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Testing frameworks will let&amp;#160; you do things like create stubs or fake implementations of the interface, without actually writing code to return actual values. Without interfaces if you tried to test the AddCustomer method in say a SQL based implementation, you would need a database, login information, test data, etc. That’s great for infrastructure tests but for unit tests it’s a lot of overhead you shouldn’t be getting into.&lt;/p&gt;

&lt;p&gt;Another benefit is getting ahead of infrastructure. Imagine if your ICustomerService is going to talk to a web service, as web service that won’t be written for another month. You could go ahead and wait for the infrastructure to show up, code concrete classes against it, and then start your testing but now you’re in the crunch to get the system done and you’re just starting your unit testing.&lt;/p&gt;

&lt;p&gt;Instead, based on requirements and perhaps UI discussions with users using paper, whiteboard, or digital wireframes, you come up with the interface. “We’re going to need to display the customer fields and oh yeah, we want to search by first and last name”. Great. From that description you can come up with an interface something like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; ICustomerService&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     IEnumerable&amp;lt;Customer&amp;gt; FindBy(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; firstName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     IEnumerable&amp;lt;Customer&amp;gt; FindBy(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; firstName, &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; lastName);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Again we can write up some implementation (maybe going against a preset list of names you import from a spreadsheet) and actually build out a working UI. The user can put their hands on it, search by names, and see the results returned. All without that pesky infrastructure. Then come the say the database gets built, you create your implementation to read it and do searches and BAM, your system is online and working end-to-end.&lt;/p&gt;

&lt;p&gt;On the testing front again, how would you test something that’s dependent on DateTime? For example you have a piece of code that ages some items in a system based on some business rules (or expires them).&lt;/p&gt;

&lt;p&gt;It’s all well and fine to start tossing around DateTime objects like this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; ExpireTest(ICustomerService service, DateTime date)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var customer &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; service.GetAllCustomers())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(customer.ContractDate &amp;gt; date)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;             ExpireContractFor(customer);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;However things get real ugly real fast. First I have to write this test and I’m sort of breaking both encapsulation and responsibility of the customer class. Maybe I should have a method on customer that takes in a DateTime object. Yuck. Now I’m passing that value into my business object which might be okay (it depends) but now consider the idea of something like this business rule:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;foreach&lt;/span&gt; (var customer &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; service.GetAllCustomers())&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;if&lt;/span&gt;(customer.ContractDate.Day == date.Day &amp;amp;&amp;amp; date.Hour &amp;gt; 12)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         ExpireContractFor(customer);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;Now I’ll only expire the contract if the date passed in is the same day as my contract and it’s after noon. Silly logic yes, but would require another test method, another date object to be passed in, etc. A lot of setup to test something and then along comes this somewhere in my Customer class:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Customer&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; DateTime ContractDate { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; AgeOfContract()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) (DateTime.Now - ContractDate).TotalDays;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Now I’m screwed, both in testing in code and testing on the site. I’m going to have to create test data with very specific dates, maybe mess around with the values (because I certainly can’t change the clock on the server) and frankly I’m going to cry.&lt;/p&gt;

&lt;p&gt;Interfaces can save you here. What if we had an interface called:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;interface&lt;/span&gt; IDateTime&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     DateTime Now { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And instead of the concrete implementation in our customer class we use the IDateTime interface. Here’s the Customer class refactored to use an interface:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Customer&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; IDateTime _dateTime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     Customer(IDateTime dateTime)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         _dateTime = dateTime;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Name { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IDateTime ContractDate { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; AgeOfContract()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;) (_dateTime.Now - ContractDate).TotalDays;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Yes, there’s more that needs to be here like how an IDateTime can subtract values from each other, return a TImeSpan object, etc. but this is just for concepts.&lt;/p&gt;

&lt;p&gt;With the interface added, I’m now abstracted away from the concrete implementation of DateTime hard coded into my Customer class. I’ll pass in something that might implement DateTime to return some real time but for testing I can set it to anything I want.&lt;/p&gt;

&lt;p&gt;Testing is easier now and I don’t have to change my domain logic to deal with responsibilities outside of my concerns.&lt;/p&gt;

&lt;p&gt;Interfaces vs. Classes is the kind of thing to start holy flame wars. Some argue it adds extra code/work to the developer, others claim it unnecessarily future-proofs your app (aka YAGNI) and others think it makes for easier testing and abstraction away from things that have yet to come.&lt;/p&gt;

&lt;p&gt;I like to live in the latter world where I build my systems loosely coupled but tightly integrated. Interfaces provide me that ability. I hope this article sheds some light on the subject for you, whatever you choose.&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8490114" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J_cApbPEQsz4VPwzuGWO1OpkxjM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J_cApbPEQsz4VPwzuGWO1OpkxjM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J_cApbPEQsz4VPwzuGWO1OpkxjM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J_cApbPEQsz4VPwzuGWO1OpkxjM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=BQYwTNim6oo:088hOSLRj8E:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=BQYwTNim6oo:088hOSLRj8E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=BQYwTNim6oo:088hOSLRj8E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=BQYwTNim6oo:088hOSLRj8E:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Agile/default.aspx">Agile</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/C_2300_/default.aspx">C#</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/05/16/code-to-interfaces-right-what-s-an-interface.aspx</feedburner:origLink></item><item><title>Getting Started with ASP.NET MVC 3, Logging, and Depency Injection</title><link>http://feedproxy.google.com/~r/bsimser/~3/1Ijaj6P5Uog/getting-started-with-asp-net-mvc-3-logging-and-depency-injection.aspx</link><pubDate>Wed, 16 May 2012 01:35:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8484043</guid><dc:creator>Bil Simser</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8484043</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8484043</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/05/15/getting-started-with-asp-net-mvc-3-logging-and-depency-injection.aspx#comments</comments><description>&lt;p&gt;I started a new ASP.NET MVC project recently and wanted to give you a little insight on kicking off new projects. There’s some setup time you want to spend setting up your solution and getting the plumbing in order before you dive into writing unit tests and building out your site. &lt;/p&gt;  &lt;p&gt;For a full on, blow my mind, ultimate guide you *have* to go watch &lt;a href="http://blog.wekeroad.com/"&gt;Rob Conery&lt;/a&gt; and his 90 minute walkthrough of setting up his MVC projects. I’ve watched this video a few times and Rob is awesome and knows his stuff. The tips he gives are gold. You can also check out the &lt;a href="http://mvc3starter.codeplex.com/"&gt;MVC 3 Starter Kit&lt;/a&gt; on CodePlex which is based on his &lt;a href="http://mvcstarter.codeplex.com/"&gt;MVC 2 Starter&lt;/a&gt; code but I found it was lacking a few features. In any case, go watch his video for the full meal deal either &lt;a href="http://youtu.be/U_Y2IJd2HjE"&gt;here on YouTube&lt;/a&gt; or &lt;a href="http://tekpub.com/view/dotnet-oss/4"&gt;here on TekPub&lt;/a&gt;. This post is just a mere shadow of his work but updates the use of Ninject with MVC 3.&lt;/p&gt;  &lt;p&gt;Okay, so we’re going to be doing some simple plumbing to get this going. We’ll put together the Hello World MVC 3 app, add in a logging system, and plumb in dependency injection in just a few minutes.&lt;/p&gt;  &lt;p&gt;You’ll need Visual Studio 2010 with MVC 3 and NuGet installed. You can get MVC 3 from the main site &lt;a href="http://www.asp.net/mvc/mvc3"&gt;here&lt;/a&gt;. Next install NuGet from &lt;a href="http://nuget.org/"&gt;here&lt;/a&gt;. The MVC 3 framework is obviously needed (Visual Studio 2010 only comes with MVC 2 out of the box) and NuGet is used to install our additional libraries (trust me, if you haven’t used NuGet before it will blow your mind).&lt;/p&gt;  &lt;p&gt;First steps is to build a new MVC 3 app. File &amp;gt; New Project. Then select Visual C# &amp;gt; Web &amp;gt; ASP.NET MVC 3 Application and give it a name.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_221D877F.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_67C2119D.png" width="502" height="347" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Click OK and you’ll see the options dialog for a new MVC 3 Application.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_146ACB77.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_3E6AC99F.png" width="502" height="453" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Pick Internet application as it will work for most everyone (Windows authentication works fine too but for this post it’s just easier to go with Internet). Let’s choose Razor for the view engine (ASPX is so 2011) and use HTML 5 markup (hey, it’s just a demo). We won’t create a unit test project but in a real project you’ll create one (or create a class library separately so you can use other unit testing frameworks). &lt;/p&gt;  &lt;p&gt;We’re creating a project based on the template to give us a controller as we’ll inject our dependency into it later, otherwise we would have to create those. In a real project we might start with an empty template and create our own controllers from scratch (again, demo land, remember?).&lt;/p&gt;  &lt;p&gt;Once you do that you’ll be at the Hello World project of the MVC world.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_5D413D7D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_436D074E.png" width="247" height="258" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Okay, now we’re going to install two NuGet packages, &lt;a href="http://www.ninject.org/"&gt;Ninject&lt;/a&gt; and &lt;a href="http://nlog-project.org/"&gt;NLog&lt;/a&gt;. Ninject is an open source dependency injection framework and makes working with external dependencies (like infrastructure and services) a breeze. NLog is a free logging solution for .NET and allows you to write anything to almost any target including files, event logs, web services, mail, forms. You name it, it can write to it. I was using log4net for all my projects but lately I’ve switched over to NLog. It’s super-simple to use and highly flexible. Did I mention it’s available as a NuGet package?&lt;/p&gt;  &lt;p&gt;Right click on the References in your project and choose Manage NuGet Packages…&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_4294A164.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_28C06B35.png" width="350" height="206" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Make sure you’re looking at the Online packages (sometimes the dialog will open up to installed packages or updatable ones). Type in “nlog” into the search box and you’ll see the filtered search results. Choose NLog Configuration from the options. If you already had a log configuration file you can just choose NLog to install the logger but since we’re starting from scratch we need a config file to start with. Selecting NLog Configuration and you’ll see it has a dependency on NLog so you can just install the one package which installs a starter config file and then drags along the library with it. Easy.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_60FEE24D.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_5FBA496E.png" width="502" height="335" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Once you’ve installed NLog you can enter “ninject” in the search box. This will bring up a list of packages for the dependency injection library Ninject by Nate Kohari. You’ll want to install the Ninject.MVC3 package by Remo Gloor and Ian Davis. This package will install Ninject itself and the extensions for MVC 3 (along with the bootstrapper for web projects. Ninject requires you to review and accept the license agreement before it will install so go ahead and do that.&lt;/p&gt;  &lt;p&gt;Two packages and all of their dependencies but you’re now only a few minutes (yes, minutes) away from dependency injection heaven and MVC 3.&lt;/p&gt;  &lt;p&gt;The first thing we’re going to do is create an interface that will be our logging system. We have a logger (NLog) but that’s an implementation and while we could scatter NLog statements all over the place, we would be tied directly to that library. If we decided to phase out NLog and replace it with another library (such as how I’ve shifted from log4net to NLog) we would have to go through everywhere in our code and replace the NLog calls with the next best thing.&lt;/p&gt;  &lt;p&gt;This the one of the principles of dependency injection, abstraction, and SOLID. Creating an abstraction of an implementation to code against without tying ourselves to any one system (so to speak). At the end of the day we’ll still be calling into NLog functions but we’ll be doing it through an implementation class via our interface.&lt;/p&gt;  &lt;p&gt;The other key thing about this approach is that we we can mock or stub out the actual implementation of our logger for unit testing. You can really do that (very well) with concrete implementations. Imagine having to start up a database, file system logger, and the Windows Event log service just to unit test some business code.&lt;/p&gt;  &lt;p&gt;In addition to being able to test our code, we can also code to interfaces meaning that we don’t need the actual implementation until it comes time to actually perform the work. For example the project I’m currently working on is going to require to call out to web services and databases. These components are not built yet and won’t be for another month or so. I don’t want to halt the development of my app so I create service interfaces and repositories that will abstract these away from my system, allowing me to build a fully working (and tested) system (which just happens to use hard coded values for now). Later when those services appear I just build an implementation to talk to them and voila, my system is still working exactly the way it does today.&lt;/p&gt;  &lt;p&gt;Okay, enough talk. Here’s the interface for our logging system. I’m borrowing from Rob’s approach by creating a folder called Infrastructure with a subfolder called Logging. In it I’ll create an ILogger interface that will let me write an information message (most logging systems have various levels of logging like Information, Warning, Errors, etc.)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_5E75B08F.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_56EA4122.png" width="167" height="59" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And here’s my ILogger interface:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; MvcStarter.Infrastructure.Logging&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public interface&lt;/span&gt; ILogger&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Info(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Next we need an implementation. We’ll create one for NLog. This is a simple class that implements ILogger and provides the Info method (along with the setup needed for NLog to work). Here’s the NLogLogger class:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 240px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; NLog;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; MvcStarter.Infrastructure.Logging&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NLogLogger : ILogger&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; Logger _logger;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; NLogLogger()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;             _logger = LogManager.GetCurrentClassLogger();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;  &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Info(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; message)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;             _logger.Info(message);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;We create a private variable of type NLog.Logger and create it in our constructor using the LogManager from NLog. Then to write using NLog we just call the Info method on the class, passing it our message.&lt;/p&gt;

&lt;p&gt;There are a lot of other methods we can call and add to our interface so later maybe we’ll extend that but this is enough to get you started.&lt;/p&gt;

&lt;p&gt;One more thing is that the default config file that was installed with the package is just that, blank. You need to tell it at least what target to use and what rules to apply to each target. The entire config file is documented online but you can just uncomment the sample implementation. Make sure to match up the logger rule (Trace in the config file) with your method you’re calling in the implementation. I just changed the minLevel of the NLog config file from Trace to Info to match our code.&lt;/p&gt;

&lt;p&gt;That’s all you need to have logging working but how do we call it? And how does Ninject fit in?&lt;/p&gt;

&lt;p&gt;Back when we installed Ninject it created a file for us. Go back to your project and check out the App_Start folder. Expand it and you’ll see a new file there called NinjectWebCommon.cs&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_4B5483E3.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_5CC4E4BB.png" width="227" height="112" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This sucker is responsible for kickstarting Ninject for you. If you watched Rob’s video or saw some tutorials on the net they talk about changing the base HttpApplication to a Ninject one. That’s one approach but with MVC 3 and the NuGet package this way is much simpler. There’s nothing for you to do except tell Ninject what dependencies you want to deal with and how to resolve them. &lt;/p&gt;

&lt;p&gt;Open up NinjectWebCommon.cs and scroll down to the RegisterServices method. This is where you’ll specify you own interfaces and concrete classes so Ninject can do it’s magic.&lt;/p&gt;



















&lt;p&gt;With a single line we’re going to tell Ninject this:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #008000"&gt;/// Load your modules or register your services here!&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt; &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #008000"&gt;/// &amp;lt;param name=&amp;quot;kernel&amp;quot;&amp;gt;The kernel.&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; RegisterServices(IKernel kernel)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     kernel.Bind&amp;lt;ILogger&amp;gt;().To&amp;lt;NLogLogger&amp;gt;().InSingletonScope();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt; }        &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;What are we saying here? Simple. We’re telling Ninject to:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Whenever you see the ILogger interface needed (e.g. passed into a constructor of a class)&lt;/li&gt;

  &lt;li&gt;Resolve to the NLogLogger class&lt;/li&gt;

  &lt;li&gt;Make it a singleton (i.e. only do it once and reuse it over and over again)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’re making our logger a singleton because we don’t need to start NLog every time we want to log a message. You can also specify other scopes (like by thread or on demand) but for logging a singleton works.&lt;/p&gt;

&lt;p&gt;Oh yeah, that’s it to hook up your dependency injection engine. And logging is ready to go.&lt;/p&gt;

&lt;p&gt;Let’s give it a whirl. Crack open the HomeController class and add a constructor that takes in an ILogger interface then using that interface, write out a message when the Index method is called (i.e. our home page is visited). Here’s the modified HomeController class:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; height: 280px; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Mvc;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; MvcStarter.Infrastructure.Logging;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; MvcStarter.Controllers&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; HomeController : Controller&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; ILogger _logger;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum10"&gt;  10:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; HomeController(ILogger logger)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum11"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum12"&gt;  12:&lt;/span&gt;             _logger = logger;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum13"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum14"&gt;  14:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum15"&gt;  15:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult Index()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum16"&gt;  16:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum17"&gt;  17:&lt;/span&gt;             ViewBag.Message = &lt;span style="color: #006080"&gt;&amp;quot;Welcome to ASP.NET MVC!&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum18"&gt;  18:&lt;/span&gt;             _logger.Info(&lt;span style="color: #006080"&gt;&amp;quot;Home page visited&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum19"&gt;  19:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum20"&gt;  20:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum21"&gt;  21:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum22"&gt;  22:&lt;/span&gt;         &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ActionResult About()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum23"&gt;  23:&lt;/span&gt;         {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum24"&gt;  24:&lt;/span&gt;             &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; View();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum25"&gt;  25:&lt;/span&gt;         }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum26"&gt;  26:&lt;/span&gt;     }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum27"&gt;  27:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;We add an ILogger interface to the constructor. This trigger Ninject to figure out what implementation to grab (our NLogLogger one) and create it for us (or reuse it since we told it we wanted a singleton). Then we use that implementation in our Index() method to log a message.&lt;/p&gt;

&lt;p&gt;Compile and run the app to visit the home page of your app and you’ll see this in your log:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; 2012-05-15 19:18:38.8471 INFO Home page visited&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;That’s it. You have a logging system you can call anytime (just inject the interface into the class, Ninject will take care of the rest) and your project is setup with dependency injection and you’re ready to go. Now you can just add additional interfaces as you need them.&lt;/p&gt;

&lt;p&gt;The awesome thing here is that a) you can now mock or stub out your logging implementation and test it and b) replace that implementation with some other logger any time and your code will still just work.&lt;/p&gt;

&lt;p&gt;That’s the power of dependency injection.&lt;/p&gt;

&lt;p&gt;As a bonus piece of information, now that you have the dependency injection setup you can use it any time in case you’re in a pinch and don’t need/want to inject the implementation into your class.&lt;/p&gt;

&lt;p&gt;Here’s how you can call the logger from your Application_Start method (found in Global.asax.cs) before any controllers are fired up:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum1"&gt;   1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Application_Start()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum2"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum3"&gt;   3:&lt;/span&gt;     AreaRegistration.RegisterAllAreas();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum4"&gt;   4:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum5"&gt;   5:&lt;/span&gt;     RegisterGlobalFilters(GlobalFilters.Filters);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum6"&gt;   6:&lt;/span&gt;     RegisterRoutes(RouteTable.Routes);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum7"&gt;   7:&lt;/span&gt;&amp;#160; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum8"&gt;   8:&lt;/span&gt;     DependencyResolver.Current.GetService&amp;lt;ILogger&amp;gt;().Info(&lt;span style="color: #006080"&gt;&amp;quot;Application Started&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: white; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060" id="lnum9"&gt;   9:&lt;/span&gt; }&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;See that last line? DependencyResolver.Current.GetService will use whatever IoC you have configured and return the implementation of that interface.&lt;/p&gt;

&lt;p&gt;Okay, that’s enough to get started. Again, I encourage you to watch Rob’s *entire* video of setting up a new MVC project. Even though the video is for MVC 2, there are still a lot of idea that hold water in MVC 3 and it’s a great learning too (and free too).&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8484043" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0UJdcjb1kcs8rqopZ_xFDUoLUQQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0UJdcjb1kcs8rqopZ_xFDUoLUQQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0UJdcjb1kcs8rqopZ_xFDUoLUQQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0UJdcjb1kcs8rqopZ_xFDUoLUQQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1Ijaj6P5Uog:XEFYL3BnLhY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1Ijaj6P5Uog:XEFYL3BnLhY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1Ijaj6P5Uog:XEFYL3BnLhY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1Ijaj6P5Uog:XEFYL3BnLhY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/NuGet/default.aspx">NuGet</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/MVC/default.aspx">MVC</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/05/15/getting-started-with-asp-net-mvc-3-logging-and-depency-injection.aspx</feedburner:origLink></item><item><title>Broken Windows Phone Marketplace</title><link>http://feedproxy.google.com/~r/bsimser/~3/J7rP00bLylM/broken-windows-phone-marketplace.aspx</link><pubDate>Wed, 25 Apr 2012 23:46:28 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8409956</guid><dc:creator>Bil Simser</dc:creator><slash:comments>6</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8409956</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8409956</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/04/25/broken-windows-phone-marketplace.aspx#comments</comments><description>&lt;p&gt;Recently the Windows Phone Developer Team posted an article about how App Insights work and specifically &lt;a href="http://create.msdn.com/en-US/education/catalog/article/app-insights-part-one"&gt;how Free, Top, and New apps work&lt;/a&gt;. It’s all accurate, a good read, and (to an extent) will help you improve your app’s ranking in the Marketplace list.&lt;/p&gt;  &lt;p&gt;However there continues to exist a few underlying problems with the Marketplace, specifically for independent app and game developers, that has yet to be fixed. This isn’t the first time someone brought this and I blogged about it &lt;a href="http://weblogs.asp.net/bsimser/archive/2011/02/13/pet-peeves-with-the-windows-phone-7-marketplace.aspx"&gt;over a year ago&lt;/a&gt; when the Marketplace had about 10,000 apps. There’s even a user voice item to &lt;a href="http://wpdev.uservoice.com/forums/110711-app-hub-marketplace/suggestions/1739465-show-a-paid-app-w-a-trial-option-in-the-free-a"&gt;show trial apps that you can vote on&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;While I hate being a “this is broken” it seems that if you don’t call people out on things, they just let them linger and hope someone else fixes them. This is somewhat like the &lt;a href="http://en.wikipedia.org/wiki/Broken_windows_theory"&gt;broken windows theory&lt;/a&gt; that breaking a few windows in a building and not repairing them leads to more disrepair which then spreads to other areas. The idea is to fix a broken window when you see it and keep things fresh and working. To me, most of these broken windows have been in the Marketplace since day one and in some cases, new ones have appeared since the launch of the web-based Marketplace.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Apps vs. Games&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This is probably the biggest issue, next to the XBox LIVE one below. When I visit the Marketplace on the web I see this listed for Apps:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_69F62DB7.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_169EE791.png" width="400" height="276" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;And here’s the home page listing for games:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_0EA7452F.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_3F5A4CDA.png" width="400" height="278" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That’s all well and dandy but what if I click on the “Top” filter under Apps. This is what I see:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_79D54CAE.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_118C8415.png" width="400" height="287" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;No, that isn’t a Photoshop with a mislabelled title. It really is the “Top” listing of apps.&lt;/p&gt;  &lt;p&gt;Even though apps and games appear separated, they still get lumped together when you view the “Top” listing (because in the grand scheme of things, Angry Birds is way more popular than YouTube or Facebook).&lt;/p&gt;  &lt;p&gt;To me this is wrong. Games have their own grouping. In fact they even have an entire page to themselves:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_625A987D.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_4741C96F.png" width="400" height="243" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So why are they being lumped into the Top rankings for Apps?&lt;/p&gt;  &lt;p&gt;It gets even worse when you click on Apps from the home page to view all of the app and their sub-categories then click on the Top listing for Apps:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_2C952D56.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_1586AC1A.png" width="400" height="228" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Yes, that’s the Top “Apps” in the all category. Is there a single app in that list? No, you have to scroll down (at least in my marketplace, every marketplace ranking is different) to the 12th icon before it’s an actual app (which is then followed by another 8 games before getting to the 2nd top app).&lt;/p&gt;  &lt;p&gt;So basically “Top” apps and games is broken. Plain and simple. If you build a kick-ass app that rises to the top don’t hold your breath to hope it will appear in the “all top” listings because you need to climb above all the XBox live games first. With a separation on the site of Apps vs. Games, this is unacceptable.&lt;/p&gt;  &lt;p&gt;Suggestion: If you go the distance to separate Apps vs. Games (like you have done) then go the distance and keep them separated. Don’t show me XBox LIVE titles when I’m asking for the Top Apps.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;XBox LIVE&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;This brings us to the second most annoying “feature”. The Games section of the Marketplace offers a new “XBox LIVE” tab. This will filter out indie games and only show you ones that have been created by Microsoft and other studios for XBox LIVE (i.e. they get to participate in the official achievements and points system).&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_1037C569.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_194450EA.png" width="400" height="305" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That’s great if you’re looking for an XBox LIVE title. Just click on it and boom, Bob’s yer uncle.&lt;/p&gt;  &lt;p&gt;However why do I see this when I click on the Top games:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_10E07B93.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_5CCBDC3F.png" width="400" height="315" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Yes kids, just like how these titles bubble up to the “top” of the app listing, they also bubble up to the top of the game listing.&lt;/p&gt;  &lt;p&gt;Unfair? You betcha. XBL have a tab of their very own and right now there’s only a few dozen titles. So why in the name of all that is holy are you injecting XBox LIVE titles in to the Free, Top, and New tabs? &lt;/p&gt;  &lt;p&gt;Okay, I get it. How would you sort out XBL free, top, and new titles from each other? Fair question but since you have a tab of your very own for XBox LIVE why not go the extra distance and have a Free, Top and New tab or filter for just XBL titles.&lt;/p&gt;  &lt;p&gt;In other words, an indie game developer has a snowballs chance in Hell of getting into the Top listing for games (or apps for that matter) when trying to face off against the juggernaut of Microsoft Game Studio titles. Of the *Top* 20 games in all categories, only 1 is a non-XBL title.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Suggestion: Please keep XBL titles out of the filtering from the rest of the games. If you give them a sandbox to play in like you did, then let them play there and stop peeing in our sandbox.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Trial&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The third issue here is that of Trial visibility. Do you know how to see if an app or game has a trial version? Click on the details for each individual title and you’ll see it on the page under the price:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_344CFA2B.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_2BE924D4.png" width="279" height="417" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There it is. On Each. Individual. Page.&lt;/p&gt;  &lt;p&gt;So trying to browse to see what’s a trial vs. not isn’t possible. The system knows they’re trials but they won’t tell you until you look at each individual one.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Suggestion: Include a Trial tab or filter or search box or something. Let us see what’s available as a Trial without having to drill into each title.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;To me, the Marketplace is broken on a few levels and it’s difficult (if not almost impossible) for people to get visibility above the AAA titles. Here’s hopes that Microsoft might be listening again and perhaps look into it. If you don’t agree things are broken then just consider me the crazy white dude on the corner yelling about doom and gloom and move on. If you do agree, voice your opinion as comments, tweet this, blog about it, whatever. Lets see if we can instigate change.&lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8409956" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WP7THs9EYE6dG9psYlnbMQosrBs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WP7THs9EYE6dG9psYlnbMQosrBs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WP7THs9EYE6dG9psYlnbMQosrBs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WP7THs9EYE6dG9psYlnbMQosrBs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=J7rP00bLylM:4xOlDh302J8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=J7rP00bLylM:4xOlDh302J8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=J7rP00bLylM:4xOlDh302J8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=J7rP00bLylM:4xOlDh302J8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/WP7/default.aspx">WP7</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/04/25/broken-windows-phone-marketplace.aspx</feedburner:origLink></item><item><title>Farseer tutorial for the absolute beginners</title><link>http://feedproxy.google.com/~r/bsimser/~3/x4lNzYzf12I/farseer-tutorial-for-the-absolute-beginners.aspx</link><pubDate>Fri, 13 Apr 2012 23:38:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8389578</guid><dc:creator>Bil Simser</dc:creator><slash:comments>1</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8389578</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8389578</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/04/13/farseer-tutorial-for-the-absolute-beginners.aspx#comments</comments><description>&lt;p&gt;This post is inspired (and somewhat a direct copy) of a couple of posts &lt;a href="http://www.emanueleferonato.com/"&gt;Emanuele Feronato&lt;/a&gt; &lt;a href="http://www.emanueleferonato.com/2009/01/27/box2d-tutorial-for-the-absolute-beginners/"&gt;wrote back in 2009&lt;/a&gt; about Box2D (his tutorial was ActionScript 3 based for Box2D, this is C# XNA for the &lt;a href="http://farseerphysics.codeplex.com/"&gt;Farseer Physics Engine&lt;/a&gt;).&lt;/p&gt;  &lt;p&gt;Here’s what we’re building:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/farseer01_19CCBC35.png"&gt;&lt;img style="display: inline" title="farseer01" alt="farseer01" src="http://weblogs.asp.net/blogs/bsimser/farseer01_thumb_6A9AD09D.png" width="360" height="600" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What is Farseer&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The &lt;a href="http://farseerphysics.codeplex.com/"&gt;Farseer Physics Engine&lt;/a&gt; is a collision detection system with realistic physics responses to help you easily create simple hobby games or complex simulation systems. Farseer was built as a .NET version of Box2D (based on the Box2D.XNA port of Box2D). While the constructs and syntax has changed over the years, the principles remain the same.&lt;/p&gt;  &lt;p&gt;This tutorial will walk you through exactly what Emanuele create for Flash but we’ll be doing it using C#, XNA and the Windows Phone platform.&lt;/p&gt;  &lt;p&gt;The first step is to &lt;a href="http://farseerphysics.codeplex.com/releases/view/64108#DownloadId=226767"&gt;download the library&lt;/a&gt; from its home on CodePlex. If you have NuGet installed, you can install the library itself using &lt;a href="http://nuget.org/packages/FarseerPhysicsXNAWP7"&gt;the NuGet package&lt;/a&gt; that but we’ll also be using some code from the Samples source that can only be obtained by downloading the library.&lt;/p&gt;  &lt;p&gt;Once you download and unpacked the zip file into a folder and open the solution, this is what you will get:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_70757436.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_0179A21A.png" width="253" height="511" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The Samples XNA WP7 project (and content) have all the demos for Farseer. There’s a wealth of info here and great examples to look at to learn. The Farseer Physics XNA WP7 project contains the core libraries that do all the work. DebugView XNA contains an XNA-ready class to let you view debug data and information in the game draw loop (which you can copy into your project or build the source and reference the assembly).&lt;/p&gt;  &lt;p&gt;The downloaded version has to be compiled as it’s only available in source format so you can do that now if you want (open the solution file and rebuild everything). If you’re using the NuGet package you can just install that. We only need the core library and we’ll be copying in some code from the samples later.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Your first Farseer experiment&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Start Visual Studio and create a new project using the Windows Phone template can call it whatever you want.&lt;/p&gt;  &lt;p&gt;It’s time to edit Game1.cs&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:9D7513F9-C04C-4721-824A-2B34F0212519:4c6932bd-8ffd-4fce-bca1-48ee900a45cd" class="wlWriterEditableSmartContent"&gt;&lt;pre style=" width: 600px; height: 479px;background-color:#FFFF80;overflow: auto;;font-family:Consolas;font-size:9.75"&gt;&lt;div&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;span style="color: #008080;"&gt;  1&lt;/span&gt; &lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;class&lt;/span&gt;&lt;span style="color: #000000;"&gt; Game1 : Game
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  2&lt;/span&gt; &lt;span style="color: #000000;"&gt;{
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  3&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;readonly&lt;/span&gt;&lt;span style="color: #000000;"&gt; GraphicsDeviceManager _graphics;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  4&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; DebugViewXNA _debugView;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  5&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; Body _floor;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  6&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; SpriteBatch _spriteBatch;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  7&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;float&lt;/span&gt;&lt;span style="color: #000000;"&gt; _timer;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  8&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;private&lt;/span&gt;&lt;span style="color: #000000;"&gt; World _world;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;  9&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 10&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;public&lt;/span&gt;&lt;span style="color: #000000;"&gt; Game1()
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 11&lt;/span&gt; &lt;span style="color: #000000;"&gt;    {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 12&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _graphics &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; GraphicsDeviceManager(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;this&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 13&lt;/span&gt; &lt;span style="color: #000000;"&gt;                        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 14&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            PreferredBackBufferHeight &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;800&lt;/span&gt;&lt;span style="color: #000000;"&gt;,
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 15&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            PreferredBackBufferWidth &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;480&lt;/span&gt;&lt;span style="color: #000000;"&gt;,
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 16&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            IsFullScreen &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 17&lt;/span&gt; &lt;span style="color: #000000;"&gt;                        };
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 18&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 19&lt;/span&gt; &lt;span style="color: #000000;"&gt;        Content.RootDirectory &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;Content&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 20&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 21&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Frame rate is 30 fps by default for Windows Phone.&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 22&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        TargetElapsedTime &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TimeSpan.FromTicks(&lt;/span&gt;&lt;span style="color: #800080;"&gt;333333&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 23&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 24&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Extend battery life under lock.&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 25&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        InactiveSleepTime &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; TimeSpan.FromSeconds(&lt;/span&gt;&lt;span style="color: #800080;"&gt;1&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 26&lt;/span&gt; &lt;span style="color: #000000;"&gt;    }
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 27&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 28&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;protected&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; LoadContent()
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 29&lt;/span&gt; &lt;span style="color: #000000;"&gt;    {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 30&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Create a new SpriteBatch, which can be used to draw textures.&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 31&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        _spriteBatch &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; SpriteBatch(_graphics.GraphicsDevice);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 32&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 33&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Load our font (DebugViewXNA needs it for the DebugPanel)&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 34&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        Content.Load&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;SpriteFont&lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;(&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #800000;"&gt;font&lt;/span&gt;&lt;span style="color: #800000;"&gt;&amp;quot;&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 35&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 36&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Create our World with a gravity of 10 vertical units&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 37&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_world &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 38&lt;/span&gt; &lt;span style="color: #000000;"&gt;        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 39&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _world &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; World(Vector2.UnitY&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #800080;"&gt;10&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 40&lt;/span&gt; &lt;span style="color: #000000;"&gt;        }
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 41&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;else&lt;/span&gt;&lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 42&lt;/span&gt; &lt;span style="color: #000000;"&gt;        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 43&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _world.Clear();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 44&lt;/span&gt; &lt;span style="color: #000000;"&gt;        }
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 45&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 46&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_debugView &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;null&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 47&lt;/span&gt; &lt;span style="color: #000000;"&gt;        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 48&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _debugView &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; DebugViewXNA(_world);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 49&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 50&lt;/span&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; default is shape, controller, joints
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 51&lt;/span&gt; &lt;span style="color: #008000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; we just want shapes to display&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 52&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;            _debugView.RemoveFlags(DebugViewFlags.Controllers);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 53&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _debugView.RemoveFlags(DebugViewFlags.Joint);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 54&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 55&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _debugView.LoadContent(GraphicsDevice, Content);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 56&lt;/span&gt; &lt;span style="color: #000000;"&gt;        }
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 57&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 58&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Create and position our floor&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 59&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        _floor &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; BodyFactory.CreateRectangle(
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 60&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _world,
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 61&lt;/span&gt; &lt;span style="color: #000000;"&gt;            ConvertUnits.ToSimUnits(&lt;/span&gt;&lt;span style="color: #800080;"&gt;480&lt;/span&gt;&lt;span style="color: #000000;"&gt;),
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 62&lt;/span&gt; &lt;span style="color: #000000;"&gt;            ConvertUnits.ToSimUnits(&lt;/span&gt;&lt;span style="color: #800080;"&gt;50&lt;/span&gt;&lt;span style="color: #000000;"&gt;),
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 63&lt;/span&gt; &lt;span style="color: #000000;"&gt;            10f);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 64&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _floor.Position &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; ConvertUnits.ToSimUnits(&lt;/span&gt;&lt;span style="color: #800080;"&gt;240&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;775&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 65&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _floor.IsStatic &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;true&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 66&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _floor.Restitution &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0.2f&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 67&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _floor.Friction &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0.2f&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 68&lt;/span&gt; &lt;span style="color: #000000;"&gt;    }
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 69&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 70&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;protected&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Update(GameTime gameTime)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 71&lt;/span&gt; &lt;span style="color: #000000;"&gt;    {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 72&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Allows the game to exit&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 73&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (GamePad.GetState(PlayerIndex.One).Buttons.Back &lt;/span&gt;&lt;span style="color: #000000;"&gt;==&lt;/span&gt;&lt;span style="color: #000000;"&gt; ButtonState.Pressed)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 74&lt;/span&gt; &lt;span style="color: #000000;"&gt;            Exit();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 75&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 76&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Create a random box every second&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 77&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        _timer &lt;/span&gt;&lt;span style="color: #000000;"&gt;+=&lt;/span&gt;&lt;span style="color: #000000;"&gt; (&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;float&lt;/span&gt;&lt;span style="color: #000000;"&gt;) gameTime.ElapsedGameTime.TotalSeconds;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 78&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;if&lt;/span&gt;&lt;span style="color: #000000;"&gt; (_timer &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;1.0f&lt;/span&gt;&lt;span style="color: #000000;"&gt;)
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 79&lt;/span&gt; &lt;span style="color: #000000;"&gt;        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 80&lt;/span&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Reset our timer&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 81&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;            _timer &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; 0f;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 82&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 83&lt;/span&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Determine a random size for each box&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 84&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;            var random &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Random();
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 85&lt;/span&gt; &lt;span style="color: #000000;"&gt;            var width &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; random.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;20&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;100&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 86&lt;/span&gt; &lt;span style="color: #000000;"&gt;            var height &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; random.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;20&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;100&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 87&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 88&lt;/span&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Create it and store the size in the user data&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 89&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;            var box &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; BodyFactory.CreateRectangle(
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 90&lt;/span&gt; &lt;span style="color: #000000;"&gt;                _world,
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 91&lt;/span&gt; &lt;span style="color: #000000;"&gt;                ConvertUnits.ToSimUnits(width),
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 92&lt;/span&gt; &lt;span style="color: #000000;"&gt;                ConvertUnits.ToSimUnits(height),
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 93&lt;/span&gt; &lt;span style="color: #000000;"&gt;                10f,
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 94&lt;/span&gt; &lt;span style="color: #000000;"&gt;                &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;new&lt;/span&gt;&lt;span style="color: #000000;"&gt; Point(width, height));
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 95&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 96&lt;/span&gt; &lt;span style="color: #000000;"&gt;            box.BodyType &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; BodyType.Dynamic;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 97&lt;/span&gt; &lt;span style="color: #000000;"&gt;            box.Restitution &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0.2f&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 98&lt;/span&gt; &lt;span style="color: #000000;"&gt;            box.Friction &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #800080;"&gt;0.2f&lt;/span&gt;&lt;span style="color: #000000;"&gt;;
&lt;/span&gt;&lt;span style="color: #008080;"&gt; 99&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;100&lt;/span&gt; &lt;span style="color: #000000;"&gt;            &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Randomly pick a location along the top to drop it from&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;101&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;            box.Position &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; ConvertUnits.ToSimUnits(random.Next(&lt;/span&gt;&lt;span style="color: #800080;"&gt;50&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;400&lt;/span&gt;&lt;span style="color: #000000;"&gt;), &lt;/span&gt;&lt;span style="color: #800080;"&gt;0&lt;/span&gt;&lt;span style="color: #000000;"&gt;);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;102&lt;/span&gt; &lt;span style="color: #000000;"&gt;        }
&lt;/span&gt;&lt;span style="color: #008080;"&gt;103&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;104&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Advance all the elements in the world&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;105&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        _world.Step(Math.Min((&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;float&lt;/span&gt;&lt;span style="color: #000000;"&gt;) gameTime.ElapsedGameTime.TotalMilliseconds&lt;/span&gt;&lt;span style="color: #000000;"&gt;*&lt;/span&gt;&lt;span style="color: #800080;"&gt;0.001f&lt;/span&gt;&lt;span style="color: #000000;"&gt;, (1f&lt;/span&gt;&lt;span style="color: #000000;"&gt;/&lt;/span&gt;&lt;span style="color: #000000;"&gt;30f)));
&lt;/span&gt;&lt;span style="color: #008080;"&gt;106&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;107&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #008000;"&gt;//&lt;/span&gt;&lt;span style="color: #008000;"&gt; Clean up any boxes that have fallen offscreen&lt;/span&gt;&lt;span style="color: #008000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;108&lt;/span&gt; &lt;span style="color: #008000;"&gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;foreach&lt;/span&gt;&lt;span style="color: #000000;"&gt; (var box &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; from box &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;in&lt;/span&gt;&lt;span style="color: #000000;"&gt; _world.BodyList
&lt;/span&gt;&lt;span style="color: #008080;"&gt;109&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            let pos &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; ConvertUnits.ToDisplayUnits(box.Position)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;110&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;where&lt;/span&gt;&lt;span style="color: #000000;"&gt; pos.Y &lt;/span&gt;&lt;span style="color: #000000;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #000000;"&gt; _graphics.GraphicsDevice.Viewport.Height
&lt;/span&gt;&lt;span style="color: #008080;"&gt;111&lt;/span&gt; &lt;span style="color: #000000;"&gt;                            select box)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;112&lt;/span&gt; &lt;span style="color: #000000;"&gt;        {
&lt;/span&gt;&lt;span style="color: #008080;"&gt;113&lt;/span&gt; &lt;span style="color: #000000;"&gt;            _world.RemoveBody(box);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;114&lt;/span&gt; &lt;span style="color: #000000;"&gt;        }
&lt;/span&gt;&lt;span style="color: #008080;"&gt;115&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;116&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;base&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Update(gameTime);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;117&lt;/span&gt; &lt;span style="color: #000000;"&gt;    }
&lt;/span&gt;&lt;span style="color: #008080;"&gt;118&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;119&lt;/span&gt; &lt;span style="color: #000000;"&gt;    &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;protected&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;override&lt;/span&gt;&lt;span style="color: #000000;"&gt; &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;void&lt;/span&gt;&lt;span style="color: #000000;"&gt; Draw(GameTime gameTime)
&lt;/span&gt;&lt;span style="color: #008080;"&gt;120&lt;/span&gt; &lt;span style="color: #000000;"&gt;    {
&lt;/span&gt;&lt;span style="color: #008080;"&gt;121&lt;/span&gt; &lt;span style="color: #000000;"&gt;        GraphicsDevice.Clear(Color.FromNonPremultiplied(&lt;/span&gt;&lt;span style="color: #800080;"&gt;51&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;51&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;51&lt;/span&gt;&lt;span style="color: #000000;"&gt;, &lt;/span&gt;&lt;span style="color: #800080;"&gt;255&lt;/span&gt;&lt;span style="color: #000000;"&gt;));
&lt;/span&gt;&lt;span style="color: #008080;"&gt;122&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;123&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _spriteBatch.Begin();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;124&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;125&lt;/span&gt; &lt;span style="color: #000000;"&gt;        var projection &lt;/span&gt;&lt;span style="color: #000000;"&gt;=&lt;/span&gt;&lt;span style="color: #000000;"&gt; Matrix.CreateOrthographicOffCenter(
&lt;/span&gt;&lt;span style="color: #008080;"&gt;126&lt;/span&gt; &lt;span style="color: #000000;"&gt;            0f,
&lt;/span&gt;&lt;span style="color: #008080;"&gt;127&lt;/span&gt; &lt;span style="color: #000000;"&gt;            ConvertUnits.ToSimUnits(_graphics.GraphicsDevice.Viewport.Width),
&lt;/span&gt;&lt;span style="color: #008080;"&gt;128&lt;/span&gt; &lt;span style="color: #000000;"&gt;            ConvertUnits.ToSimUnits(_graphics.GraphicsDevice.Viewport.Height), 0f, 0f,
&lt;/span&gt;&lt;span style="color: #008080;"&gt;129&lt;/span&gt; &lt;span style="color: #000000;"&gt;            1f);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;130&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _debugView.RenderDebugData(&lt;/span&gt;&lt;span style="color: #0000FF;"&gt;ref&lt;/span&gt;&lt;span style="color: #000000;"&gt; projection);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;131&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;132&lt;/span&gt; &lt;span style="color: #000000;"&gt;        _spriteBatch.End();
&lt;/span&gt;&lt;span style="color: #008080;"&gt;133&lt;/span&gt; &lt;span style="color: #000000;"&gt;
&lt;/span&gt;&lt;span style="color: #008080;"&gt;134&lt;/span&gt; &lt;span style="color: #000000;"&gt;        &lt;/span&gt;&lt;span style="color: #0000FF;"&gt;base&lt;/span&gt;&lt;span style="color: #000000;"&gt;.Draw(gameTime);
&lt;/span&gt;&lt;span style="color: #008080;"&gt;135&lt;/span&gt; &lt;span style="color: #000000;"&gt;    }
&lt;/span&gt;&lt;span style="color: #008080;"&gt;136&lt;/span&gt; &lt;span style="color: #000000;"&gt;}
&lt;/span&gt;&lt;span style="color: #008080;"&gt;137&lt;/span&gt; &lt;span style="color: #000000;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Lines 4:&lt;/strong&gt; Declare the debug view we’ll use for rendering (more on that later).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 8:&lt;/strong&gt; Declare _world variable of type class World. World is the main object to interact with the Farseer engine. It stores all the joints and bodies, and is responsible for stepping through the simulation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 12-17:&lt;/strong&gt; Create the graphics device we’ll be rendering on. This is an XNA component and we’re just setting it to be the same size as the phone and toggling it to be full screen (no system tray).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 34:&lt;/strong&gt; We create a SpriteFont here by adding it to the project. It’s called “font” because that’s what the DebugView uses but you can name it whatever you want (and if you’re not using DebugView for your production app you might have several fonts).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 37-44:&lt;/strong&gt; We create the physics environment that Farseer uses to contain all the objects by specifying it here. We’re using Vector2.UnitY*10 to represent the gravity to be used in the environment. In other words, 10 units going in a downward motion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 46-56:&lt;/strong&gt; We create the DebugViewXNA here. This is copied from the […] from the code you downloaded and provides the ability to render all entities onto the screen. In a production release you’ll be doing the rendering yourself of each object but we cheat a bit for the demo and let the DebugView do it for us. The other thing it can provide is to render out a panel of debugging information while the simulation is going on. This is useful in tracking down objects, figuring out how something works, or just keeping track of what’s in the engine.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 49-67:&lt;/strong&gt; Here we create a rigid body (Farseer only supports rigid bodies) to represent the floor that we’ll drop objects onto. We create it by using one of the Farseer factories and specifying the width and height. The ConvertUnits class is copied from the samples code as-is and lets us toggle between display units (pixels) and simulation units (usually metres). We’re creating a floor that’s 480 pixels wide and 50 pixels high (converting them to SimUnits for the engine to understand). We also position it near the bottom of the screen. Values are in metres and when specifying values they refer to the centre of the body object.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 77-78:&lt;/strong&gt; The game Update method fires 30 times a second, too fast to be creating objects this quickly. So we use a variable to track the elapsed seconds since the last update, accumulate that value, then create a new box to drop when 1 second has passed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 89-94:&lt;/strong&gt; We create a box the same way we created our floor (coming up with a random width and height for the box).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 96-101:&lt;/strong&gt; We set the box to be Dynamic (rather than Static like the floor object) and position it somewhere along the top of the screen.&lt;/p&gt;

&lt;p&gt;And now you created the world. Gravity does the rest and the boxes fall to the ground. Here’s the result:&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:97b50cde-6fc6-46a4-b490-1ad135509e4c" class="wlWriterEditableSmartContent"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=i0twP6WGvHs&amp;amp;feature=youtube_gdata_player" target="_new"&gt;&lt;img src="http://weblogs.asp.net/blogs/bsimser/video149f9fa208f1_2358C8A1.jpg" style="border-style: none" galleryimg="no" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style="width:448px;clear:both;font-size:.8em"&gt;Farseer Physics Engine Demo using XNA&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Lines 105:&lt;/strong&gt; We must update the world at every frame. We do this with the Step method which takes in the time interval. [more]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 108-114:&lt;/strong&gt; Body objects are added to the world but never automatically removed (because Farseer doesn’t know about the display world, it has no idea if an item is on the screen or not). Here we just loop through all the entities and anything that’s dropped off the screen (below the bottom) gets removed from the World. This keeps our entity count down (the simulation never has more than 30 or 40 objects in the world no matter how long you run it for). Too many entities and the app will grind to a halt.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Lines 125-130:&lt;/strong&gt; Farseer knows nothing about the UI so that’s entirely up to you as to how to draw things. Farseer is just tracking the objects and moving them around using the physics engine and it’s rules. You’ll still use XNA to draw items (using the SpriteBatch.Draw method) so you can load up your usual textures and draw items and pirates and dancing zombies all over the screen. Instead in this demo we’re going to cheat a little. In the sample code for Farseer you can download there’s a project called DebugView XNA. This project contains the DebugViewXNA class which just handles iterating through all the bodies in the world and drawing the shapes. So we call the RenderDebugData method here of that class to draw everything correctly. In the case of this demo, we just want to draw Shapes so take a look at the source code for the DebugViewXNA class as to how it extracts all the vertices for the shapes created (in this case simple boxes) and draws them. You’ll learn a *lot* about how Farseer works just by looking at this class.&lt;/p&gt;

&lt;p&gt;That’s it, that’s all. Simple huh?&lt;/p&gt;

&lt;p&gt;Hope you enjoy the code and library. Physics is hard and requires some math skills to really grok. The Farseer Physics Engine makes it pretty easy to get up and running and start building games. In future posts we’ll get more in-depth with things you can do with the engine so this is just the beginning.&lt;/p&gt;

&lt;p&gt;I've posted the entire source code for this article on &lt;a href="https://bitbucket.org/"&gt;Bitbucket&lt;/a&gt; so you can grab the whole package &lt;a href="https://bitbucket.org/bsimser/helloboxworld/overview"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8389578" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/BDckmzAKrQZVJdULrDCdXc5HfjQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BDckmzAKrQZVJdULrDCdXc5HfjQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/BDckmzAKrQZVJdULrDCdXc5HfjQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/BDckmzAKrQZVJdULrDCdXc5HfjQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=x4lNzYzf12I:jDF4YlyAlvk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=x4lNzYzf12I:jDF4YlyAlvk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=x4lNzYzf12I:jDF4YlyAlvk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=x4lNzYzf12I:jDF4YlyAlvk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/XNA/default.aspx">XNA</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/WP7/default.aspx">WP7</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/C_2300_/default.aspx">C#</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/04/13/farseer-tutorial-for-the-absolute-beginners.aspx</feedburner:origLink></item><item><title>Introducing SharePointR</title><link>http://feedproxy.google.com/~r/bsimser/~3/wqJpu0baYfE/introducing-sharepointr.aspx</link><pubDate>Sun, 01 Apr 2012 13:19:01 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8372696</guid><dc:creator>Bil Simser</dc:creator><slash:comments>11</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8372696</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8372696</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/04/01/introducing-sharepointr.aspx#comments</comments><description>&lt;p&gt;Recently there’s been a lot of great press on a async signallying libarary called &lt;a href="http://signalr.net/"&gt;SignalR&lt;/a&gt;. SignalR is the brainchild of Microsoft employee &lt;a href="http://nuget.org/profiles/dfowler"&gt;David Fowler&lt;/a&gt; and helps you build real-time, multi-user interactive web applications.&lt;/p&gt;  &lt;p&gt;The last year I’ve been working with a top team in Redmond on rewriting SharePoint into a complete JavaScript version that runs in the client which we’re now calling SharePointR.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/SharePointR_13D6E3CB.png"&gt;&lt;img style="display: inline" title="SharePointR" alt="SharePointR" src="http://weblogs.asp.net/blogs/bsimser/SharePointR_thumb_72E37123.png" width="583" height="249" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;SharePointR is a client side version of SharePoint offers all of the base functionality that SharePoint 2010 has but boasts a 300% improvement in speed and productivity for the Information Worker. Along with key features that can only be offered in a client side product, SharePointR comes out of the box with social media integration so there’s no need to build any third party solution.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Technology&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;SharePointR is built on top of SignalR, a .NET library for building real-time, multi-user interactive web applications. It’s only natural for SharePointR to use the technology and provide a full blown server product like SharePoint to the client. SignalR makes it dead easy and handles all the heavy lifting for you. SharePointR handles all the heavy lifting of running a SharePoint farm for you by putting it on all the client.&lt;/p&gt;  &lt;p&gt;Creator David Fowler sounds a little confusing about the product and had this to say. Not really sure what it means though:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&lt;font size="3"&gt;&lt;strong&gt;H&lt;/strong&gt;ere’s &lt;strong&gt;a&lt;/strong&gt; &lt;strong&gt;p&lt;/strong&gt;roduction &lt;strong&gt;p&lt;/strong&gt;roduct &lt;strong&gt;y&lt;/strong&gt;esterday &lt;strong&gt;a&lt;/strong&gt;nd &lt;strong&gt;p&lt;/strong&gt;redictive &lt;strong&gt;r&lt;/strong&gt;asterized &lt;strong&gt;i&lt;/strong&gt;ntegration &lt;strong&gt;l&lt;/strong&gt;egacy &lt;strong&gt;f&lt;/strong&gt;ully &lt;strong&gt;o&lt;/strong&gt;perating &lt;strong&gt;o&lt;/strong&gt;n &lt;strong&gt;l&lt;/strong&gt;eftover &lt;strong&gt;s&lt;/strong&gt;erver &lt;strong&gt;d&lt;/strong&gt;ata &lt;strong&gt;a&lt;/strong&gt;nd &lt;strong&gt;y&lt;/strong&gt;up.&lt;/font&gt;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Creating a new instance of SharePointR is a breeze:&lt;/p&gt;  &lt;p&gt;1. Create a SharePointR hub:&lt;/p&gt;  &lt;pre class="csharpcode"&gt;[HubName(&lt;span class="str"&gt;&amp;quot;sharePointHub&amp;quot;&lt;/span&gt;)]
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; SharePointRHub : Hub
{
  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;readonly&lt;/span&gt; SharePointR _server;
  
  &lt;span class="kwrd"&gt;public&lt;/span&gt; SharePointRHub(SharePointR server)
  {
    _server = server;
  }
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;2. Create a connection between the server and your client:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; sharePointRHubClient = $.connection.sharePointRHub;

&lt;span class="rem"&gt;// Start the connection&lt;/span&gt;

$.connection.hub.start(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {
  sharePointRHubClient.join(&lt;span class="str"&gt;'domain\user'&lt;/span&gt;);

};&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;That’s it! You now have a fully functional SharePointR server running anywhere you want. &lt;/p&gt;

&lt;p&gt;How do you interact with it? Simple. It uses all the classes you’re familiar with in SharePoint land, just in SignalR style. Here’s how to get a listing of documents in a document library and display the list name and number of items in a HTML div tag (called output):&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; server = $.connection.sharePointR;

server.lists[&lt;span class="str"&gt;&amp;quot;Shared Documents&amp;quot;&lt;/span&gt;].&lt;span class="kwrd"&gt;foreach&lt;/span&gt;(&lt;span class="kwrd"&gt;function&lt;/span&gt;(){
  $(&lt;span class="str"&gt;&amp;quot;#output&amp;quot;&lt;/span&gt;).append(&lt;span class="str"&gt;&amp;quot;&amp;quot;&lt;/span&gt; + name + &lt;span class="str"&gt;&amp;quot; items = &amp;quot;&lt;/span&gt; + items.getCount());
});&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;strong&gt;Bonus BizTalk Integration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In addition to just a SharePoint server at your fingertips, SharePointR also includes a fully baked BizTalk server (based on BizTalk 2010). It’s drop dead easy to integrate with it using SharePointR:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;var&lt;/span&gt; biztalk = $.connection.sharePointR.bizTalkR;

biztalk.transport.sendPort = 25;
&lt;span class="kwrd"&gt;var&lt;/span&gt; json = biztalk.send(&lt;span class="str"&gt;&amp;quot;SELECT * FROM Northwind.Customers&amp;quot;&lt;/span&gt;).toJson();

$(&lt;span class="str"&gt;&amp;quot;#datagrid&amp;quot;&lt;/span&gt;).load(json);&lt;/pre&gt;

&lt;p&gt;With 4 lines of code I just contacted the BizTalk server, issued a command to submit a SQL query on a send port via SMTP and returned a JSON array that I fed into a jQuery datagrid.&lt;/p&gt;

&lt;p&gt;How easy is that?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SharePointR is Open Source&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Just as the ASP.NET MVC team recently announced &lt;a href="http://weblogs.asp.net/scottgu/archive/2012/03/27/asp-net-mvc-web-api-razor-and-open-source.aspx"&gt;open sourcing the ASP.NET stack&lt;/a&gt;, the SharePointR team has open sourced the product in the same fashion. I’m very excited about this because not only does it mean SharePointR is licensed under an open source license (Apache 2.0) but the SharePointR team is now accepting contributions! &lt;strong&gt;Yes, now the SharePointR team will ship community code inside the core product.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;How do you get involved? Simple.&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Find a bug? Send a unit test or fix it. &lt;/li&gt;

  &lt;li&gt;Think our coverage isn’t sufficient? Submit a unit test. &lt;/li&gt;

  &lt;li&gt;Got a feature idea? Get involved more deeply with the developers and help write it. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Like every large open source project, every check-in (open source or otherwise) will be evaluated against the existing standards used by the developers. Even better, you’ll get to see our developers' checkins to the product out in the open.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implementation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To install SharePointR just use NuGet in your browser by going to &lt;a href="http://localhost/nuget"&gt;http://localhost/nuget&lt;/a&gt; then issuing the command:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;Install-Package SharePointR.Server&lt;/pre&gt;

&lt;p&gt;This will bring down the server package and give you everything you need to run SharePointR. Additional packages can be installed via NuGet. These are:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;SharePointR.Bdc – Business Data Catalog &lt;/li&gt;

  &lt;li&gt;SharePointR.Publishing – Content publishing subsystem &lt;/li&gt;

  &lt;li&gt;SharePointR.PowerPivot – Powerful reporting via Excel &lt;/li&gt;

  &lt;li&gt;SharePointR.Social – All the social media elements of SharePointR &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/sharepointrnuget_06905AB8.png"&gt;&lt;img style="display: inline" title="sharepointrnuget" alt="sharepointrnuget" src="http://weblogs.asp.net/blogs/bsimser/sharepointrnuget_thumb_08E9DCB6.png" width="600" height="345" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrated Services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Some of the new features of SharePointR that we’re announcing is complete integration with &lt;strong&gt;Instagram&lt;/strong&gt;, the fast, beautiful, and fun way to share your photos. With SharePointR you’ll be able to upload photos to a SharePointR picture library and in the background the pictures are automatically posted to the Instagram photo service. This is done behind the scenes so there’s nothing you need to do except setup your Instagram account and password in the system settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_27C05094.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_66459E3A.png" width="427" height="260" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PInterest meets SharePointR&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Like system from SharePoint 2010 has been abandoned in favour of a deep link integration with PInterest. Now users can tag documents, photos, videos, and files in SharePointR and have them immediately posted to PInterest. The integration doesn’t just go one way, it’s two-way with SharePointR pulling in your pins and boards and allowing you to navigate them in the familiar SharePoint UI.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/pinterstspr_6D200550.png"&gt;&lt;img style="display: inline" title="pinterstspr" alt="pinterstspr" src="http://weblogs.asp.net/blogs/bsimser/pinterstspr_thumb_4749DEED.png" width="583" height="398" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Native QR Code Support&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The SharePointR team thought that QR codes are the greatest invention since the modem and felt they had to be natively included in the product. And they are! Now you can configure a Document Library or SharePointR list to produce a QR code automatically.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/qrcodespr_7624BD31.png"&gt;&lt;img style="display: inline" title="qrcodespr" alt="qrcodespr" src="http://weblogs.asp.net/blogs/bsimser/qrcodespr_thumb_55314A8A.png" width="182" height="316" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We’ll be releasing QR code generation on a per-item level in a future Service Pack.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Availability&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;SharePointR is available now! Just install it via the NuGet package or you can grab the source code off GitHub. &lt;/p&gt;

&lt;p&gt;What are people saying about SharePointR? Take a look!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/image_2E423D03.png"&gt;&lt;img style="display: inline" title="image" alt="image" src="http://weblogs.asp.net/blogs/bsimser/image_thumb_146E06D4.png" width="255" height="141" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I hope this sheds some light on what’s happening with the next version of SharePoint and that you see this as a benefit to your organization. While it does mean all your server side code has to be redone, the CoffeeScript tool will help with that so migration to SharePointR should be quick and seamless.&lt;/p&gt;

&lt;p&gt;Please don’t hesitate to contact me on Twitter (&lt;a href="https://twitter.com/#!/bsimser"&gt;@bsimser&lt;/a&gt;) or via comments below on more questions about SharePointR!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8372696" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/PKUtKwbNRCc7PZduDaF0pLntjW8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PKUtKwbNRCc7PZduDaF0pLntjW8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/PKUtKwbNRCc7PZduDaF0pLntjW8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/PKUtKwbNRCc7PZduDaF0pLntjW8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wqJpu0baYfE:IeG8J30QHDI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wqJpu0baYfE:IeG8J30QHDI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wqJpu0baYfE:IeG8J30QHDI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wqJpu0baYfE:IeG8J30QHDI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/04/01/introducing-sharepointr.aspx</feedburner:origLink></item><item><title>Displaying Large Text Files in Windows Phone Apps</title><link>http://feedproxy.google.com/~r/bsimser/~3/wIFq37CcfLo/displaying-large-text-files-in-windows-phone-apps.aspx</link><pubDate>Sat, 31 Mar 2012 14:18:14 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8371876</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8371876</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8371876</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/03/31/displaying-large-text-files-in-windows-phone-apps.aspx#comments</comments><description>&lt;p&gt;Have you ever needed to provide instructions or help for your Windows Phone app and found yourself creating gobs of XAML and writing it in the Visual Studio designer into a TextBlock control? Not very efficient is it? Here’s a technique you can use that might make things easier.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;1 Text File (preferable something appropriate to your app)&lt;/li&gt;    &lt;li&gt;1 Phone Application Page&lt;/li&gt;    &lt;li&gt;30 Lines of Code&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Preparation&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Create a new Phone Application Page (or use an existing one). Add a ScrollViewer to it like so:&lt;/p&gt;  &lt;div class="csharpcode"&gt;   &lt;pre class="alt"&gt;&lt;span class="rem"&gt;&amp;lt;!--ContentPanel - place additional content here--&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ContentPanel&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Grid&lt;/span&gt;.&lt;span class="attr"&gt;Row&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;1&amp;quot;&lt;/span&gt; &lt;span class="attr"&gt;Margin&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;12,0,12,0&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre class="alt"&gt;    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ScrollViewer&lt;/span&gt; &lt;span class="attr"&gt;x:Name&lt;/span&gt;&lt;span class="kwrd"&gt;=&amp;quot;ScrollingTexFromHell&amp;quot;&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

  &lt;pre&gt;&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Grid&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;You’ll need a text file to display so create one in your project. By default it’s type is set as Content so that’s what we want. Just make sure the file is copied to the project (you can choose to copy always or copy if newer, doesn’t matter). I use &lt;a href="http://baconipsum.com/"&gt;Bacon Ipsum&lt;/a&gt; to get me some sample text because well, it’s bacon baby.&lt;/p&gt;

&lt;p&gt;In the code behind add a method like this:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; StackPanel TextToXaml(&lt;span class="kwrd"&gt;string&lt;/span&gt; filename)
{
    var panel = &lt;span class="kwrd"&gt;new&lt;/span&gt; StackPanel();
    var resourceStream = Application.GetResourceStream(&lt;span class="kwrd"&gt;new&lt;/span&gt; Uri(filename, UriKind.RelativeOrAbsolute));
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (resourceStream != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
    {
        &lt;span class="kwrd"&gt;using&lt;/span&gt; (var reader = &lt;span class="kwrd"&gt;new&lt;/span&gt; StreamReader(resourceStream.Stream))
        {
            &lt;span class="kwrd"&gt;string&lt;/span&gt; line;
            &lt;span class="kwrd"&gt;do&lt;/span&gt;
            {
                line = reader.ReadLine();
                &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty(line))
                {
                    panel.Children.Add(&lt;span class="kwrd"&gt;new&lt;/span&gt; Rectangle { Height = 20.0 });
                }
                &lt;span class="kwrd"&gt;else&lt;/span&gt;
                {
                    var textBlock = &lt;span class="kwrd"&gt;new&lt;/span&gt; TextBlock
                    {
                        TextWrapping = TextWrapping.Wrap,
                        Text = line,
                        Style = (Style)Application.Current.Resources[&lt;span class="str"&gt;&amp;quot;PhoneTextNormalStyle&amp;quot;&lt;/span&gt;],
                        FontSize = 22,
                    };
                    panel.Children.Add(textBlock);
                }
            } &lt;span class="kwrd"&gt;while&lt;/span&gt; (line != &lt;span class="kwrd"&gt;null&lt;/span&gt;);
        }
    }
    &lt;span class="kwrd"&gt;return&lt;/span&gt; panel;
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Finally add a Loaded Event to your page to execute this when the page loads and assign the value of the method above to your ScrollViewer.&lt;/p&gt;

&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Constructor&lt;/span&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; MainPage()
{
    InitializeComponent();
    Loaded += OnPageLoaded;
}

&lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnPageLoaded(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, RoutedEventArgs e)
{
    ScrollingTexFromHell.Content = TextToXaml(&lt;span class="str"&gt;&amp;quot;mytextfile.txt&amp;quot;&lt;/span&gt;);
}&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;&lt;strong&gt;The Result&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/bsimser/screenshot_3-31-2012_8.14.49.714_02B6AE21.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="screenshot_3-31-2012_8.14.49.714" border="0" alt="screenshot_3-31-2012_8.14.49.714" src="http://weblogs.asp.net/blogs/bsimser/screenshot_3-31-2012_8.14.49.714_thumb_39445965.png" width="504" height="266" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code is really simple. It just reads in the text file as a stream and reads each line in the text file. A StackPanel is created in our method and whenever the reader hits a blank line it inserts a small rectangle, otherwise it creates a TextBlock control with the content set to the line. You can adjust the height of the space between paragraphs and the font style and size but I picked something that I think looks pretty good when reading long text.&lt;/p&gt;

&lt;p&gt;The paragraphs are stacked up in the StackPanel control which is then set as the content to the ScrollViewer we inserted. The user can just scroll through the entire text as they need to.&lt;/p&gt;

&lt;p&gt;Enhancements? Of course. You could&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Put this into a Phone Class Library and use it as you see fit (you could even create a NuGet package!)&lt;/li&gt;

  &lt;li&gt;Add parameters to the TextToXaml method like font size and spacing&lt;/li&gt;

  &lt;li&gt;Do extra things with the reader while processing the text. For example you could recognize a new line and make each new line bold or larger so the first line in each paragraph would be a heading.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Have fun with it. It’s simple and I find it’s better than entering the text into the XAML page directly.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8371876" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/JIVMn5iuJ0ycGjotD9mHyJB6OZ0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JIVMn5iuJ0ycGjotD9mHyJB6OZ0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/JIVMn5iuJ0ycGjotD9mHyJB6OZ0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/JIVMn5iuJ0ycGjotD9mHyJB6OZ0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wIFq37CcfLo:snyRyJyi7MM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wIFq37CcfLo:snyRyJyi7MM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=wIFq37CcfLo:snyRyJyi7MM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=wIFq37CcfLo:snyRyJyi7MM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/03/31/displaying-large-text-files-in-windows-phone-apps.aspx</feedburner:origLink></item><item><title>Official and unofficial apps in the iOS, WP7, and Android marketplaces</title><link>http://feedproxy.google.com/~r/bsimser/~3/iZmjg3DgMvg/app-numbers-and-official-apps-in-the-ios-wp7-and-android-marketplaces.aspx</link><pubDate>Thu, 29 Mar 2012 19:29:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8369155</guid><dc:creator>Bil Simser</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8369155</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8369155</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/03/29/app-numbers-and-official-apps-in-the-ios-wp7-and-android-marketplaces.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;The last few months have seen people complaining about the lack of "official" apps in the Windows Phone marketplace. In fact a couple of months ago I wrote about this very thing here and &lt;A href="http://weblogs.asp.net/bsimser/archive/2012/02/10/does-the-world-really-need-quot-official-quot-apps.aspx" mce_href="http://weblogs.asp.net/bsimser/archive/2012/02/10/does-the-world-really-need-quot-official-quot-apps.aspx"&gt;if we really needed these official apps&lt;/A&gt; or could get by with third-party solutions. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Recently a list of "Top 100 Mobile Apps" crossed my desk and it was curious. 40 iPhone apps, 40 Android apps, 10 WP7 apps, and 10 BlackBerry apps. Really? 10 for WP7? So I wondered if the media was just playing this up and maybe continuing to do what I think most vendors are doing which is treating Windows Phone as the red-headed step-child you keep in the basement while all along there's nothing wrong with them.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I put together the list and went digging to see how many of the top 40 iOS and Android apps were also on the Windows Phone platform (sorry BlackBerry, you should just shut your doors right now). Here's the results. Note, these are all *free* apps. There might be other pay apps that have official representation across all mobile devices, I just chose to hunt these ones down because I'm cheap.&lt;/P&gt;
&lt;P mce_keep="true"&gt;In the top 40, I easily plucked out 20 that had official apps on all three platforms.&amp;nbsp;These were: Amazon Mobile, ESPN Score Centre, Evernote, Facebook, Foursquare, Google Search, IMDB, Kindle, Shazam, Skype (yes, I know, in beta on WP7), SlackerRadio, The Weather Channel, TripIt, Twitter, Yelp, Flixster, Netflix, TuneIn Radio, Dictionary.com, Angry Birds, and Groupon.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hey, that's pretty good IMHO. 20 or so apps, all free, and all fully functional and supported (and in some cases, even better looking on the Windows Phone platform than the other platforms).&lt;/P&gt;
&lt;P mce_keep="true"&gt;A dozen or so&amp;nbsp;more apps had official apps on some platforms but not all, so yes, there are gaps here. Here's a rundown of the hangers-on:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Adobe Photoshop Express&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This looks great on the iOS platform and there's even an official version on droid. Hope Adobe brings this to WP7. There are other photo editing programs though if you go looking (maybe we can get Paint.NET to be ported to the phone?)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;BBC News&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;A few apps offer news feeds but nothing official on the Windows Phone. The feeds are good but without video this app needs some WP7 love.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Dropbox&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Again Windows Phone looses out here with no official app. There are a few third party ones that will help you along and offer most of the functionality that you need but no integration that an official app might bring.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Epicurious&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Droid seems to be the trailer here as there are apps for it but nothing official (from what I can tell). Both iOS and WP7 have them.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Flipboard&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;It's sad with Flipboard as it's such a great newsreader. The only offiical app is for iOS but frankly the iPhone version looks horrible so without a tablet the experience here isn't that hot. Maybe with WP8. Currently there's nothing even remotely similar to this on the other platforms.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Google+&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Is anyone still using this? No official app for WP7 but some clones. Apparently there's no API so people are just screen scraping. Ugh.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Mint.com&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;This app has all kinds of buzz and a lot of votes on the &lt;A href="https://wprequests.uservoice.com/forums/149122-application-requests/filters/top" mce_href="https://wprequests.uservoice.com/forums/149122-application-requests/filters/top"&gt;application requests site&lt;/A&gt;. Official apps for iOS and droid. No WP7 love (yet).&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;TED&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;Quite a few TED apps on WP7 but nothing official. I think the third party ones suffice and some are pretty nice looking, taking advantage of the Metro interface and making for a good show.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;WebMD&lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;There's a third party app on WP7 here but nothing official. It seems to contain all the same information and functionality the official apps do so not sure if an official one is needed but its here for inclusion.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The other apps in the top 40 were either very specific to the platform (for example all three of them have a "Find my Phone" app). There are others that are missing out on the WP7 platform like ooVoo, Words With Friends, and some of the Google apps (Google Voice for example). Since you can integrate your GMail account right into the Windows Phone (via linked inboxes)&amp;nbsp;I'm not sure if there's a need for an official GMail app here.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Looking at the numbers Windows Phone still gets the worst of the deal here with half a dozen highly popular "offical" apps that exist on the other mobile platforms and in some cases, nothing even remotely similar to the official app to compare. This doesn't include things like Instagram, PInterest, and others (don't get me started on those).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Still, with over 20+ highly popular free apps all represented on all three mobile platforms I don't think it's a bad place to be in. The Windows Phone platform could get a little more love from the vendors missing here, or at least open up your APIs so the third party crowd can step in and take up the slack.&lt;/P&gt;
&lt;P mce_keep="true"&gt;P.S. these are just my observations and I might have got a few items wrong. Feel free to chime in with missing or incorrect information. I am after all human. Well, most of me is.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8369155" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ACS3ULoRaZS36jOuP-RGLa6amI0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ACS3ULoRaZS36jOuP-RGLa6amI0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ACS3ULoRaZS36jOuP-RGLa6amI0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ACS3ULoRaZS36jOuP-RGLa6amI0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=iZmjg3DgMvg:H8Ofj-i_COA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=iZmjg3DgMvg:H8Ofj-i_COA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=iZmjg3DgMvg:H8Ofj-i_COA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=iZmjg3DgMvg:H8Ofj-i_COA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Android/default.aspx">Android</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/iOS/default.aspx">iOS</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Mobile/default.aspx">Mobile</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/03/29/app-numbers-and-official-apps-in-the-ios-wp7-and-android-marketplaces.aspx</feedburner:origLink></item><item><title>PrairieDevCon 2012 Sessions</title><link>http://feedproxy.google.com/~r/bsimser/~3/jHQPXiRM8RE/prairiedevcon-2012-sessions.aspx</link><pubDate>Tue, 06 Mar 2012 14:54:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8328511</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8328511</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8328511</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/03/06/prairiedevcon-2012-sessions.aspx#comments</comments><description>&lt;P&gt;As a follow-up to yesterdays note about my Windows Phone Developer Workshop (there's still room for more peeps!) here's a list of regular sessions I'm presenting at &lt;A href="http://prairiedevcon.com/" mce_href="http://prairiedevcon.com/"&gt;PrairieDevCon 2012&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SharePoint Client Object Model: Accessing SharePoint Externally Using JavaScript&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 300px" src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey01.jpg" width=400 height=300 mce_src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey01.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In SharePoint 2010 there are a number of object models that can be used by developers to access the server. The Client Object Model (Client OM) is a unified model which uses the same or similar programming concepts as the Server Object Model (Server OM). The Client OM can be accessed via web services, via a client (JavaScript) API, and via REST. Everything from enumerating sites and lists, displaying list items, adding and creating content, and getting user information can be done all from the Client Object Model. In this session we'll explore the Client Object Model and create examples accessing SharePoint data using JavaScript and jQuery.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Application Design for Windows Phone&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 300px" src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey02.jpg" width=400 height=300 mce_src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey02.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the past year, we’ve worked with hundreds of developers and designers interpreting the "Metro" design system for their own purposes. We’ve seen great interpretations, and others that aren’t so great. In this session, we’ll share with you the foundations of great Metro application design for Windows Phone, and how to use them to build outstanding applications that will stand out and get noticed… for good reasons. We will also be providing some general best practices for building great mobile experiences. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The Marketplace – What Makes a Successful App on Windows Phone?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 295px" src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey03.jpg" width=400 height=295 mce_src="http://weblogs.asp.net/blogs/bsimser/pdc2012west/spidey03.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are a developer and have even thought about developing Windows Phone lately, you likely already know that every app and game that is installed on consumer Windows Phone 7.5 devices comes from the Marketplace. This is new to the traditional Windows Phone ecosystem prior to version 7, and while in some cases this does introduce a change for developers and users, there is a lot of reasons why this change is a great one. In this session, we go through both the consumer and developer/publisher experience on the Marketplace and strategies for distributing your app and game both publicly and privately. We will also provide an overview of our Marketplace presence around the world and what new countries have been introduced with the release of the new 7.5 (formerly codenamed “Mango”) update. Finally, we will provide you with strategies on how to increase the popularity of your applications and games and (if you are charging a price for your masterpiece) how to make more money.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8328511" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WzJlPR86mg1WJfAlsdtcqeL2tD4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WzJlPR86mg1WJfAlsdtcqeL2tD4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WzJlPR86mg1WJfAlsdtcqeL2tD4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WzJlPR86mg1WJfAlsdtcqeL2tD4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=jHQPXiRM8RE:NXdcAlQwEuA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=jHQPXiRM8RE:NXdcAlQwEuA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=jHQPXiRM8RE:NXdcAlQwEuA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=jHQPXiRM8RE:NXdcAlQwEuA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/03/06/prairiedevcon-2012-sessions.aspx</feedburner:origLink></item><item><title>Get Juiced with me and 10,000 friends at Prairie Dev Con West</title><link>http://feedproxy.google.com/~r/bsimser/~3/1uIeO_RdQL8/get-juiced-with-me-and-10-000-friends-at-prairie-dev-con-west.aspx</link><pubDate>Sun, 04 Mar 2012 14:57:12 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8324078</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8324078</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8324078</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/03/04/get-juiced-with-me-and-10-000-friends-at-prairie-dev-con-west.aspx#comments</comments><description>&lt;p&gt;I”m happy to say that &lt;a href="http://prairiedevcon.com/"&gt;Prairie Dev Con West 2012&lt;/a&gt; is almost upon us. In just over a week geeks from the five corners of the planet will get together and talk about D’Arcy Lussier’s hair and hope that the Mad Mexican doesn’t crash their session.&lt;/p&gt;  &lt;p&gt;&lt;img style="display: inline; float: left" title="This has nothing to do with Windows Phone development" alt="Why is this picture here?" align="left" src="http://earlymodernpost.files.wordpress.com/2011/12/christmas_snoopy2.jpg" /&gt;For me there’s a few sessions I’m presenting including a day long workshop on Windows Phone Development. If you’re looking to learn hands-on development with a Jedi Master then you’ll need to find a different conference. If however you want to try your hand at learning with me and watch me stumble through trying to run Windows on a MacBook Pro, then bring it. Here’s a rundown of what we’ll be covering with the Windows Phone Developer Workshop.&lt;/p&gt;  &lt;p&gt;Start your engines and we’ll go from 0-11 in 60 minutes with building more Hello World apps you’ve ever seen. They’ll be a Hello app, a World app, and even a Hello World app. Everything you need to know to get started with Windows Phone development. After a series of Hello World apps you’ll be ready to build anything (well, anything with the words Hello and World in them)&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Everyone talks about the Model-View-ViewModel (or as we experts say MVVM) pattern when it comes to data binding on the Windows Phone. We’ll explore every concievable angle to using the MVVM pattern, tools that make it less painful to implement the pattern, and different ways we can spell MVVM (like MVMV, MVCM, and the ever popular MCMXXVII)&lt;/li&gt;    &lt;li&gt;&lt;/li&gt;    &lt;li&gt;For me I’m all about the bling and love to criticize apps that make my eyes bleed. Help me make my eyes bleed less by learning the Metro design language. We’ll just randomly pick ones in the marketplace and rip them a new one. If you like watching Gordon Ramsay yell down at people that cook like donkeys then you’ll fit right into this part of day. I guarantee you’ll know the Metro ways after this or I’ll beat your with your own skull.&lt;/li&gt;    &lt;li&gt;&lt;/li&gt;    &lt;li&gt;Mango introduces about 800,000 new API features and we’ll look at every one of them in detail. There are some cool tools that will help you debug and work with apps in the emulator and we’ll go over the new and old stuff in Mango. This part of the session may extend the day so bring a sleeping bag and some Red Bull to keep you going through the night.&lt;/li&gt;    &lt;li&gt;&lt;/li&gt;    &lt;li&gt;Expression Blend is the most complex piece of software ever known to man. We’ll try to figure it out. Barring that, we’ll just sit around and sing Kumbaya and make jokes about people from Edmonton. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I’m also presenting a session on using the JavaScript Client Object Model with SharePoint 2010. We’ll build some funky stuff and learn how to iterate lists, sites, and build alternate UIs for SharePoint without writing a single line of C# code. There are also two additional sessions on Windows Phone that I’m planning on doing which is a deep dive into marketing and design. Oh yeah, there are other people doing sessions at the conference too.&lt;/p&gt;  &lt;p&gt;The 10,000 friends? Okay, so I think the attendance for Prairie Dev Con West is only a few hundred, but I like to use my imagination and pretend I can see ten times more people than there really are. Same effect when I drink.&lt;/p&gt;  &lt;p&gt;In any case, if you haven’t registered already please consider it. D’Arcy puts on a damn good show and the quality being presented here (sans me) is top notch and there’s a huge diversity of sessions to take in. &lt;/p&gt;  &lt;p&gt;Also remember the &lt;a href="http://prairiedevcon.com/workshops"&gt;pre-con day-long workshops&lt;/a&gt; are there. If all you want to take in is a workshop, that’s cool too and you’ll get a full day earful of Agile, Windows Phone Development, and TFS Build sessions. Still an absolute cheapskate like me? Then there’s a day long Windows Azure Boot Camp you can come out to that absolutely free (as in beer,&amp;#160; but space is limited) and even includes breakfast and lunch (sorry, the Microsoft IT Virtualization Boot Camp is sold out).&lt;/p&gt;  &lt;p&gt;Come on down and get smart(ish).&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8324078" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tfcrRuaHsnj700gQMrB5wyiUGo0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tfcrRuaHsnj700gQMrB5wyiUGo0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tfcrRuaHsnj700gQMrB5wyiUGo0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tfcrRuaHsnj700gQMrB5wyiUGo0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1uIeO_RdQL8:-ca7M_rOs6U:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1uIeO_RdQL8:-ca7M_rOs6U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=1uIeO_RdQL8:-ca7M_rOs6U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=1uIeO_RdQL8:-ca7M_rOs6U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/WP7/default.aspx">WP7</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Metro/default.aspx">Metro</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/03/04/get-juiced-with-me-and-10-000-friends-at-prairie-dev-con-west.aspx</feedburner:origLink></item><item><title>Metro Style Site Directory for SharePoint Using EMCAScript</title><link>http://feedproxy.google.com/~r/bsimser/~3/4c8km3u_PjM/metro-style-site-directory-for-sharepoint-using-emcascript.aspx</link><pubDate>Tue, 28 Feb 2012 18:10:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8318472</guid><dc:creator>Bil Simser</dc:creator><slash:comments>3</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8318472</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8318472</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/02/28/metro-style-site-directory-for-sharepoint-using-emcascript.aspx#comments</comments><description>&lt;P&gt;I’ve always been trying to come up with a useful and clever way to allow users to navigate around SharePoint sites. Recently I put together an “Application Directory” which basically displayed a menu system to navigate around apps. Using the JavaScript Class Library for SharePoint to pull values out of SharePoint I quickly put together something that normally would be a lot of C# code and a web part.&lt;/P&gt;
&lt;P&gt;The EMCAScript object model is powerful in that you can quickly pull data out of SharePoint sites and lists and make a pleasant user experience with just a little JavaScript, CSS, HTML, and jQuery. It still will make a call back to the server to fetch the data but it’s done asynchronously so the perception to the user is almost seamless.&lt;/P&gt;
&lt;P&gt;This post walks you through building a site directory of sorts. It could be used as a landing page on a top level site collection or as a web part sitting on a team site (to show the contents below the site). It’s up to you but the net result is a nice navigation system (done with a little “Metro” styling) all done in a hundred lines of JavaScript.&lt;/P&gt;
&lt;P&gt;Here’s what we’re building:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_final.jpg" width=500 height=233 mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_final.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Let’s start with the simplest thing possible. A script that we’ll insert into the page using the Content Editor Web Part via a Content Link. This is my preferred way of doing lightweight adds to SharePoint (like JavaScript or even just raw HTML). The Content Link points to a file in my SiteAssets library in the site and since it’s a link it just gobbles up the content and serves it up. If you try adding HTML to a Content Editor Web Part you’ll find a nice message after saving “Your HTML may have been modified”.&lt;/P&gt;
&lt;P&gt;WTF?&lt;/P&gt;
&lt;P&gt;Yeah, SharePoint deliciously will go in after you save your nicely formatted content and do some neat things like rename your CSS entities. Oh yeah, it’ll also strip away your JavaScript if it doesn’t like it.&lt;/P&gt;
&lt;P&gt;Trust me. Just include the file and you’ll be much better off in the end. Having the file located in the SiteAssets library also lets me just crack it open in SharePoint Designer and while the editor isn’t the greatest, it does give you some Intellisense but the real advantage is saving it in SPD then hitting refresh on your page to see the effect. The file will contain the CSS, JavaScript, and HTML markup. I like putting everything together so I don’t have to worry about files all over my system but you can just as easily use multiple files if you want.&lt;/P&gt;
&lt;P&gt;Alright, back to business. Create a new file in your SiteAssets library (you get a SiteAssets library when you create a new site regardless of what template you use or what feature you activate, it’s always there and accessible through SharePoint Designer). &lt;/P&gt;
&lt;P&gt;Name the file SiteDirectory.js or something. Doesn’t really matter and you can call it ISavedTheWorldUsingPork.HowAboutThat if you want, but leaving it with a .js extension will give you some semblance of Intellisense inside of SPD.&lt;/P&gt;
&lt;P&gt;Drop a Content Editor Web Part on the home page of your site (or wherever you want to put this). This could be a Wiki Page (the Home.aspx page is a wiki page if you activate the Wiki Home Page Feature on a site) or a Web Part Page. There are a few small tweaks you should do depending on what type of page you put this on but just adjust the CSS we’ll be building as you see fit.&lt;/P&gt;
&lt;P&gt;Starting simple we're going to just enumerate the child sites and display them in an unordered list. The list is easy to style and works well with jQuery later to be able to animate or attach plugins to.&lt;/P&gt;
&lt;P&gt;Here’s the initial code that we’ll put into the SiteDirectory.js file:&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:0186fd11-0434-41f1-bc6d-1b6fed7ab879 class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt; 1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;text/javascript&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; src&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/siteassets/jquery-1.4.2.min.js&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sites;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;ExecuteOrDelayUntilScriptLoaded(loadSites, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;SP.js&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; loadSites()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SP.ClientContext.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(context &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;!=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; undefined &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;!=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;) {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; web &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context.get_web();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; web.getSubwebsForCurrentUser(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        context.load(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        context.executeQueryAsync(
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            Function.createDelegate(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.onSuccess),
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;21&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            Function.createDelegate(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.onFailed));
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;22&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;23&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;24&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;25&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onSuccess()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;26&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;27&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites.getEnumerator();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;28&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;29&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;30&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;h1&amp;gt;Apps&amp;lt;/h1&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;31&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;32&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;33&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(items.moveNext())
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;34&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;35&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;36&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_serverRelativeUrl();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;37&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_title();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;38&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;39&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;40&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;41&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;42&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;43&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;44&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;45&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(menuNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;46&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;47&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;48&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onFailed(sender, args)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;49&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;50&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(args.get_message());
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;51&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;52&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;53&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;54&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;55&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;appdir&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;56&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;Loading...&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;57&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;Like I said, all this is doing is a) enumerating through the list of subsites then b) spitting them out into an unordered list. Here’s a breakdown of how this works:&lt;/P&gt;
&lt;P&gt;Line 1-2: We’ll include some CSS styles here later&lt;/P&gt;
&lt;P&gt;Line 4: We include jQuery so we can a) make it easy to replace elements on the page and b) support plugins later. You can choose to use pure JavaScript or omit this if your site already includes jQuery.&lt;/P&gt;
&lt;P&gt;Line 8: We declare a variable we’re going to use to hold the list of sites&lt;/P&gt;
&lt;P&gt;Line 10: We wait until the core JavaScript files are loaded by SharePoint. This ensures the ClientContext is setup for us when we need it.&lt;/P&gt;
&lt;P&gt;Line 12-23: This is the function&amp;nbsp; that calls the Client Object Model to get our web then get the subwebs for the current user. Finally on lines 19-21 we execute the call (which is where we talk to the server) and define the success and failed methods.&lt;/P&gt;
&lt;P&gt;Line 25-46: We define the success function to call with our list of subwebs. Here we’re getting an enumerator to the web collection and iterating through them, grabbing the url and title of the site then creating our unordered list using regular HTML markup. Finally on line 45 we find the DIV tag we’re replacing and substitute the HTML we just created.&lt;/P&gt;
&lt;P&gt;Line 55-57: This is the HTML markup we’re going to replace in our JavaScript. We initially set the text to “Loading…” so users will see this when the page loads then *magically* it’ll get replaced with our content.&lt;/P&gt;
&lt;P&gt;Here’s the result:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_001.jpg" mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_001.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Looks good and lets us know we’re on the right track. If there are any failures you’ll see them here because our failed function will get called and output the error message. This could be anything from a JavaScript error to not calling a known method. Also note that this is already security trimmed since we’re using the getSubwebsForCurrentUser method so we’ll only see sites the user has access to.&lt;/P&gt;
&lt;P&gt;Let’s add another list and DIV tag so we have two lists to use:&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:4803b27c-30db-4c8d-9c76-bcd190d82661 class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt; 1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onSuccess()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites.getEnumerator();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;h1&amp;gt;Apps&amp;lt;/h1&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; counter &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(items.moveNext())
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_serverRelativeUrl();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_title();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;21&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;22&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;23&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;24&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;25&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;26&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;27&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;28&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;29&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;30&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;31&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;32&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(menuNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;33&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;34&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;35&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;36&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#contentNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(contentNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;37&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;38&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;39&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;40&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;41&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;appdir&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;42&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;Loading...&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;43&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div id&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;contentNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;Loading...&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;44&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;div&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;Not much to explain here, just added a new DIV tag and built up the HTML just like the original. Now we have two unordered lists. We also wrapped up each list in its own DIV tag.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_002.jpg" mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_002.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Now we’ll do some simple styling by floating the list of sites down the left hand side and the second list on the right and applying a little styling to the text.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:8a2e8219-4117-47f8-80c5-ce812781a69f class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt; 1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#menuNav
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;: left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    width: 170px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: 9px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#contentNav
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;:left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    list&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style: none outside none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; h1
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;top: 12px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: #&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;333333&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;21&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font: 36px&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;42px "Segoe WPC Light", "Segoe UI Light", Helvetica, Arial, Sans-Serif;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;22&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;23&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;24&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;25&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    width: 700px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;26&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;27&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;28&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;29&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    list&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style: none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;30&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;: left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;31&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    overflow: hidden;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;32&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin: &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; auto;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;33&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding: 10px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;34&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;35&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;36&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;37&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onSuccess()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;38&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;39&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites.getEnumerator();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;40&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;41&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;42&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;43&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="applist"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;44&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;h1&amp;gt;Apps&amp;lt;/h1&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;45&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;46&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;47&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="appbox"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;48&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;49&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; counter &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;50&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;51&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(items.moveNext())
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;52&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;53&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;54&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_serverRelativeUrl();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;55&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_title();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;56&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;57&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;58&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;59&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;60&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;61&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;62&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;63&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;64&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;65&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;66&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;67&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;68&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(menuNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;69&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;70&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;71&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;72&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#contentNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(contentNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;73&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;74&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;75&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;Here’s the updated output:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_003.jpg" mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_003.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Now it’s starting to look like our target. Let’s style the menu list with a larger font. We’ll also just make one line of code change in our markup in the onSuccess method. Find the line that says &lt;STRONG&gt;menuNavContent += ‘&amp;lt;ul&amp;gt;’&lt;/STRONG&gt; and change it to read &lt;STRONG&gt;menuNavContent += ‘&amp;lt;ul class=”apps”&amp;gt;’&lt;/STRONG&gt;. This will style just the unordered list of items on the left. &lt;/P&gt;
&lt;P&gt;Here are the new styles to add to the CSS &lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:274a8d7e-67ef-4ac0-90cc-8e42ee9b394c class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt; 1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appdir
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font: 15px&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;19px "Segoe WPC", "Segoe UI", Helvetica, Arial, "Arial Unicode MS", Sans-Serif;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;bottom: 9px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    overflow: hidden;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;decoration: none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a:hover
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: red;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;Now that we have the list done lets focus on the second list which will form our tiles. They’re not as live and vibrant as they could be but they do show some metadata from the site so are at least a little more informative than just navigation boxes.&lt;/P&gt;
&lt;P&gt;First we’ll apply some styles to the list to make them into boxes and space them apart. It’s just CSS markup here to add and a couple of small changes in the construction of the HTML for the second list.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:59e038ab-1cdd-4ce6-9b0a-6e9fc0e4b58f class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt;  1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appdir
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font: 15px&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;19px "Segoe WPC", "Segoe UI", Helvetica, Arial, "Arial Unicode MS", Sans-Serif;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#menuNav
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;: left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    width: 170px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: 9px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#contentNav
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;:left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    list&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style: none outside none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 21&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 22&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 23&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;bottom: 9px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 24&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    overflow: hidden;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 25&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 26&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 27&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 28&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;decoration: none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 29&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 30&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a:hover
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 31&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 32&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: red;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 33&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 34&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#applist &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; h1
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 35&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 36&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;top: 12px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 37&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: #&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;333333&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 38&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font: 36px&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;42px "Segoe WPC Light", "Segoe UI Light", Helvetica, Arial, Sans-Serif;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 39&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 40&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 41&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 42&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    width: 700px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 43&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 44&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 45&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 46&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    list&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style: none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 47&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;: left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 48&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    overflow: hidden;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 49&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin: &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; auto;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 50&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding: 10px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 51&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 52&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 53&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 54&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    width: 150px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 55&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    height: 150px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 56&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;bottom: 9px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 57&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: 12px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 58&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;bottom: 4px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 59&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;left: 4px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 60&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;float&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;: left;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 61&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    position: relative;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 62&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: white;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 63&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 64&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 65&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 66&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    color: white;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 67&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;decoration: none;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 68&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 69&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;#appbox &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ul.apps li a:hover
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 70&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 71&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 72&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;.theme_blue
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 73&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 74&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    background&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;color: #1ba1e2;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 75&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 76&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 77&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 78&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 79&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 80&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onSuccess()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 81&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 82&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites.getEnumerator();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 83&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 84&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 85&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 86&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="applist"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 87&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;h1&amp;gt;Apps&amp;lt;/h1&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 88&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul class="apps"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 89&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 90&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="appbox"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 91&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul class="apps"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 92&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; counter &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 93&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 94&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(items.moveNext())
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 95&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 96&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 97&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_serverRelativeUrl();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 98&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_title();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 99&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;100&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;101&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;102&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;103&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;104&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div style="cursor:pointer;" onclick="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;105&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;location.href='&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;';&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;106&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;107&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li class="theme_blue"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;108&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;109&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;110&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;111&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;112&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;113&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;114&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;115&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;116&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;117&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;118&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(menuNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;119&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;120&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;121&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;122&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#contentNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(contentNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;123&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;124&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;125&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;We’re just adding some new styles here. There’s a class called theme_blue set to the Metro blue (#1ba1e2) which we set as the background colour for each tile. In addition we set the entire tile to be clickable to the same url as the site. This lets the user click anywhere on the tile (or the list one the left) to launch the site rather than having to click on the title.&lt;/P&gt;
&lt;P&gt;Here’s the updated output.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_005.jpg" width=500 height=282 mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_005.jpg"&gt;&lt;/P&gt;
&lt;P&gt;Now that we have our tiles we can add some dynamic metadata to them. This will be pulled from the website itself and give us a navigation system that’s more information than just links.&lt;/P&gt;
&lt;DIV style="PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; DISPLAY: inline; FLOAT: none; PADDING-TOP: 0px" id=scid:9D7513F9-C04C-4721-824A-2B34F0212519:dd5b8e7f-0daa-45cc-9c59-67f9d6c7624f class=wlWriterEditableSmartContent&gt;&lt;PRE style="BACKGROUND-COLOR: #ffff80; WIDTH: 600px; FONT-FAMILY: Consolas; HEIGHT: 479px; FONT-SIZE: 11px; OVERFLOW: auto"&gt;&lt;DIV&gt;&lt;!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--&gt;&lt;SPAN style="COLOR: #008080"&gt;  1&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  2&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;/*&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; title for tiles &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;*/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  3&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;.tileTitle
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  4&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  5&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    bottom: 8px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  6&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    left: 6px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  7&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    position: absolute;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  8&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;size: 18px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;  9&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;weight: bold;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 10&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 11&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;/*&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; subtitle to display at top of tile &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;*/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 12&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;.tileSubtitle
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 13&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 14&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    font&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;-&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;size: 13px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 15&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    position: absolute;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 16&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    top: 4px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 17&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    left: 6px;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 18&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 19&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;style&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 20&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 21&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 22&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 23&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; onSuccess()
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 24&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 25&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.sites.getEnumerator();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 26&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 27&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;''&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 28&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 29&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="applist"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 30&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;h1&amp;gt;Apps&amp;lt;/h1&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 31&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul class="apps"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 32&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 33&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div id="appbox"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 34&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;ul class="apps"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 35&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; counter &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 36&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 37&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(items.moveNext())
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 38&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 39&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;try&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 40&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 41&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items.get_current();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 42&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_serverRelativeUrl();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 43&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.get_title();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 44&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lastItemModified &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; getModifiedDateString(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Date(item.get_lastItemModifiedDate()));
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 45&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 46&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 47&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;a href="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 48&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 49&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 50&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div style="cursor:pointer;" onclick="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 51&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;location.href='&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemUrl &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;';&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 52&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 53&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;li class="theme_blue"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 54&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 55&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 56&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div class="tileTitle"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; title &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 57&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;div class="tileSubtitle"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lastItemModified &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 58&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 59&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 60&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/li&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 61&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 62&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 63&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;catch&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(err)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 64&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 65&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; err.name;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 66&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;            contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; err.message;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 67&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 68&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 69&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 70&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 71&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    menuNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 72&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#menuNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(menuNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 73&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 74&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/ul&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 75&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    contentNavContent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;/div&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 76&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    $(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;#contentNav&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).html(contentNavContent);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 77&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 78&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 79&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;function&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; getModifiedDateString(date)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 80&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;{
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 81&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;""&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 82&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (date.getMonth()&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).toString();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 83&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 84&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; date.getDate().toString();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 85&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 86&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; date.getFullYear().toString();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 87&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; at &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 88&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; date.getHours().toString();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 89&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 90&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; date.getMinutes();
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 91&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(date.getHours() &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;11&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 92&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 93&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; PM&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 94&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 95&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 96&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    {
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 97&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;        rc &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;+=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; AM&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 98&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt; 99&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; rc;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;100&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;}
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;101&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;102&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;script&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008080"&gt;103&lt;/SPAN&gt; &lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/PRE&gt;&lt;!-- Code inserted with Steve Dunn's Windows Live Writer Code Formatter Plugin.  http://dunnhq.com --&gt;&lt;/DIV&gt;
&lt;P&gt;We wrap the title in a DIV tag with a class of tileTitle which lets us style it to place it at the bottom of the tile and give it a larger font. You do need to be careful of the length of the titles of your sites as this doesn’t work for all scenarios but just adjust it to fit your needs.&lt;/P&gt;
&lt;P&gt;We also pull the last modified item date from the web properties. Every site tracks whatever the last item that was modified is and holds onto the date for that item. So now users can see when some content on the site was last changed.&lt;/P&gt;
&lt;P&gt;Also we parse out the date from SharePoint into a JavaScript Date object and build a formatted date to display on the tile.&lt;/P&gt;
&lt;P&gt;The final image:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_final.jpg" width=500 height=281 mce_src="http://weblogs.asp.net/blogs/bsimser/metrodir/metrodir_final.jpg"&gt;&lt;/P&gt;
&lt;P&gt;That’s it! You now have a single script that you can just drop onto any site to create a Metro style navigation to the subsites. New sites can be added and will automatically show up and users can see when the content on the site was last modified and be able to click on the site to visit it.&lt;/P&gt;
&lt;P&gt;Here’s the &lt;A href="http://bilsimser.com/download/sitedirectory.js" mce_href="http://bilsimser.com/download/sitedirectory.js"&gt;full source code for the page&lt;/A&gt; for you play with.&lt;/P&gt;
&lt;P&gt;Remember, this is just a start. There are some fun things you can do with this. For example create custom styles for different colours (for example blue for team sites, red for wikis, etc.) and style them accordingly. Other ideas are to pull other data from the site like description, etc. and put that on a bigger tile. Enumerate the number of subsites in a site and display that. There are other properties you can access off the Web object like if RSS is enabled, etc. so you might want to display different icons on the tile to reflect that. The list of properties on the SP.Web class can be found &lt;A href="http://msdn.microsoft.com/en-us/library/ee549149.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ee549149.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;If you’re following the “Metro” style then remember to keep the UI light and simple. Content over chrome. You don’t want to be dumping all kinds of information here, just enough that your users need to make it useful.&lt;/P&gt;
&lt;P&gt;Enjoy!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8318472" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/aJVAKEDmS8FFm-cWGSGFFuRmeuM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aJVAKEDmS8FFm-cWGSGFFuRmeuM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/aJVAKEDmS8FFm-cWGSGFFuRmeuM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/aJVAKEDmS8FFm-cWGSGFFuRmeuM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=4c8km3u_PjM:n0BcnNvz7Kw:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=4c8km3u_PjM:n0BcnNvz7Kw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=4c8km3u_PjM:n0BcnNvz7Kw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=4c8km3u_PjM:n0BcnNvz7Kw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/jQuery/default.aspx">jQuery</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/SharePoint+2010/default.aspx">SharePoint 2010</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/JavaScript/default.aspx">JavaScript</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Metro/default.aspx">Metro</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/User+Interface/default.aspx">User Interface</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/02/28/metro-style-site-directory-for-sharepoint-using-emcascript.aspx</feedburner:origLink></item><item><title>InstaCam MetroMakeover - Spacing, Margins, and Polish for your Windows Phone App</title><link>http://feedproxy.google.com/~r/bsimser/~3/HNY3sIx91FQ/instacam-metromakeover-spacing-margins-and-polish-for-your-windows-phone-app.aspx</link><pubDate>Wed, 15 Feb 2012 19:53:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8297103</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8297103</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8297103</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/02/15/instacam-metromakeover-spacing-margins-and-polish-for-your-windows-phone-app.aspx#comments</comments><description>&lt;P&gt;In the spirit of a recent article that&amp;nbsp;Jeff Wilcox &lt;A href="http://www.jeff.wilcox.name/2012/01/metroradio-design/" mce_href="http://www.jeff.wilcox.name/2012/01/metroradio-design/"&gt;posted on his blog about the MetroRadio app&lt;/A&gt;, I thought I would do something similar for the &lt;A href="http://www.windowsphone.com/en-US/apps/b606738b-83a7-4c43-96fd-3c964de7f938" mce_href="http://www.windowsphone.com/en-US/apps/b606738b-83a7-4c43-96fd-3c964de7f938"&gt;InstaCam app&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;InstaCam is a 3rd party app written by Dmitry Manayev to bring &lt;A href="http://instagram.com/" mce_href="http://instagram.com/"&gt;Instagram&lt;/A&gt; functionality to the Windows Phone platform. I contacted Dmitry about this post to get his permission. Here are a few tweaks that you can keep an eye out for in your own apps.&lt;/P&gt;
&lt;P&gt;First up is the Popular Page. This has small square images of the most popular pictures currently posted on Instagram. The page is built on the Panorama control so the title is the default. It’s the pictures that are off a bit here. If they were indented 14 (or maybe 15) pixels then the edge of the pictures would line up with the pano title. Part of Metro is about lining things up and keeping it clean. You should see an invisible line down the left side of your pages that align things up. I saw the same margin issue on the search results page.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/popular_detail.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/popular_detail.png"&gt;&lt;/P&gt;
&lt;P&gt;Next up is the search results page. I found the spacing to be a little tight so after measuring it I found that the spacing was in line with&amp;nbsp;the minimum recommended target size from Microsoft,&amp;nbsp;7mm&amp;nbsp;(check&amp;nbsp;the&amp;nbsp;&lt;A href="http://msdn.microsoft.com/en-us/library/hh202889(v=vs.92).aspx" mce_href="http://msdn.microsoft.com/en-us/library/hh202889(v=vs.92).aspx"&gt;guidelines here for target sizes&lt;/A&gt;). In the recommendations they suggest a target size of 9mm rather than the minimum of 7mm. The idea with Metro is to open up the design and make liberal use of white space. Don’t crowd things together if you can avoid it. There's plenty of space so hitting the target of 9mm (with perhaps a larger font) might open up the page a little more.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/search_detail.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/search_detail.png"&gt;&lt;/P&gt;
&lt;P&gt;On the feed page there are a few little tweaks I would look at. First is the title for the app. The unwritten rule is that a page title should be in all CAPS. Hey, it’s a style. Check out (most) of the core apps and you’ll see the style applied there. Next is spacing. Jeff Wilcox mentioned there’s no hard and fast rule with vertical spacing (I really wish there was so we could all follow it, hint, hint) but he does say he tends to use 4, 6, 12, or 24 pixels. The default vertical on some of the initially generated XAML you get from Microsoft pegs some vertical space&amp;nbsp;at 17 pixels so the message here&amp;nbsp;can be confusing. For the title spacing I thought a 14px top margin would work here (but 12 would be fine too).&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/feed_details01.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/feed_details01.png"&gt;&lt;/P&gt;
&lt;P&gt;The thing about spacing is be consistent! I don’t think it matters if it’s 12, 17, or 24 but keep it the same on every page. That should be your mantra. Consistency. With vertical spacing (and especially page titles) watch out for the top margin where the system indicators are. If you leave them turned on, you lose 22 pixels. If you turn them off you get that back but remember to turn them on or off across your entire app (or compensate for pages where you have it turned on). For example Panorama pages have the system tray turned off by default so if your app goes from a Pano to a single page (or a pivot) then you might notice a slight “jump” with the title as it moves from a page without the system tray to one with.&lt;/P&gt;
&lt;P&gt;Down in the details for a single picture it shows the user who took it, some information about them, and the likes and comments for that photo.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/feed_details02.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/feed_details02.png"&gt;&lt;/P&gt;
&lt;P&gt;The name and when the picture was taken is a little crowded here and butts up against the profile picture. The suggestion here is to apply a 12 pixel margin to the left of the name (or the right of the picture) to open things up. In addition I would personally put the like and comment counts inside of the symbols (using white to offset the colour). That’s just a personal preference but it might make it a little tighter and gives you more space to be able to use larger symbols. There is a gotcha here of course with numbers inside of symbols. Some images will have 0 comments, other will have 10,000. I have seen a situation where the font scaled based on the width of the number so that might be an option. For sure when testing something like this you should consider ranges like this and try out the extremes. You might not be able to catch every scenario but don't just design for say 4 digits when the possibility of 8 exists for example.&lt;/P&gt;
&lt;P&gt;When you view a single image I noticed a few things that a slight adjustment would fix. Again, a lot of these changes here are just minor tweaks to the UI, nothing major. I think this is the case for a lot of applications out there. A couple of hours going over things and moving a few items around goes a long way.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/image_details.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/image_details.png"&gt;&lt;/P&gt;
&lt;P&gt;Here again the margin issue rears it’s ugly head. The margin for the Like button is fine (and bleeding the picture itself to the edge of the phone is a nice touch, lets you see more of the image). It’s the tags and detail labels. The colour doesn’t work against a dark background. Whenever you’re looking to highlight something consider using the PhoneAccentBrush colour (but use it sparingly). Dmitry did mention in the latest update that he fixed the colour to the blue phone accent colour. I took these sceenshots from the marketplace so maybe that hasn't been updated. On my phone the text does look better than here but again, watch out for themes when deciding on using accent colours, especially with fixed colour or image backgrounds.&lt;/P&gt;
&lt;P&gt;As for the buttons, they’re a little off so as your eye moves horizontally across you see text jump up or down. It’s only a few pixels but a design technique mentioned by Arturo Toledo, a Senior User Experience Designer at Microsoft. On his UX blog he recently talked about the &lt;A href="http://ux.artu.tv/?p=192" mce_href="http://ux.artu.tv/?p=192"&gt;design process for Metro apps&lt;/A&gt;. In it he talks about Redlines, marked up screenshots of your app with lines drawn across and up to show alignment and spacing. This is something everyone should incorporate into their release process. Yes, my lines are magenta but that was just for clarity. Red, yellow, magenta, whatever works for you.&lt;/P&gt;
&lt;P&gt;For the buttons themselves I would consider doing something with the extra space. Split the buttons (either using a Grid or a StackPanel with the Orientation set to Horizonal) so they’re evenly distributed (Width = 0.5* in the case of a grid). Then regardless of how much the content takes up, they’re consistent and not as jarring to the eyes. Again here I might consider putting the counts inside the symbols (to be consistent with the other views if you did that) but leave the words “Likes” and “Comments” so people know what it refers to. Here the words work because you’ve got the entire width of the phone to display them (vs. the previous image where there’s only room for the symbol).&lt;/P&gt;
&lt;P&gt;Finally the user profile page. I would suggest a few small changes here just like the other pages.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://weblogs.asp.net/blogs/bsimser/instacam/profile_details.png" mce_src="http://weblogs.asp.net/blogs/bsimser/instacam/profile_details.png"&gt;&lt;/P&gt;
&lt;P&gt;For this page:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Align the profile picture with the page title&lt;/LI&gt;
&lt;LI&gt;Align the counts and count labels (photos, following, etc.) on the left. This tends to be the norm rather than centered text which sometimes looks like its floating without an anchor. Again refer to the core apps for some guidance here, for example take a look at a persons profile page (your own or someone else). They’re a good model to follow.&lt;/LI&gt;
&lt;LI&gt;The colours here are awkward again and hard to read. If you use the PhoneAccentBrush colour then pay attention to how the light and dark themes work against your backgrounds. Sometimes when using background images you need to adjust the Opacity dynamically. When testing, just go through all of the Theme colours in both light and dark mode. It takes an hour or so with a few screens and all of the combos but you’ll cover all the bases.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;That’s it. Hopefully that helps you in your own application development and gives you a few little things to look out for. They’re all minor tweaks but things that you can add to a final checklist of things to go over before you submit your app to the marketplace. Thanks for Dmitry for letting me write this post and perhaps he’ll put some of these suggesting in a future release.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8297103" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WjLAxsygNViwg1mVta64ZKRbj9E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WjLAxsygNViwg1mVta64ZKRbj9E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WjLAxsygNViwg1mVta64ZKRbj9E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WjLAxsygNViwg1mVta64ZKRbj9E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=HNY3sIx91FQ:7PuFlci1LSk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=HNY3sIx91FQ:7PuFlci1LSk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=HNY3sIx91FQ:7PuFlci1LSk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=HNY3sIx91FQ:7PuFlci1LSk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/WP7/default.aspx">WP7</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Metro/default.aspx">Metro</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Design/default.aspx">Design</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/02/15/instacam-metromakeover-spacing-margins-and-polish-for-your-windows-phone-app.aspx</feedburner:origLink></item><item><title>Calgary! SharePoint! Workflows! Pigs! Action!</title><link>http://feedproxy.google.com/~r/bsimser/~3/t-1qh8YCvBE/custom-workflow-actions-calgary-sharepoint-users-group.aspx</link><pubDate>Wed, 15 Feb 2012 15:16:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8296935</guid><dc:creator>Bil Simser</dc:creator><slash:comments>0</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8296935</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8296935</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/02/15/custom-workflow-actions-calgary-sharepoint-users-group.aspx#comments</comments><description>&lt;P&gt;Join me and a cast of thousands as we do an interpretive dance version of Lord of the Flies.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 400px; HEIGHT: 300px" title="Jason Kaczor as Piggy" alt="Jason Kaczor as Piggy" src="http://weblogs.asp.net/blogs/bsimser/Piggy-Lord-of-the-Flies.jpg" width=400 height=300 mce_src="http://weblogs.asp.net/blogs/bsimser/Piggy-Lord-of-the-Flies.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Oh yeah, and Jason Kaczor will also be presenting on custom workflow actions and SharePoint. &lt;/P&gt;
&lt;P&gt;From the marketing blurbage:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;This presentation is about Custom actions which are .NET components. I will also be presenting some best practice framework code as well for trace logging/etc. I will also talk about Event Receivers – they tie closely to the concept of “something executing based on something else changing” like workflows, but are occasionally the better choice to use. &lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Registration is preferred for this event. Those that register will be given an extra cookie. Please register at either &lt;A href="http://calspug-2012-02-23.eventbrite.ca/" mce_href="http://calspug-2012-02-23.eventbrite.ca"&gt;EventBrite&lt;/A&gt; or Microsoft &lt;A href="http://www.clicktoattend.com/?id=159514" mce_href="http://www.clicktoattend.com/?id=159514"&gt;ClickToAttend&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8296935" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/botQuWLZnpKr3XqpMAO9mfsUUdk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/botQuWLZnpKr3XqpMAO9mfsUUdk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/botQuWLZnpKr3XqpMAO9mfsUUdk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/botQuWLZnpKr3XqpMAO9mfsUUdk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=t-1qh8YCvBE:-z5ATrNTy_A:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=t-1qh8YCvBE:-z5ATrNTy_A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=t-1qh8YCvBE:-z5ATrNTy_A:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=t-1qh8YCvBE:-z5ATrNTy_A:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/SharePoint/default.aspx">SharePoint</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/02/15/custom-workflow-actions-calgary-sharepoint-users-group.aspx</feedburner:origLink></item><item><title>Does the world really need "official" apps?</title><link>http://feedproxy.google.com/~r/bsimser/~3/dlW7Fr5YKrI/does-the-world-really-need-quot-official-quot-apps.aspx</link><pubDate>Fri, 10 Feb 2012 14:42:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8292591</guid><dc:creator>Bil Simser</dc:creator><slash:comments>5</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8292591</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8292591</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/02/10/does-the-world-really-need-quot-official-quot-apps.aspx#comments</comments><description>&lt;p&gt;The "buzz" exploded a few days ago &lt;a href="https://wprequests.uservoice.com/forums/149122-official-application-requests" mce_href="https://wprequests.uservoice.com/forums/149122-official-application-requests"&gt;with this site&lt;/a&gt;. "Official" application requests for Windows Phone 7, vendors and services that don't have a presence (an official one anyway) on the Microsoft phone platform. I have to ask though, do we really need an "official" app?&lt;/p&gt;&lt;p&gt;Okay, let's take a few steps back before we go forward. What exactly is an "official" app. I would say it's a) an app written by the service owner (Instagram, Pinterest, Twitter, etc.) or maybe b) an app officially endorsed by the service owner. In any case it's considered sanctioned, blessed, whatever. Foursquare, Flickr, Groupon, Twitter, YouTube, etc. all have apps like this. In the case of apps like YouTube and Twitter you'll see the application publisher is Microsoft. These guys might have deferred the creation of the apps to Microsoft or the publishing or both.&lt;br&gt;&lt;/p&gt;&lt;p&gt;People see these apps as *the* app they should get if they want to use that service on their phone. Apps turn into verbs and users are told to use Evernote to use their service on their phone. With the moniker of being an official app I suppose it carries a bit of levity as far as stability and reliability.&lt;br&gt;&lt;/p&gt;&lt;p&gt;Or does it?&lt;/p&gt;&lt;p&gt;In the case of longevity it might be the case. As long as ESPN is on the air, they'll have an ESPN ScoreCenter app. Or will they? Budgets come and go so if I was a manager and looked at "trimming the fat" I might consider lopping off the mobile developers and abandoning that early. After all, how much revenue does a free app on a phone get you? I do think once the genie is out of the bottle that organizations will at least try to keep that division running and we haven't seen too many apps fall by the wayside. So yeah, it's probably a safe bet that "official" apps will stay around as long as the service is there.&lt;/p&gt;&lt;p&gt;On the reliability side it's a different story. What's the number #1 request on the user voice site right now? Facebook. Wait, that has an "official" app doesn't it? It was built by Clarity Consulting but looking at the comments on the uservoice site and on the marketplace you see things like "They need to fix this", "Add some new features", and "Need a lot of work!!". The Twitter app, IMHO, is another fine example of an "official" app generally gone wrong. No live tiles, it's been out for 16 months and it's only on version 1.3 and last time I used it I couldn't even do a "reply all" on a tweet. Frustrating.&lt;/p&gt;&lt;p&gt;Official apps may be no better than 3rd party ones out there so don't be fooled by the "official" title. Indie apps are built by developers with a passion, official apps might in some cases be considered an IT expense.&lt;/p&gt;&lt;p&gt;The first thing you have to look at, does the vendor or service have an app? On any platform. If they don't then the next question (besides should they) might be, is there a way to get one on there? Are there any data sources available. Obviously if they have a web presence then they have data but it may not be publicly consumable. If they do have an app, is it good enough. What are the reviews like? Is it meeting the needs of the many and providing a way to access their services to do everything. Is that the purpose of the app? Sometimes apps are supplements to the on-site services they have available and not a substitute. Aside from services, does the app work correctly, doesn't crash, is quick to respond, is updated frequently to align to new features the service offers, etc.&lt;/p&gt;&lt;p&gt;If they do have an API is it a) publicly consumable and b) is it full featured? One stumbling block I hit with producing an &lt;a href="http://www.simstools.com/apps-2/photogram/" mce_href="http://www.simstools.com/apps-2/photogram/"&gt;Instagram app for Windows Phone&lt;/a&gt; was that they didn't provide a way for users to register new accounts or upload photographs, a cornerstone to the service itself. This can be frustrating so before you embark on perhaps building something check to see if you can do it. &lt;/p&gt;&lt;p&gt;So what's the value-add for you building an application, either as the only application on that platform or a supplement to a broken or limited-functional "official" app? Are you making it better or filling in the gaps the official app is missing? What happens when the official app maybe catches up and delivers that functionality. Now you're playing a game with the official team and you might not win that battle. Something interesting with something like Foursquare is that the reviews are not too horrible (some good, some bad) but looking at the reviews and functionality of something like &lt;a href="http://www.4thandmayor.com/" mce_href="http://www.4thandmayor.com/"&gt;4th &amp;amp; Mayor&lt;/a&gt; is that the official app came out long after Jeff Wilcox's version. Was it too little and too late? Jeff constantly updates the app not only for stabilization but new features. The reviews, UX, and stability of this "unofficial" app outweighs the popularity of the "official" one, although I think this an exception to the rule. Again, this is a good example of a labor of love vs. an IT project.&lt;/p&gt;&lt;p&gt;I think it's great we have the official apps on the Windows Phone but I think it's even better that we have public APIs, a nice development platform, and a passionate community that wants to do better. If all we do is accept the official apps then we're not pushing the envelope. Sometimes that's just not good enough and we as a community deserve better. Support it by showing your voice on sites like the &lt;a href="https://wprequests.uservoice.com/forums/149122-official-application-requests" mce_href="https://wprequests.uservoice.com/forums/149122-official-application-requests"&gt;Marketplace Request site&lt;/a&gt;, by blogging about it, and by pushing services to provide the ability for developers to step in and help out. &lt;/p&gt;&lt;p&gt;As for vendors and service owners, please do us a favor by exposing your APIs and letting developers do what they do best, develop. Focus on your service if you want and put it out there for others to pick up the ball and run with it. Keep on top of what's out there, help us by helping you, and you might be surprised in what we might be able to accomplish. It's like I tell game studios, focus on building your game. The development community will stand up and provide the supplemental tools that will build the community for you, you just have to give us the tools to do what we're passionate about.&lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8292591" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/WIa4gQ5nUum85UBbGIwtRwS93Lk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WIa4gQ5nUum85UBbGIwtRwS93Lk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/WIa4gQ5nUum85UBbGIwtRwS93Lk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/WIa4gQ5nUum85UBbGIwtRwS93Lk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=dlW7Fr5YKrI:VJqhqnWZWyg:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=dlW7Fr5YKrI:VJqhqnWZWyg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=dlW7Fr5YKrI:VJqhqnWZWyg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=dlW7Fr5YKrI:VJqhqnWZWyg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Windows+Phone/default.aspx">Windows Phone</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/02/10/does-the-world-really-need-quot-official-quot-apps.aspx</feedburner:origLink></item><item><title>The Big Dummies Guide for Windows Phone Developer Resources</title><link>http://feedproxy.google.com/~r/bsimser/~3/GZnikjtFsks/the-big-dummies-guide-for-windows-phone-developer-resources.aspx</link><pubDate>Mon, 30 Jan 2012 01:13:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8271678</guid><dc:creator>Bil Simser</dc:creator><slash:comments>2</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8271678</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8271678</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/01/29/the-big-dummies-guide-for-windows-phone-developer-resources.aspx#comments</comments><description>&lt;P&gt;Windows Phone apps are growing in popularity as does the &lt;STRIKE&gt;50,000&lt;/STRIKE&gt; 60,000 apps in the marketplace today. Microsoft has done a great job at putting together &lt;A href="http://create.msdn.com/en-US/education/basics/developer_resources" mce_href="http://create.msdn.com/en-US/education/basics/developer_resources"&gt;some resources&lt;/A&gt; for developers including &lt;A href="http://msdn.microsoft.com/en-us/library/ff402535(VS.92).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ff402535(VS.92).aspx"&gt;full documentation&lt;/A&gt;. When you first land on &lt;A href="http://create.msdn.com/" mce_href="http://create.msdn.com"&gt;App Hub&lt;/A&gt; there’s all kind of samples, toolkits, and quick starts to get you going.&lt;/P&gt;
&lt;P&gt;This post is to fill in some gaps and direct you to some additional resources that I’ve built up over the last couple of years of building phone apps. I won’t regurgitate the Microsoft resources here, you can get all of those at the App Hub itself. Instead these are other resources that will hopefully be useful.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Toolkits and Utilities&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;What you get out of the box is a lot but there is a lot more to offer out there that others have come up with. Here are a few.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://wp7nl.codeplex.com/" mce_href="http://wp7nl.codeplex.com/"&gt;Wp7nl utilities&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here’s a collection of utilities put together by the Dutch Windows Phone developer community. A lot of great small classes here that you can leverage in your app with some cool controls and new behaviours. It even has NuGet Support so adding it to your project is a no-brainer.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://northernlights.codeplex.com/" mce_href="http://northernlights.codeplex.com/"&gt;Northern Lights WP7 Toolkit&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a nice little set of classes and while not as all-encompassing as others, does have a couple of killer things you must have on your phone. Namely an error reporting system (Little Watson) and a system to let users know of new versions and features. Must have!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://agfx.codeplex.com/" mce_href="http://agfx.codeplex.com/"&gt;Agfx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I’m always writing code to call HttpRequest (or WebClient), download data from a site, deal with callbacks, then deal with updating my ViewModel. Agfx takes the heavy lifting out of a lot of this and tosses in free caching (with policies you specify like auto-refresh) making it a breeze. Highly recommended for any Windows Phone project that needs data.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit for Windows Phone&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is from the Windows team and again, open source, providing you with a dozen or so controls including a frame system that lets your apps look and behave like the core ones, just with one line of code and a few lines of XAML markup on each page.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://tombstonehelper.codeplex.com/" mce_href="http://tombstonehelper.codeplex.com/"&gt;Tombstone Helper&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I’ve always had to write classes and plumbing code when dealing with tombstoning (saving the state of your app). This helper comes as a NuGet package that you can handle all your tombstoning needs with 1 line of code. Simple and easy.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://visualstudiogallery.msdn.microsoft.com/bd351303-db8c-4771-9b22-5e51524fccd3" mce_href="http://visualstudiogallery.msdn.microsoft.com/bd351303-db8c-4771-9b22-5e51524fccd3"&gt;NotifyPropertyWeaver&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;We all hate writing the same boring get/set code for our MVVM properties. Enter this tool. It adds a custom MS Build task to your project and will take care of that for you. Now you just write POCO classes and the rest is handled for you. You're welcome.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://ylad.codeplex.com/" mce_href="http://ylad.codeplex.com/"&gt;Your Last About Dialog&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Tired of writing about dialogs and screens? Install this (via NuGet of course!) and call it with one line of code. Viola. A complete A bout page with your own user definable pivots, license information, credits, etc. You can even load pages remotely and if there’s no network connection no problem, the library will handle it.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dotnetbyexample.blogspot.com/2011/10/standard-about-page-for-windows-phone-7.html" mce_href="http://dotnetbyexample.blogspot.com/2011/10/standard-about-page-for-windows-phone-7.html"&gt;About Page Revisited&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Another great about page, this one is driven from local resources and requires no coding, just configuration. I use this on some of my apps where I want to programatically hide/show sections of the above page (for example showing a "buy" button&amp;nbsp;but only for trial apps).&amp;nbsp;Nice!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://phoney.codeplex.com/" mce_href="http://phoney.codeplex.com/"&gt;Phoney Tools&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Another useful library with a smattering of great controls, helpers, and converters. Drop in, use, profit (okay, the last part might take some work).&lt;/P&gt;
&lt;P&gt;&lt;A href="http://mvvmlight.codeplex.com/" mce_href="http://mvvmlight.codeplex.com/"&gt;MVVM Light&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Silverlight apps on Windows Phone 7 greatly benefit from databinding and not the databinding you learned to hate in VB6. This is true, two-way databinding that lets&amp;nbsp; you separate your concerns with your app correctly. MVVM Light is one library that helps do this (you can just use IPropertyNotify on your own classes) but provides other things like behaviours that can be bound to properties for eventing. Very useful.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://caliburnmicro.codeplex.com/" mce_href="http://caliburnmicro.codeplex.com/"&gt;Caliburn Micro&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Another MVVM library that works great with Windows Phone 7 (be sure to get the latest code, the NuGet package at the time of this writing didn’t support Mango and needs to be updated).&lt;/P&gt;
&lt;P&gt;&lt;A href="http://nuget.org/packages/SlickThoughtTrialManager" mce_href="http://nuget.org/packages/SlickThoughtTrialManager"&gt;SlickThought TrialManager&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a great add-on that will help you deal with checking if the phone is in trial mode or not which will let you toggle different features or parts of the UI. An added feature is a simple toggle in your App.xaml file will let you put the app into Trial mode to test things out before sending to the marketplace. I packaged this up into a NuGet package so you can add it to any project quickly but check out the documentation on the project site as to how to use it (it's really easy).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Design&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Design is a huge part of Windows Phone apps looking to capitalize on the Metro Design Language.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/hh394033(v=vs.92).aspx" mce_href="http://msdn.microsoft.com/en-us/library/hh394033(v=vs.92).aspx"&gt;Application Artwork&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;All kinds of icons and images go into just the basic Windows Phone app. Don't worry, it's not complex but it helps having a slick design. Look at getting one from any of the many low-price services out there (check out places like GraphicRiver for some people that would be more than happy to do some work for you). My first few apps I picked up some icons cheap ($5) from sites. Other places are creative commons licensed photos if you need them (make sure you include the proper credits in your About dialog). Microsoft has put together this page for you and while it won't make your app look awesome, it will tell you what graphics you need and where they're used.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jeff.wilcox.name/2011/10/metrogridhelper/" mce_href="http://www.jeff.wilcox.name/2011/10/metrogridhelper/"&gt;Metrogrid Helper&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a simple class that overlays a series of translucent boxes, all evenly spaced, on your app during debug time. It’s invaluable to check the lining up of those controls and titles. By Jeff Wilcox and the Windows Phone team.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://ux.artu.tv/?page_id=190" mce_href="http://ux.artu.tv/?page_id=190"&gt;31 Weeks of Windows Phone Design&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The UX design team got into the habit of posting detailed articles on the Metro design language and it's nuances. It's a fascinating deep dive with a ton of great ideas around how the design of Metro apps works and provides some excellent insight into the design process that you can use in your apps.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/" mce_href="http://www.jeff.wilcox.name/2011/03/metro-design-guide-v1/"&gt;Metro Design Guide&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Microsoft offers a design guide which is great but Jeff Wilcox turns it up to 11 with this post, covering all kinds of implementation tips developers should use before submitting an app.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/b/silverlight_sdk/archive/2011/01/07/windows-phone-7-design-guidelines-cheat-sheet.aspx" mce_href="http://blogs.msdn.com/b/silverlight_sdk/archive/2011/01/07/windows-phone-7-design-guidelines-cheat-sheet.aspx"&gt;Design Guide Cheatsheet&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Cheryl Simmons on the Windows Phone team has a great cheatsheet to follow here for all Windows Phone developers. Great tips on a variety of subjects.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Resources&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://incompetech.com/m/c/royalty-free/collections.html" mce_href="http://incompetech.com/m/c/royalty-free/collections.html"&gt;Royalty free music&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Games for sure need music but nothing stopping you from putting original music into an app. Here are some royalty free resources you can use.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://templarian.com/project_windows_phone_icons/" mce_href="http://templarian.com/project_windows_phone_icons/"&gt;Templarian Phone Icons&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Hundreds of great looking Windows Phone icons you can use in your app, app bar, etc. all licensed under Creative Commons.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Development&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jeffblankenburg.com/2010/09/30/31-days-of-windows-phone-7/" mce_href="http://www.jeffblankenburg.com/2010/09/30/31-days-of-windows-phone-7/"&gt;31 Days of Windows Phone&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Jeff Blanketburg took it upon himself to post 31 days of Windows Phone tips that covers all the basics you need to get going. Each post is deep on each topic and a recommended read to get into any of the core controls and features for building WP7 apps.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jeffblankenburg.com/2011/10/31/31-days-of-mango/" mce_href="http://www.jeffblankenburg.com/2011/10/31/31-days-of-mango/"&gt;31 Days of Mango&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The last update for Windows Phone called Mango added all kinds of great new features like live tiles, search integration, running under lock screens, etc. Jeff comes back with 31 more days for Mango specific features.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://mstruys.com/2012/01/19/messagebox-navigation-and-application-life-cycle/" mce_href="http://mstruys.com/2012/01/19/messagebox-navigation-and-application-life-cycle/"&gt;MessageBox and Application Lifecycle&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This can be tricky when you’re trying to not only pass certification but manage popups and screens. Here’s a post to help you through that.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://jesseliberty.com/windows-from-scratchindex/" mce_href="http://jesseliberty.com/windows-from-scratchindex/"&gt;Windows From Scratch&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Jesse Liberty, another huge name in the Windows Phone arena, has a whole set of tutorials focused on single tasks (currently over 30 of them). Great stuff and very useful!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blog.adamnathan.net/" mce_href="http://blog.adamnathan.net/"&gt;101 Windows Phone Apps&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Adam Nathan did the community a solid by creating 101 Windows Phone apps, then writing two books on it (there’s only enough room in a single book). Each app is detailed in a separate blog post on his site and covers various types of apps you would build with WP7 like stop watches, calendars, to do lists, and more.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Internationalization&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Windows Phone is everywhere, not just English speaking nations!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://nanapho.jp/archives/2011/11/how-to-make-your-app-pinworthy-in-japanese-market/" mce_href="http://nanapho.jp/archives/2011/11/how-to-make-your-app-pinworthy-in-japanese-market/"&gt;Make your apps Kanji-friendly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A nice post on how your app can be more recognizable and (perhaps) popular in the Japanese markets. With Nokia phones hitting the marketplace, this tip is invaluable to reach out beyond your own backyard.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ff637522(v=vs.92).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ff637522(v=vs.92).aspx"&gt;Globalization and Localization for your Phone&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;A great MSDN article (actually a series of them) that walks you through setting up localization for multiple languages. It’s easy and even if you only support one language, do this so all your strings are in a resource file and not hard coded for easy updates.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Achievements&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If you’re building a game or even want to incorporate leaderboards and achievements into your phone app look no further.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://mogade.com/" mce_href="http://mogade.com/"&gt;Mogade&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a free and open source solution with a back-end server to keep track of your own user defined leaderboards and achievements. You define it on the site and with a few simple calls in your code, upload scores and award achievements to users and display global leaderboards in your app. Silverlight and XNA samples available to get you started.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Marketing&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Building your app is just part of the process, then comes getting it out to the masses and keeping the word out.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://wp7appsite.codeplex.com/" mce_href="http://wp7appsite.codeplex.com/"&gt;Windows Phone 7 App Site Template&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is a complete one-page site template that’s completely data driven. You just make some modifications to the app name, provide some screenshots, deep links, etc. and you’re good to go. There’s even integrated Twitter and Uservoice support.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blog.adamnathan.net/2010/11/04/MarketplaceTipsForWindowsPhone7DevelopersTheGoodTheBadAndTheUgly.aspx" mce_href="http://blog.adamnathan.net/2010/11/04/MarketplaceTipsForWindowsPhone7DevelopersTheGoodTheBadAndTheUgly.aspx"&gt;Marketplace Tips&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Adam Nathan puts together his own personal tips for submitting to the marketplace. Feel free to use this as a checklist. I do.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Training&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.goodcat-trainings.net/" mce_href="http://www.goodcat-trainings.net/"&gt;Free Windows Phone Training&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;No, this isn’t a link to some overpriced course. It’s a link to over 20 hours of free video training put together by Peter Kuhn. The videos include complete source code and walk through all the aspects of building Windows Phone apps from soup to nuts.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Tools&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Tools are any part of a good developers kit and there’s no shortage of them for Windows Phone developers.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://firstfloorsoftware.com/silverlightspy/" mce_href="http://firstfloorsoftware.com/silverlightspy/"&gt;Silverlight Spy&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Think of it as Firebug for your phone. Why are you still reading this?&lt;/P&gt;
&lt;P&gt;&lt;A href="http://istool.codeplex.com/" mce_href="http://istool.codeplex.com/"&gt;Isolated Storage Explorer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Wondering if you’re writing the right thing to your phone or want to take a look at where things are going in your app? This tool lets you peek inside the storage system for you.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.innovativetechguy.com/?p=164#awp::?p=164" mce_href="http://www.innovativetechguy.com/?p=164#awp::?p=164"&gt;Windows Phone Screenhot Tool&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is an awesome tool and installs with ClickOnce so you always have the latest version. It lets you take screenshots effortlessly with or without an emulator skin so you can do cool shots for your blog and take the final images for the marketplace.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://wp7emuskinswitcher.codeplex.com/" mce_href="http://wp7emuskinswitcher.codeplex.com/"&gt;Emulator Skin Changer&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Bored with the out of the box emulator every time you launch it from Visual Studio? This tool let’s you change up the skin to something more sexy and fun, all with the click of a button. Be the cool kid at your next Windows Phone presentation and amaze your friends!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Monetization&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://create.msdn.com/en-US/education/basics/ads" mce_href="http://create.msdn.com/en-US/education/basics/ads"&gt;Microsoft Advertising Services&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Microsoft has continued to expand it’s monetization services by offering up ads in new markets (and markets are being added regularily). Various reports have different successes with these services but they’re baked into the Mango SDK and easy to setup and use.&lt;/P&gt;
&lt;P&gt;This is by far a complete list so please leave a comment with more links, suggestions, and corrections as you see them. I’ll update the post as quickly as I can.&lt;/P&gt;
&lt;P&gt;Now, go get building your first Windows Phone app!&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8271678" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7R4ASqLvLzvyio9VJBXUAgoN8os/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7R4ASqLvLzvyio9VJBXUAgoN8os/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7R4ASqLvLzvyio9VJBXUAgoN8os/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7R4ASqLvLzvyio9VJBXUAgoN8os/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=GZnikjtFsks:8CNKrh0X-oA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=GZnikjtFsks:8CNKrh0X-oA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=GZnikjtFsks:8CNKrh0X-oA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=GZnikjtFsks:8CNKrh0X-oA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/WP7/default.aspx">WP7</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/01/29/the-big-dummies-guide-for-windows-phone-developer-resources.aspx</feedburner:origLink></item><item><title>Visual Studio Achievements - Remember Kids They're Just For Fun</title><link>http://feedproxy.google.com/~r/bsimser/~3/9U9csuOBZlY/visual-studio-achievements-they-re-just-for-fun.aspx</link><pubDate>Wed, 18 Jan 2012 17:01:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:8262427</guid><dc:creator>Bil Simser</dc:creator><slash:comments>6</slash:comments><wfw:commentRss>http://weblogs.asp.net/bsimser/rsscomments.aspx?PostID=8262427</wfw:commentRss><wfw:comment>http://weblogs.asp.net/bsimser/commentapi.aspx?PostID=8262427</wfw:comment><comments>http://weblogs.asp.net/bsimser/archive/2012/01/18/visual-studio-achievements-they-re-just-for-fun.aspx#comments</comments><description>&lt;P mce_keep="true"&gt;I followed a neat project for the last couple of months which today became a reality, &lt;A href="http://channel9.msdn.com/Blogs/C9Team/Announcing-Visual-Studio-Achievements" mce_href="http://channel9.msdn.com/Blogs/C9Team/Announcing-Visual-Studio-Achievements"&gt;Visual Studio Achievements&lt;/A&gt;. Achievements are something the gaming world are very familiar with. They're milestones of recognition to meet like "Blowing up 30 Enemies with 1 Grenade"&amp;nbsp;or "Destroy a Super Tank playing the Classic Game". There are&amp;nbsp;a lot&amp;nbsp;of sites around the Internet to track them including one dedicated to just XBox 360 ones &lt;A href="http://www.xbox360achievements.org/" mce_href="http://www.xbox360achievements.org"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P mce_keep="true"&gt;They're fun and you get a bit of an internal high when you see this on your screen:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 325px; HEIGHT: 69px" src="http://weblogs.asp.net/blogs/bsimser/achievement.jpg" width=325 height=69 mce_src="http://weblogs.asp.net/blogs/bsimser/achievement.jpg"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;The Visual Studio Achievements follows the same idea and, once installed, are based on your activity as you work. Achievements are measured and discovered in the background when&amp;nbsp;you compile. And hey, it's cool and fun to see this after a compile:&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 524px; HEIGHT: 315px" src="http://files.channel9.msdn.com/thumbnail/5a978ac6-1889-486c-8cef-43060baa8d1c.png" width=524 height=315 mce_src="http://files.channel9.msdn.com/thumbnail/5a978ac6-1889-486c-8cef-43060baa8d1c.png"&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;However when you look through the list of achievements one thing jumps out to those that try to follow good coding practices. These are certainly not that. In fact if I caught you writing a class with 10 levels&amp;nbsp;of inheritance I would rip you a new one at the next daily stand up that would make even the likes of Gordon Ramsay shake in his knees.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Ahh but you say these are for fun. Yes, yes they are and far from me to be the party pooper. What sparked me to write this blog response is to emphasize F-U-N and not practice. Seriously you won't believe (or maybe you will) how many developers I talked to around me that thought this was a cool thing to install in their work environment.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Wait. Let's think about this for a minute.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Install achievemnts add-on in work environment.&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Do work&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Get achievment&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;Okay, the first step is fine. The second step is what we do. The third step? Hang on. Didn't I just say that having 10 levels of inheritance is a bad thing? So if you get the achievement during your daily work it should be a *bad* thing, not something to celebrate. &lt;/P&gt;
&lt;P mce_keep="true"&gt;It's like breaking the build (which we all do at some point and certainly people get ridiculed for it, it's all fun right). Breaking the build is a bad thing but it's a good spin. It means we recognize something went wrong and whatever mechanism you have to let you know (since everyone on the team should get notified) means you get up, rally around, and fix the problem. Good stuff. Build fixed, work continues.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Where's the rallying here? The only thing that will happen is the dev will see the achievement, pat himself on the back and have a chuckle then what? What *should* happen if you installed this and got an achievment should be:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Do work&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Get achievement&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Chuckle&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Silently say "Oh shit"&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Fix problem&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV mce_keep="true"&gt;Lather, Rinse, Repeat&lt;/DIV&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P mce_keep="true"&gt;Hopefully this is the case, but again I've asked a few people and they miss the point of the fun aspect here. This shouldn't be something you strive to achieve, the achievements here (as they stand currently) should be something to avoid. In fact it should set of an internal&amp;nbsp;whoop-whoop alarm and cause you to think "What the Hell was I thinking".&lt;/P&gt;
&lt;P mce_keep="true"&gt;Before you dismiss me, I'm all for fun. I'm the guy that has robot zombies and&amp;nbsp;posters of Close Encounters&amp;nbsp;in my cubicle and challenges developers to games of magnetic Angry Birds after stand-up. I'm all that. However I just want people to be aware that this is fun and there might be&amp;nbsp;a message here. Keep focused on good practices and not bad ones. In the game achievement world, we *try* to achieve these tasks. Heck when I get a game and I'm bored I look through the achievements and set myself up to try to accomplish it (mostly failing since I literally suck at almost every game). &lt;/P&gt;
&lt;P mce_keep="true"&gt;However developers should not be looking at these achievements as something they should be striving for (except just to get the achievement and make it onto the site). What would I really like to see? Some actual achievements that developers can strive for and be proud to achieve. How about "Eliminate 10% of the codebase without removing functionality"&amp;nbsp;or "Mock a service and pass 10 unit tests against it" as achievements. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Herein lies the real problem though. Getting the *fun* achievements is easy. They're tangible and simple to measure. How do you measure "good code"? Can you scan code with a computer&amp;nbsp;and determine separation of concern? Or if your code follows &lt;A href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod" mce_href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"&gt;SOLID principles&lt;/A&gt; or not? Somethings are&amp;nbsp;detectable&amp;nbsp;but most of the good stuff is not.&amp;nbsp;That's the real trick here (and if you figure it out in a system where you can automatically detect it and award and achievment for, all the better).&lt;/P&gt;
&lt;P mce_keep="true"&gt;Like I said, have fun with this addon. It's neat and I applaud the developers for coming up with it. I don't discourage its use&amp;nbsp;but keep in mind what it is and what the message behind it is. Hopefully one day with might have some positive achievements to strive for as well as the fun ones.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=8262427" width="1" height="1"&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/pUiMWt09OTvm-ERO35siWb5kp9I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pUiMWt09OTvm-ERO35siWb5kp9I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/pUiMWt09OTvm-ERO35siWb5kp9I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/pUiMWt09OTvm-ERO35siWb5kp9I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:7Q72WNTAKBA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=7Q72WNTAKBA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=9U9csuOBZlY:AppF4-Yh-TU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:YwkR-u9nhCs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=YwkR-u9nhCs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=9U9csuOBZlY:AppF4-Yh-TU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?i=9U9csuOBZlY:AppF4-Yh-TU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bsimser?a=9U9csuOBZlY:AppF4-Yh-TU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bsimser?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;</description><category domain="http://weblogs.asp.net/bsimser/archive/tags/General+Software+Development/default.aspx">General Software Development</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Community+News/default.aspx">Community News</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/.NET/default.aspx">.NET</category><category domain="http://weblogs.asp.net/bsimser/archive/tags/Visual+Studio/default.aspx">Visual Studio</category><feedburner:origLink>http://weblogs.asp.net/bsimser/archive/2012/01/18/visual-studio-achievements-they-re-just-for-fun.aspx</feedburner:origLink></item></channel></rss>

