<?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:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Mikael Koskinen</title>
    <description> .NET Programming and Software Architecture</description>
    <link>http://mikaelkoskinen.net/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.5.0.6</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://mikaelkoskinen.net/opml.axd</blogChannel:blogRoll>
    <dc:creator>Mikael Koskinen</dc:creator>
    <dc:title>Mikael Koskinen</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/mikaelkoskinen" /><feedburner:info uri="mikaelkoskinen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Async CTP–Fixing the Installation Problem</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;I wasn’t aware that the &lt;a href="http://msdn.microsoft.com/en-us/vstudio/gg316360"&gt;Async CTP&lt;/a&gt; worked with Windows Phone 7 until I read &lt;a href="http://blogs.msdn.com/b/kevinash/archive/2012/02/21/async-ctp-task-based-asynchronous-programming-for-windows-phone.aspx"&gt;this good introduction by Kevin Ashley.&lt;/a&gt;It’s not just the await and async –keywords which got me excited, it’s the thought of using TPL with WP7. &lt;/p&gt;  &lt;p&gt;Unfortunately getting the CTP 3 to install wasn’t an easy task. First time everything seemed to go alright, except I couldn’t find the samples or DLLs from anywhere. &lt;a href="http://blogs.msdn.com/b/lucian/archive/2011/11/01/async-ctp-v3-installation.aspx"&gt;Turns out&lt;/a&gt; this is a &lt;a href="http://social.msdn.microsoft.com/Forums/pl/async/thread/de9c9811-ee61-4fa1-9ee4-e3df6ac756ff"&gt;common&lt;/a&gt; &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/async/thread/8faf9f46-8ecd-4750-9b9e-9579d784d383"&gt;problem&lt;/a&gt; and it is caused by the Silverlight 5 and some Visual Studio Hotfixes.&amp;#160; &lt;/p&gt;  &lt;p&gt;Here are the steps I had to take in order to get the Async CTP installed:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Removed Silverlight 5 SDK through Programs and Features&lt;/li&gt;    &lt;li&gt;Removed the following updates through Programs and Features / Installed Updates:&lt;/li&gt;    &lt;ol&gt;     &lt;li&gt;KB2615527&lt;/li&gt;      &lt;li&gt;KB2635973&lt;/li&gt;      &lt;li&gt;KB2549864&lt;/li&gt;   &lt;/ol&gt; &lt;/ol&gt;  &lt;p&gt;All of these can be reinstalled after Async CTP has been installed.&lt;/p&gt;  &lt;p&gt;After going through the steps described above, Async with WP7 is a go:&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:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0247b0ac-42bf-4d2b-8681-a8ca75cfbf98" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;        private async void ButtonClick(object sender, RoutedEventArgs e)
        {
            Debug.WriteLine(await GetWebpage());
        }

        private async Task&amp;lt;string&amp;gt; GetWebpage()
        {
            return await new WebClient().DownloadStringTaskAsync(new Uri("http://www.bing.com"));
        }&lt;/pre&gt;&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/a4TtribtiuE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/a4TtribtiuE/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/async-ctp-fix-installation-problem.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=2e94724e-5440-43b7-9ff8-c85b2fc02b1d</guid>
      <pubDate>Wed, 22 Feb 2012 19:42:47 +0200</pubDate>
      <category>wp7</category>
      <category>visual studio</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=2e94724e-5440-43b7-9ff8-c85b2fc02b1d</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=2e94724e-5440-43b7-9ff8-c85b2fc02b1d</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/async-ctp-fix-installation-problem.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=2e94724e-5440-43b7-9ff8-c85b2fc02b1d</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=2e94724e-5440-43b7-9ff8-c85b2fc02b1d</feedburner:origLink></item>
    <item>
      <title>Windows Phone 7 Sockets: Debugging</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h6&gt;Advert: IRC7 is the premium IRC-client for Windows Phone 7, supporting features like SSL, SASL, multiple server connections and scripting. Learn more at &lt;a href="http://irc7.org/"&gt;irc7.org.&lt;/a&gt;&lt;/h6&gt;
&lt;p&gt;This is the part IV of a &lt;a href="http://mikaelkoskinen.net/post/windows-phone-sockets-building-irc-client.aspx" target="_blank"&gt;tutorial series&lt;/a&gt; which will describe the WP7&amp;rsquo;s sockets-support from a developer&amp;rsquo;s perspective. This tutorial series will focus on developing WP7 applications which require a long running TCP-connection that sends and receives text-based data. In these posts we will go through of building a complete IRC-client.&lt;/p&gt;
&lt;p&gt;The focus of these posts is in the WP7&amp;rsquo;s developer&amp;rsquo;s perspective. If you want to better understand the inner details of the Internet sockets, &lt;a href="http://en.wikipedia.org/wiki/Internet_socket"&gt;Wikipedia&lt;/a&gt; has a good introduction on the subject.&lt;/p&gt;
&lt;p&gt;This part of the series will focus on debugging sockets. In the next part we&amp;rsquo;re going to finish this tutorial series by adding SSL socket connections into our app.&lt;/p&gt;
&lt;h4&gt;Background&lt;/h4&gt;
&lt;p&gt;The basis of our client is &lt;a href="http://mikaelkoskinen.net/post/windows-phone-sockets-building-irc-client.aspx" target="_blank"&gt;ready&lt;/a&gt;. It can &lt;a href="http://mikaelkoskinen.net/post/wp7-sockets-tutorial-opening-connection.aspx" target="_blank"&gt;open a connection&lt;/a&gt;, &lt;a href="http://mikaelkoskinen.net/post/wp7-sockets-tutorial-receiving-message.aspx" target="_blank"&gt;receive a message&lt;/a&gt; and &lt;a href="http://mikaelkoskinen.net/post/wp7-sockets-tutorial-sending-messages.aspx" target="_blank"&gt;send a message&lt;/a&gt;. But it&amp;rsquo;s not very feature rich. When you start adding features, it&amp;rsquo;s likely that at some point you have to debug incoming or outgoing messages.&lt;/p&gt;
&lt;h4&gt;The basic way: Debug.WriteLine&lt;/h4&gt;
&lt;p&gt;The most basic way of debugging sockets is to use Debug.WriteLine to log every incoming and outgoing message before any processing is done on the message. When this kind of a debugging mechanism is added, we have a starting point for understanding what&amp;rsquo;s moving between the client and the server.&lt;/p&gt;
&lt;p&gt;Debug.WriteLine will log the messages into the Visual Studio&amp;rsquo;s Output-window:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_42.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_42.png" alt="image" width="325" height="78" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;But this window doesn&amp;rsquo;t show everything. Let&amp;rsquo;s modify our debugging so that it also trims the received message and prints out the character count:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ffb013a3-6016-4dd9-9470-42c4beeb4a3b" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            Debug.WriteLine("Char count: {0} - Message: {1}", ircMessage.Length, ircMessage.Trim());
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now compare these two lines which we may receive from the server:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_43.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_43.png" alt="image" width="505" height="52" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The messages look like identical, but the character count tells an another story. The reason for this is that the first message contains a special character which the Visual Studio&amp;rsquo;s output window can&amp;rsquo;t display. The situation changes when the lines are copy-pasted into the Notepad++:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_44.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_44.png" alt="image" width="599" height="49" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Even though Notepad++ can&amp;rsquo;t render the message correctly, we can see what is different: There&amp;rsquo;s a special character just before the &amp;lsquo;0&amp;rsquo;. In case you wonder where this character origins from, it&amp;rsquo;s a color coded message sent using &lt;a href="http://www.mirc.com/"&gt;mIRC&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Debug.WriteLine allows you to get started rapidly but remember: Your output window may be hiding things from you.&lt;/p&gt;
&lt;h4&gt;Wireshark&lt;/h4&gt;
&lt;p&gt;In case Debug.WriteLine is too limited for your scenario, WireShark probably isn&amp;rsquo;t. &lt;a href="http://www.wireshark.org/" target="_blank"&gt;WireShark&lt;/a&gt; allows you to &amp;ldquo;go deep&amp;rdquo;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software and communications protocol development, and education.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;With WireShark we can capture every packet which is sent between our app and the server. When you download, install and run it, you&amp;rsquo;re first greeted with a dashboard, which lists all your network adapters:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_45.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_45.png" alt="image" width="424" height="272" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This computer has only one real network interface called &amp;ldquo;Atheros L1C PCI-E Ethernet Controller&amp;rdquo;. The situation differs between various computers but usually there should be only one, maybe two interfaces. When you select the correct one, WireShark automatically starts following the packages and showing this info to you, in real time.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_46.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_46.png" alt="image" width="435" height="94" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;WireShark is an excellent tool, but in our case it has one problem: It shows too much data. There&amp;rsquo;s just too many packets moving around and without filtering it it&amp;rsquo;s just not possible to find the related bits and pieces. But fortunately WireShark contains good tools for getting rid of the irrelevant data.&lt;/p&gt;
&lt;p&gt;We want to monitor only the packages which are sent between our IRC-client and the server. So, let&amp;rsquo;s start by selecting Capture &amp;ndash; Stop from the menu:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_47.png"&gt;&lt;img style="background-image: none; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_47.png" alt="image" width="244" height="133" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Then, let&amp;rsquo;s add a filter which removes everything except the packages which are from or to our IRC-server. In this case our server&amp;rsquo;s IP-address is 195.197.52.90. Here&amp;rsquo;s a filter which removes everything else:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:2a1a4d61-71f5-4d2b-8170-c6f353cba2e5" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: text;"&gt;ip.src eq 195.197.52.90 or ip.dst eq 195.197.52.90&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This filter can be added to the top-left part of WireShark:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_48.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_48.png" alt="image" width="315" height="88" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now, start capturing the data by selecting Capture &amp;ndash; Start. WireShark offers you the option to save the last capture as a file but we can continue without saving. Then, run your app and try to connect to the server. WireShark shows the packages moving between the client and the server and this time there isn&amp;rsquo;t that much data.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_49.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_49.png" alt="image" width="417" height="78" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Try double clicking one of the lines with protocol &amp;ldquo;IRC&amp;rdquo; and you&amp;rsquo;ll see the exact message:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_50.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_50.png" alt="image" width="366" height="167" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The listing is now quite good but still, we can make it even better. As you notice, there&amp;rsquo;s few items in the list with protocol TCP and if you look at the details of these messages, you&amp;rsquo;ll notice that they don&amp;rsquo;t contain any meaningful data for us. We can filter those out too:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:845a15a6-c0a4-4d58-8566-4cb06d123ba5" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: text;"&gt;(ip.src eq 195.197.52.90 or ip.dst eq 195.197.52.90) and irc&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now we have a filter which shows only the messages between our client and the server and in addition to that, it shows only the messages related to the IRC-protocol.&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;In this post we went through of couple different ways of debugging socket connections. Debug.WriteLine gets you started rapidly but remember, some character may not be visible. WireShark is the other option. It&amp;rsquo;s much more harder to use but also much more advanced.&lt;/p&gt;
&lt;p&gt;Next up: Using SSL with Windows Phone sockets.&lt;/p&gt;
&lt;h4&gt;Source code&lt;/h4&gt;
&lt;p&gt;The whole source code for this tutorial is available from the &lt;a href="https://github.com/mikoskinen/blog/tree/master/wp7-sockets-part-iv"&gt;GitHub.&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Links&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.wireshark.org/" target="_blank"&gt;WireShark&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.wireshark.org/DisplayFilters" target="_blank"&gt;WireShark filters&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/kjF4k4Y0cKU" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/kjF4k4Y0cKU/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/wp7-sockets-tutorial-debugging.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=3cce3964-0c44-4fdb-b07a-f2b045df611a</guid>
      <pubDate>Sun, 19 Feb 2012 12:49:00 +0200</pubDate>
      <category>mango</category>
      <category>wp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=3cce3964-0c44-4fdb-b07a-f2b045df611a</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=3cce3964-0c44-4fdb-b07a-f2b045df611a</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/wp7-sockets-tutorial-debugging.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=3cce3964-0c44-4fdb-b07a-f2b045df611a</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=3cce3964-0c44-4fdb-b07a-f2b045df611a</feedburner:origLink></item>
    <item>
      <title>Unity: Passing Constructor Parameters to Resolve</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;In this tutorial we will go through of couple different ways of using custom constructor parameters when resolving an instance with Unity:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;By using the built-in ParameterOverride&lt;/li&gt;
&lt;li&gt;By creating a custom ResolverOverride.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Background&lt;/h2&gt;
&lt;p&gt;When you&amp;rsquo;re using a DI-container like &lt;a href="http://unity.codeplex.com/" target="_blank"&gt;Unity&lt;/a&gt;, you normally don&amp;rsquo;t have to worry about how the container resolves the new instance. You have configured the container and the container will act based on your configuration. But there may be cases where you have pass in custom constructor parameters for the resolve operation. Some may argue that this screams of bad architecture but there&amp;rsquo;s situations like bringing a DI-container to a legacy system which may require these kind of actions.&lt;/p&gt;
&lt;h2&gt;Resolved class&lt;/h2&gt;
&lt;p&gt;In this tutorial we are resolving the following test class:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c8e746f2-ccf5-4fa4-a65f-e5d52bb3117e" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;    public class MyClass
    {
        public string Hello { get; set; }
        public int Number { get; set; }

        public MyClass(string hello, int number)
        {
            Hello = hello;
            Number = number;
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;It is registered to the container using RegisterType-method and without passing in any parameters:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:dadfc7fa-dde5-45b3-9811-605352c6be0c" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            var unity = new UnityContainer();
            unity.RegisterType&amp;lt;MyClass&amp;gt;();&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;So let&amp;rsquo;s see how we can pass in the &amp;ldquo;hello&amp;rdquo; and &amp;ldquo;number&amp;rdquo; variables for the MyClass&amp;rsquo; constructor when calling Unity&amp;rsquo;s Resolve.&lt;/p&gt;
&lt;h2&gt;Unity ResolverOverride&lt;/h2&gt;
&lt;p&gt;Unity allows us to pass in a &amp;ldquo;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.resolveroverride(v=pandp.20).aspx" target="_blank"&gt;ResolverOverride&lt;/a&gt;&amp;rdquo; when the container&amp;rsquo;s &lt;a href="http://msdn.microsoft.com/en-us/library/ff661519(v=pandp.20).aspx" target="_blank"&gt;Resolve&lt;/a&gt;-method is called. ResolverOverride is an abstract base class and Unity comes with few of these built-in. One of them is &lt;a href="http://msdn.microsoft.com/en-us/library/ff661820(v=pandp.20).aspx" target="_blank"&gt;ParameterOverride&lt;/a&gt; which &lt;em&gt;&amp;ldquo;lets you override a named parameter passed to a constructor.&amp;rdquo;&lt;/em&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So knowing that we need to pass in a string named &amp;ldquo;hello&amp;rdquo; and an integer called &amp;ldquo;number&amp;rdquo;, we can resolve the instance with the help of ParameterOverride:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:fe476b2f-aeb3-4d78-8a44-23182e8be755" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: vb;"&gt;        [Test]
        public void Test()
        {
            var unity = new UnityContainer();
            unity.RegisterType&amp;lt;MyClass&amp;gt;();

            var myObj = unity.Resolve&amp;lt;MyClass&amp;gt;(new ResolverOverride[]
                                           {
                                               new ParameterOverride("hello", "hi there"), new ParameterOverride("number", 21)
                                           });

            Assert.That(myObj.Hello, Is.EqualTo("hi there"));
            Assert.That(myObj.Number, Is.EqualTo(21));
        }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We pass in two instances of ParameterOverride. Both of these take in the name and the value of the parameter.&lt;/p&gt;
&lt;h2&gt;Custom ResolverOverride: OrderedParametersOverride&lt;/h2&gt;
&lt;p&gt;But what if you don&amp;rsquo;t like passing in the parameter names and instead you want to pass in just the parameter values, in correct order? In order to achieve this we can create a custom ResolverOverride. Here&amp;rsquo;s one way to do it:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0f5b9b86-220a-4ed0-864c-e64c61541a98" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;    public class OrderedParametersOverride : ResolverOverride
    {
        private readonly Queue&amp;lt;InjectionParameterValue&amp;gt; parameterValues;

        public OrderedParametersOverride(IEnumerable&amp;lt;object&amp;gt; parameterValues)
        {
            this.parameterValues = new Queue&amp;lt;InjectionParameterValue&amp;gt;();
            foreach (var parameterValue in parameterValues)
            {
                this.parameterValues.Enqueue(InjectionParameterValue.ToParameter(parameterValue));
            }
        }

        public override IDependencyResolverPolicy GetResolver(IBuilderContext context, Type dependencyType)
        {
            if (parameterValues.Count &amp;lt; 1)
                return null;

            var value = this.parameterValues.Dequeue();
            return value.GetResolverPolicy(dependencyType);
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The parameter values are passed&amp;nbsp; in through the constructor and put into a queue. When the container is resolving an instance, the parameters are used in the order which they were given to the OrderedParametersOverride.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s a sample usage of the new OrderedParametersOverride:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:53834a01-38f1-474c-a317-65c58c704dc7" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;        [Test]
        public void TestOrderedParametersOverride()
        {
            var unity = new UnityContainer();
            unity.RegisterType&amp;lt;MyClass&amp;gt;();

            var myObj = unity.Resolve&amp;lt;MyClass&amp;gt;(new OrderedParametersOverride(new object[] {"greetings", 24 }));

            Assert.That(myObj.Hello, Is.EqualTo("greetings"));
            Assert.That(myObj.Number, Is.EqualTo(24));
        }&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Sample code&lt;/h2&gt;
&lt;p&gt;The above examples can be found from &lt;a href="https://github.com/mikoskinen/blog" target="_blank"&gt;GitHub.&lt;/a&gt;&lt;/p&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/nTwYiBanU24" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/nTwYiBanU24/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/unity-pass-constructor-parameters-to-resolve.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=a367d1d1-2c61-4b47-a288-b33787d38647</guid>
      <pubDate>Sat, 11 Feb 2012 18:55:00 +0200</pubDate>
      <category>c#</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=a367d1d1-2c61-4b47-a288-b33787d38647</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=a367d1d1-2c61-4b47-a288-b33787d38647</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/unity-pass-constructor-parameters-to-resolve.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=a367d1d1-2c61-4b47-a288-b33787d38647</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=a367d1d1-2c61-4b47-a288-b33787d38647</feedburner:origLink></item>
    <item>
      <title>Graze and GrazeWP7 available from the NuGet</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Both &lt;a href="http://mikaelkoskinen.net/post/Graze-Static-site-generator-using-Razor.aspx" target="_blank"&gt;Graze&lt;/a&gt; and &lt;a href="http://mikaelkoskinen.net/post/WP7Graze-Creating-WP7-App-Marketing-Web-Site-using-Graze-and-Twitter-Bootstrapper.aspx" target="_blank"&gt;GrazeWP7&lt;/a&gt; are now available through NuGet. To get started, first create a new “Empty Project” with Visual Studio and then add the Graze or GrazeWP7 using NuGet. Graze.exe and the template-folder are installed into the root of your project. Installing GrazeWP7 will automatically install Graze.&lt;/p&gt;  &lt;h2&gt;Project sites:&lt;/h2&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="https://github.com/mikoskinen/graze/" target="_blank"&gt;Graze&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="https://github.com/mikoskinen/grazewp7/" target="_blank"&gt;GrazeWP7&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/nNK9j8DRp3Q" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/nNK9j8DRp3Q/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/graze-grazewp7-nuget.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=9e0b8f15-6057-4966-8c06-33803c8d9037</guid>
      <pubDate>Sun, 05 Feb 2012 20:51:31 +0200</pubDate>
      <category>graze</category>
      <category>grazewp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=9e0b8f15-6057-4966-8c06-33803c8d9037</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=9e0b8f15-6057-4966-8c06-33803c8d9037</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/graze-grazewp7-nuget.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=9e0b8f15-6057-4966-8c06-33803c8d9037</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=9e0b8f15-6057-4966-8c06-33803c8d9037</feedburner:origLink></item>
    <item>
      <title>WP7Graze: Creating WP7 App Marketing Web Site using Graze and Twitter Bootstrap</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=screenshot_small_1.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;" title="screenshot_small" src="http://mikaelkoskinen.net/image.axd?picture=screenshot_small_thumb_1.png" alt="screenshot_small" width="244" height="174" align="right" border="0" /&gt;&lt;/a&gt;&lt;strong&gt;&lt;a href="https://github.com/mikoskinen/grazewp7/" target="_blank"&gt;GrazeWP7&lt;/a&gt;&lt;/strong&gt; is a Windows Phone 7 app marketing site generator. It uses the &lt;a href="https://github.com/mikoskinen/graze" target="_blank"&gt;Graze templating engine&lt;/a&gt; with &lt;a href="https://github.com/twitter/bootstrap/" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt; to create static web sites.&lt;/p&gt;
&lt;p&gt;GrazeWP7 uses a simple configuration file to generate a static web site for your application. The generated sited is pure HTML / CSS / JavaScript and can be hosted on any web server.&lt;/p&gt;
&lt;h2&gt;More details&lt;/h2&gt;
&lt;p&gt;More details about WP7Graze, including the quick start, are available from the &lt;a href="https://github.com/mikoskinen/grazewp7/" target="_blank"&gt;project&amp;rsquo;s home&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Inspiration&lt;/h2&gt;
&lt;p&gt;The GrazeWP7 was inspired from the following projects:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://wp7appsite.codeplex.com/" target="_blank"&gt;Windows Phone App Site template&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aeoth/Wp7JekyllTemplates" target="_blank"&gt;WP7 Jekyll app site templates&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;It uses Windows Phone image assets from those projects.&lt;/p&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/L_xVo0Nt1qI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/L_xVo0Nt1qI/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/WP7Graze-Creating-WP7-App-Marketing-Web-Site-using-Graze-and-Twitter-Bootstrapper.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=b5338e42-82f9-49cb-b736-f1d0e092cc47</guid>
      <pubDate>Sat, 04 Feb 2012 20:52:00 +0200</pubDate>
      <category>graze</category>
      <category>grazewp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=b5338e42-82f9-49cb-b736-f1d0e092cc47</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=b5338e42-82f9-49cb-b736-f1d0e092cc47</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/WP7Graze-Creating-WP7-App-Marketing-Web-Site-using-Graze-and-Twitter-Bootstrapper.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=b5338e42-82f9-49cb-b736-f1d0e092cc47</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=b5338e42-82f9-49cb-b736-f1d0e092cc47</feedburner:origLink></item>
    <item>
      <title>Graze: Static site generator using Razor</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="https://github.com/mikoskinen/graze" target="_blank"&gt;&lt;strong&gt;Graze&lt;/strong&gt; &lt;/a&gt;is a simple static site generator. It takes a template and a configuration file and generates a static web site. The generated sited is pure HTML / CSS / JavaScript and can be hosted on any web server. The Graze templates are created using the &lt;a href="http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx" target="_blank"&gt;Razor Syntax.&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Getting started&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Download and extract the &lt;a href="https://github.com/downloads/mikoskinen/graze/graze_1_0.zip" target="_blank"&gt;Graze.&lt;/a&gt; It comes with an example.&lt;/li&gt;
&lt;li&gt;Run graze.exe.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The static site (index.html) is generated into the &amp;ldquo;output&amp;rdquo; folder.&lt;/p&gt;
&lt;h3&gt;Graze templates&lt;/h3&gt;
&lt;p&gt;The Graze templates are created using the Razor.&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0f6e32c9-78f4-4a67-9b65-b0c17ff98bff" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: html;"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;@Model.Title&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;h1&amp;gt;@Model.Description&amp;lt;/h1&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h3&gt;Graze configuration&lt;/h3&gt;
&lt;p&gt;The configuration for Graze is done in XML.&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:62bc2ff8-a151-4dd5-8d10-9caeb3ddfcd9" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;
&amp;lt;site&amp;gt;
  &amp;lt;Title&amp;gt;Graze&amp;lt;/Title&amp;gt;
  &amp;lt;Description&amp;gt;Graze: Static site generator using Razor&amp;lt;/Description&amp;gt;
&amp;lt;/site&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The configuration file represents the data which is injected to the generated static site.&lt;/p&gt;
&lt;h3&gt;Generating the static site&lt;/h3&gt;
&lt;p&gt;Once the Graze template and the configuration file are in place, the static site can be generated running the graze.exe. The static site is outputted to the output-folder.&lt;/p&gt;
&lt;h2&gt;Examples&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/mikoskinen/grazewp7/"&gt;The GrazeWP7&lt;/a&gt; uses Graze to generate marketing sites for Windows Phone 7 applications.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=screenshot_small_2.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="screenshot_small" src="http://mikaelkoskinen.net/image.axd?picture=screenshot_small_thumb_2.png" alt="screenshot_small" width="585" height="416" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Features&lt;/h2&gt;
&lt;h3&gt;Lists&lt;/h3&gt;
&lt;p&gt;Lists can be created in XML and accessed in the Graze template. Example XML:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:e954e87f-57f8-47d9-bd58-724faba684ee" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;  &amp;lt;Features&amp;gt;
    &amp;lt;Feature&amp;gt;Layouts defined using Razor syntax.&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature&amp;gt;Dynamic data models created in XML.&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature&amp;gt;Supports complex data models and arrays.&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature&amp;gt;Fast static site generation.&amp;lt;/Feature&amp;gt;
    &amp;lt;Feature&amp;gt;Pure HTML / CSS / Javascript output. Host in Apache, IIS etc.&amp;lt;/Feature&amp;gt;
  &amp;lt;/Features&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Example template for accessing the list:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:2050d17c-88d9-46e3-8d5a-5dc173d56dea" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: html;"&gt;    &amp;lt;h2&amp;gt;Features:&amp;lt;/h2&amp;gt;
    &amp;lt;ul&amp;gt;
        @foreach (var feature in Model.Features)
        {
            &amp;lt;li&amp;gt;@feature&amp;lt;/li&amp;gt;
        }
    &amp;lt;/ul&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h3&gt;Complex types&lt;/h3&gt;
&lt;p&gt;By default all the data in the XML is of type string when accessed from the template. But complex types can be created also:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ae8aae5e-23b4-4c21-9170-9035feac29bd" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;Link Url="https://github.com/mikoskinen/graze"&amp;gt;Source code hosted in GitHub&amp;lt;/Link&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:31564077-b9a2-4279-be97-212eb13485b4" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: html;"&gt;&amp;lt;a href="@Model.Link.Url"&amp;gt;@Model.Link.Link&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;h3&gt;Case sensitive&lt;/h3&gt;
&lt;p&gt;The configuration is case sensitive.&lt;/p&gt;
&lt;h3&gt;Folder structure&lt;/h3&gt;
&lt;p&gt;Graze expects the following folder structure:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:e2be954e-7903-417b-ae46-ff23a9939dc0" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: text;"&gt;graze.exe
--template/
----configuration.xml
----index.cshtml
----assets&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The assets folder is copied wholly to the output folder. The assets folder can include the CSS / JSS / image files required by the template.&lt;/p&gt;
&lt;h2&gt;License&lt;/h2&gt;
&lt;p&gt;Graze is available with the MIT-license. It uses the &lt;a href="http://razorengine.codeplex.com/" target="_blank"&gt;RazorEngine&lt;/a&gt; to generate the output.&lt;/p&gt;
&lt;h2&gt;Source code&lt;/h2&gt;
&lt;p&gt;Graze is hosted at &lt;a href="https://github.com/mikoskinen/graze" target="_blank"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/vc-nmYSnX7w" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/vc-nmYSnX7w/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/Graze-Static-site-generator-using-Razor.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=d7727d46-95d6-4b24-8d4c-38add8a21daa</guid>
      <pubDate>Sat, 04 Feb 2012 18:23:00 +0200</pubDate>
      <category>graze</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=d7727d46-95d6-4b24-8d4c-38add8a21daa</pingback:target>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=d7727d46-95d6-4b24-8d4c-38add8a21daa</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/Graze-Static-site-generator-using-Razor.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=d7727d46-95d6-4b24-8d4c-38add8a21daa</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=d7727d46-95d6-4b24-8d4c-38add8a21daa</feedburner:origLink></item>
    <item>
      <title>WP7: Display Different Data Template for Different Items in the List - DataTemplateSelectors with the help of Caliburn.Micro</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_35.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border-width: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_35.png" alt="image" width="206" height="341" align="right" border="0" /&gt;&lt;/a&gt;In this Windows Phone 7 tutorial you will learn how to take advantage of Caliburn.Micro when displaying a list of non-identical objects to the user.&lt;/p&gt;
&lt;h4&gt;Background&lt;/h4&gt;
&lt;p&gt;Displaying a ListBox for a list which contains different kinds of items is a common scenario when developing applications for Windows Phone. For example your list can present a folder which contains files and subfolders. When presenting this list to the user you usually want the files and folders to look different. There&amp;rsquo;s many ways to make this happen, like ValueConverters and the following &lt;a href="http://windowsphonegeek.com/articles/Implementing-Windows-Phone-7-DataTemplateSelector-and-CustomDataTemplateSelector" target="_blank"&gt;implementation using abstract DataTemplateSelector&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;But if you&amp;rsquo;re using the &lt;a href="http://caliburnmicro.codeplex.com/" target="_blank"&gt;Caliburn.Micro&lt;/a&gt;framrwork, you&amp;rsquo;re all set. The functionalities inside the framework will take care of this automatically for you.&lt;/p&gt;
&lt;h4&gt;Scenario&lt;/h4&gt;
&lt;p&gt;You want to present a folder structure to the end user. You have one bindable list which contains both the subfolders and files and you have one ListBox inside the XAML which shows both types of items. The File.cs and Folder.cs files contain our &lt;strong&gt;models&lt;/strong&gt;:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a5ff71d2-2d43-47e8-88ec-9ec578b61d29" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;collapse:true;"&gt;    public class File
    {
        public int Id { get; private set; }
        public string Name { get; private set; }
        public double Size { get; private set; }

        public File(int id, string name, double size)
        {
            Id = id;
            Name = name;
            Size = size;
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:117bbc84-91d0-4416-94dc-6a3eb36c88e2" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;collapse:true;"&gt;    public class Folder
    {
        public int Id { get; private set; }
        public string Name { get; private set; }
        public List&amp;lt;Folder&amp;gt; SubFolders { get; private set; }

        public Folder(int id, string name, List&amp;lt;Folder&amp;gt; subFolders)
        {
            Id = id;
            Name = name;
            SubFolders = subFolders;
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;In the ListBox you want to display the item&amp;rsquo;s name and a little icon next to it to indicate the item&amp;rsquo;s type.&lt;/p&gt;
&lt;h4&gt;Implementation &amp;ndash; The ViewModel&lt;/h4&gt;
&lt;p&gt;What we&amp;rsquo;re going to need is just one &lt;strong&gt;ViewModel&lt;/strong&gt;. We&amp;rsquo;re not going to create ViewModels for our models:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MainPageViewModel &amp;ndash; The main VM which contains the list which is shown to the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The MainPageViewModel inherit&amp;rsquo;s the Caliburn.Micro&amp;rsquo;s &lt;a href="http://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition" target="_blank"&gt;Conductor&lt;/a&gt;-class. The Conductor provides our VM an observable list where we can add items. When the list is modified, our view automatically gets a notification and knows to update itself.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You could manually create a new ObservableCollection , but in our case we try to take the full advantage out of our framework of choice.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The list can be accessed through the &lt;strong&gt;Items-property&lt;/strong&gt;. So, to add a new item into our observable list, we can just call Items.Add(OurObject). As you&amp;rsquo;ll notice, we have defined the conductor as type of &lt;strong&gt;object&lt;/strong&gt;. This mean that the Items-property inside the conductor is of type BindableCollection&amp;lt;object&amp;gt;. Meaning, you can actually add any type of items inside the collection. You can use more precise type if you know what kind of items your list contains.&lt;/p&gt;
&lt;p&gt;The actual work the MainPageViewModel has to do is to create some fixed data for our application:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:68ca4551-5a38-4422-a86f-23794284587a" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;    public class MainPageViewModel : Conductor&amp;lt;object&amp;gt;.Collection.AllActive
    {
        protected override void OnInitialize()
        {
            Items.AddRange(new List&amp;lt;object&amp;gt;()
                               {
                                   new Folder(1, "Folder 1", null),
                                   new Folder(2, "Folder 2", null),
                                   new File(1, "File 1", 30.0),
                                   new File(2, "File 2", 30.0),
                                   new File(3, "File 3", 30.0),
                                   new Folder(4, "Folder 3", null),
                               });
        }
    }&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;We now have our ViewModel all set up so let&amp;rsquo;s concentrate on the Views next.&lt;/p&gt;
&lt;h4&gt;Implementation &amp;ndash; The Views&lt;/h4&gt;
&lt;p&gt;We need three different &lt;strong&gt;Views:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MainPage.xaml &amp;ndash; The page which contains our ListBox&lt;/li&gt;
&lt;li&gt;FolderView &amp;ndash; A UserControl which displays the Folder-item&lt;/li&gt;
&lt;li&gt;FileViewModel &amp;ndash; A UserControl which displays the File-item&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Our MainPage.xaml is simple, containing only the ListBox. We&amp;rsquo;ll name it &lt;strong&gt;&amp;ldquo;Items&amp;rdquo; &lt;/strong&gt;so that the Caliburn.Micro automatically binds it to our MainPageViewModel&amp;rsquo;s Items-property. What differs from the usual is our &lt;strong&gt;DataTemplate&lt;/strong&gt;. We&amp;rsquo;re making the Caliburn.Micro to find the correct UserControl to represent our item.&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d4e92bb9-3d78-46be-950d-9974c686024c" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            &amp;lt;ListBox x:Name="Items"&amp;gt;
                &amp;lt;ListBox.ItemTemplate&amp;gt;
                    &amp;lt;DataTemplate&amp;gt;
                        &amp;lt;ContentControl cal:View.Model="{Binding .}" HorizontalAlignment="Left" /&amp;gt;
                    &amp;lt;/DataTemplate&amp;gt;
                &amp;lt;/ListBox.ItemTemplate&amp;gt;
            &amp;lt;/ListBox&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Now that our MainPage is all set we can create the &lt;strong&gt;UserControls&lt;/strong&gt; which represent the items inside the folder. Here&amp;rsquo;s the implementation of FileView:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:b3ee131c-0534-41ae-ae60-3881d349f96f" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;    &amp;lt;Grid x:Name="LayoutRoot" Background="Transparent" Margin="12 0 0 0"&amp;gt;
        &amp;lt;Grid.ColumnDefinitions&amp;gt;
            &amp;lt;ColumnDefinition Width="auto"&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
        &amp;lt;/Grid.ColumnDefinitions&amp;gt;
        &amp;lt;Image Grid.Column="0" Source="/Icons/appbar.save.rest.png"/&amp;gt;
        &amp;lt;TextBlock Grid.Column="1" Text="{Binding Name}" VerticalAlignment="Center" Style="{StaticResource PhoneTextNormalStyle}"/&amp;gt;
    &amp;lt;/Grid&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;p&gt;And the FolderView looks similar, we&amp;rsquo;ll just change the Image. But notice, you could customize these views anyway you want, for example displaying the folder&amp;rsquo;s subfolders inline.&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:c076ec91-6785-45b9-9476-605c79f25161" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;    &amp;lt;Grid x:Name="LayoutRoot" Background="Transparent"&amp;gt;
        &amp;lt;Grid.ColumnDefinitions&amp;gt;
            &amp;lt;ColumnDefinition Width="auto"&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
            &amp;lt;ColumnDefinition&amp;gt;&amp;lt;/ColumnDefinition&amp;gt;
        &amp;lt;/Grid.ColumnDefinitions&amp;gt;
        &amp;lt;Image Grid.Column="0" Source="/Icons/appbar.folder.rest.png"/&amp;gt;
        &amp;lt;TextBlock Grid.Column="1" Text="{Binding Name}" VerticalAlignment="Center" Style="{StaticResource PhoneTextTitle3Style}"/&amp;gt;
    &amp;lt;/Grid&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_36.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; float: right; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_36.png" alt="image" width="148" height="244" align="right" border="0" /&gt;&lt;/a&gt;If we now run the application we will see that everything is almost set, except that the Caliburn.Micro can&amp;rsquo;t find the correct views for the File and Folder-classes. Let&amp;rsquo;s take care of that next.&lt;/p&gt;
&lt;h4&gt;Matching the ViewModel and Models to Views&lt;/h4&gt;
&lt;p&gt;As you remember, we didn&amp;rsquo;t create ViewModel-classes for the models. Instead we&amp;rsquo;ll tell Caliburn.Micro how to match the File and Folder &amp;ndash;models to their views.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Caliburn.Micro uses conventions to match Views and ViewModels. The most common convention for finding a View for a ViewModel is to just drop the Model from the type name, for example CustomerViewModel &amp;ndash;&amp;gt; CustomerView. The framework is highly configurable and you can add your own conventions.&amp;nbsp;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;In order for the framework to find our views, we&amp;rsquo;ll add couple rules to its &lt;strong&gt;ViewLocator&lt;/strong&gt;. We configure the ViewLocator inside the application&amp;rsquo;s bootstrapper. We could have named our models FileViewModel and FolderViewModel and if we had done so, we wouldn&amp;rsquo;t need the following because the Caliburn.Micro could automatically find the views:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:e73569b8-919d-479b-9d95-a8bb43b266a0" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            ViewLocator.NameTransformer.AddRule("caliburn_micro_datatemplate_selector.File", "caliburn_micro_datatemplate_selector.FileView");
            ViewLocator.NameTransformer.AddRule("caliburn_micro_datatemplate_selector.Folder", "caliburn_micro_datatemplate_selector.FolderView");
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The code explains itself quite well. We just pass in the ViewModel-type&amp;rsquo;s full name and the matching View&amp;rsquo;s full name. To make the code refactoring easier we could use types &lt;strong&gt;instead&lt;/strong&gt; of the magic strings:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:55da62cd-4ace-4af3-8b97-7566a2b7b96f" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            ViewLocator.NameTransformer.AddRule(typeof(File).FullName, typeof(FileView).FullName);
            ViewLocator.NameTransformer.AddRule(typeof (Folder).FullName, typeof (FolderView).FullName);
&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;And that&amp;rsquo;s it. We now have an application which can handle the situation where one list contains multiple types of objects.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_37.png"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_37.png" alt="image" width="217" height="359" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Conclusion&lt;/h4&gt;
&lt;p&gt;Caliburn.Micro offers a powerful solution for those situations where your list contains multiple types of objects and you want to display them in a single ListBox.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/mikoskinen/blog/tree/master/caliburn-micro-datatemplate-selector" target="_blank"&gt;Full source code for the sample app is available from the GitHub.&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Links&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://caliburnmicro.codeplex.com/" target="_blank"&gt;Caliburn.Micro&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://caliburnmicro.codeplex.com/wikipage?title=Using%20the%20NameTransformer" target="_blank"&gt;Caliburn.Micro: Using the Name Transformer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition" target="_blank"&gt;Caliburn.Micro: Screen, Conductors and Composition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datatemplateselector.aspx" target="_blank"&gt;DataTemplateSelector&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://windowsphonegeek.com/articles/Implementing-Windows-Phone-7-DataTemplateSelector-and-CustomDataTemplateSelector" target="_blank"&gt;Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/gYUPxBDvgjw" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/gYUPxBDvgjw/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/windows-phone-datatemplateselector-with-caliburn-micro-change-listbox-datatemplate-based-on-item-type-in-list.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=dad94dca-a6de-4663-8d67-89ca6db3bbeb</guid>
      <pubDate>Fri, 20 Jan 2012 16:27:00 +0200</pubDate>
      <category>wp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=dad94dca-a6de-4663-8d67-89ca6db3bbeb</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=dad94dca-a6de-4663-8d67-89ca6db3bbeb</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/windows-phone-datatemplateselector-with-caliburn-micro-change-listbox-datatemplate-based-on-item-type-in-list.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=dad94dca-a6de-4663-8d67-89ca6db3bbeb</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=dad94dca-a6de-4663-8d67-89ca6db3bbeb</feedburner:origLink></item>
    <item>
      <title>Marketwatcher: WP7 Class Library and Sample Application for Fetching Application Reviews from the Marketplace</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_34.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://mikaelkoskinen.net/image.axd?picture=image_thumb_34.png" width="148" height="244" /&gt;&lt;/a&gt;I’ve just committed the first working version of Marketwatcher, a library for Windows Phone 7 which can be used to fetch application reviews from the Windows Phone Marketplace. It is available from the GitHub and it’s licensed with MIT, so you can use the library anyway you want.&lt;/p&gt;  &lt;p&gt;&lt;a href="https://github.com/mikoskinen/marketwatcher" target="_blank"&gt;Get the source code.&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="https://github.com/downloads/mikoskinen/marketwatcher/Marketwatcher_1_0.zip" target="_blank"&gt;Get the compiled binaries.&lt;/a&gt;&lt;/p&gt;  &lt;h2&gt;Sample application&lt;/h2&gt;  &lt;p&gt;&lt;a href="https://github.com/mikoskinen/marketwatcher" target="_blank"&gt;The Marketwatcher GitHub repository&lt;/a&gt; contains a sample app which can used to check out how the library is used. &lt;/p&gt;  &lt;h2&gt;Review data&lt;/h2&gt;  &lt;p&gt;At the moment an app review is described with the following model:&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:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ce1c1393-3593-4f9a-9d1c-027e2277b159" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;        public string Id { get; private set; }
        public string Author { get; private set; }
        public DateTime UpdateTime { get; private set; }
        public int Score { get; private set; }
        public string Comments { get; private set; }
        public string CountryCode { get; private set; }&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Implementation&lt;/h2&gt;

&lt;p&gt;Marketwatcher uses the Reactive Extensions. It may be that the RX is dropped at some point in favor of a implementation that doesn’t require any other DLLs. The library also references System.ServiceModel.Syndication which is used to parse the review data. The referenced dlls are included in the repository.&lt;/p&gt;

&lt;h2&gt;Usage&lt;/h2&gt;

&lt;h4&gt;Marketwatcher.Fetcher:&lt;/h4&gt;

&lt;p&gt;Use either:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;public IObservable&amp;lt;List&amp;lt;Review&amp;gt;&amp;gt; FetchReviewsForApp(string appId)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;public IObservable&amp;lt;List&amp;lt;Review&amp;gt;&amp;gt; FetchReviewsForAppFromOneMarketplace(string appId, string marketplaceCountryCode)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In the app you can subscribe to these. The following example is from the sample app:&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:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:48874d22-7c00-48b4-a578-6774720c4552" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;            var fetcher = new Fetcher();

            progressIndicator.IsVisible = true;

            var reviews = new ObservableCollection&amp;lt;Review&amp;gt;();
            Items.ItemsSource = reviews;

            fetcher.FetchReviewsForApp(this.Appid.Text)
                .ObserveOn(SynchronizationContext.Current)
                .Subscribe(x =&amp;gt;
                               {
                                   foreach (var review in x)
                                   {
                                       reviews.Add(review);
                                   }
                               },
                               ex =&amp;gt; Debug.WriteLine("error"),
                               () =&amp;gt; progressIndicator.IsVisible = false);&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;Nuget&lt;/h2&gt;

&lt;p&gt;The Nuget package is coming!&lt;/p&gt;

&lt;h2&gt;Download&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/mikoskinen/marketwatcher" target="_blank"&gt;GitHub repository.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/downloads/mikoskinen/marketwatcher/Marketwatcher_1_0.zip" target="_blank"&gt;Binaries.&lt;/a&gt;&lt;/p&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/1aiofidLUiY" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/1aiofidLUiY/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/Marketwatcher-WP7-Class-Library-and-Sample-Application-for-Fetching-Application-Reviews-from-the-Marketplace.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=8fc957d1-556b-4743-8acc-cc12bf22aa0e</guid>
      <pubDate>Thu, 19 Jan 2012 19:10:10 +0200</pubDate>
      <category>wp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=8fc957d1-556b-4743-8acc-cc12bf22aa0e</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=8fc957d1-556b-4743-8acc-cc12bf22aa0e</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/Marketwatcher-WP7-Class-Library-and-Sample-Application-for-Fetching-Application-Reviews-from-the-Marketplace.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=8fc957d1-556b-4743-8acc-cc12bf22aa0e</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=8fc957d1-556b-4743-8acc-cc12bf22aa0e</feedburner:origLink></item>
    <item>
      <title>WP7 Application’s Mango-upgrade: Remember to check TextBox InputScopes</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;We recently upgraded one of our Windows Phone 7 apps to Mango and things went quite smoothly using the Visual Studio’s built-in “Upgrade to Windows Phone 7.1” –functionality.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_30.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 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://mikaelkoskinen.net/image.axd?picture=image_thumb_30.png" width="244" height="184" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;But when we started testing the app, we noticed that some of our textboxes had a wrong input scope. In one case this made our app impossible to use with virtual keyboard because the textbox was missing the Enter-key.&lt;/p&gt;  &lt;p&gt;We had previously defined the textbox using the InputScope “Number”:&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:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:b1e93287-eb06-4585-894a-6c11201b9a14" class="wlWriterEditableSmartContent"&gt;&lt;pre class="brush: c#;"&gt;&amp;lt;TextBox InputScope="Number"/&amp;gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;And with out pre-Mango version this was the output:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_31.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 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://mikaelkoskinen.net/image.axd?picture=image_thumb_31.png" width="244" height="237" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But, after upgrading the app to Mango, the keyboard was completely different:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_32.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 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://mikaelkoskinen.net/image.axd?picture=image_thumb_32.png" width="244" height="241" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Enter-key was gone, rendering the app useless. We had to change the InputScope to “PostalCode” to get the required functionality back:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://mikaelkoskinen.net/image.axd?picture=image_33.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 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://mikaelkoskinen.net/image.axd?picture=image_thumb_33.png" width="244" height="231" /&gt;&lt;/a&gt;&lt;/p&gt;





&lt;p&gt;So, even if the Mango-upgrade goes smoothly, it’s a good idea to test all the textboxes before submitting your app. &lt;/p&gt;

&lt;h4&gt;Links&lt;/h4&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.input.inputscopenamevalue(v=VS.95).aspx" target="_blank"&gt;List of input scopes&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/ikiJD68ExLk" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/ikiJD68ExLk/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/wp7-mango-inputscope-app-upgrade.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=8bfe2467-32dd-4dfb-bca6-a6353b58bcc4</guid>
      <pubDate>Thu, 05 Jan 2012 10:19:39 +0200</pubDate>
      <category>wp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=8bfe2467-32dd-4dfb-bca6-a6353b58bcc4</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=8bfe2467-32dd-4dfb-bca6-a6353b58bcc4</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/wp7-mango-inputscope-app-upgrade.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=8bfe2467-32dd-4dfb-bca6-a6353b58bcc4</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=8bfe2467-32dd-4dfb-bca6-a6353b58bcc4</feedburner:origLink></item>
    <item>
      <title>Caliburn.Micro: RadTransitionControl custom convention</title>
      <description>&lt;div id="AdnTop"&gt;&lt;div class="AdnTopLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnTopRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;ve recently started using the &lt;a href="http://www.telerik.com/products/windows-phone.aspx" target="_blank"&gt;Telerik&amp;rsquo;s RadControls for Windows Phone.&lt;/a&gt; Here&amp;rsquo;s a convention for &lt;a href="http://caliburnmicro.codeplex.com/" target="_blank"&gt;Caliburn.Micro&lt;/a&gt; which allows the easier usage of RadTransitionControl:&lt;/p&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:3516b6fb-98cf-4dc3-aba4-e224e0f01b13" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;            ConventionManager.AddElementConvention&amp;lt;RadTransitionControl&amp;gt;(ContentControl.ContentProperty, "DataContext", "Loaded").GetBindableProperty =
        delegate(DependencyObject foundControl)
        {
            var element = (ContentControl)foundControl;

            var useViewModel = element.ContentTemplate == null;

            if (useViewModel)
            {
                return View.ModelProperty;
            }

            return ContentControl.ContentProperty;
        };&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;With this convention you can use the RadTransitionControl similar to ContentControl but with the difference that RadTransitionControl will show an effect (like fading) when the content changes. Here&amp;rsquo;s an example where the convention is used by Caliburn.Micro to automatically bind a control named Target to the ViewModel&amp;rsquo;s property:&lt;/p&gt;
&lt;h4&gt;XAML:&lt;/h4&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:df20ba5e-bbe9-4469-8cea-f20396835882" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: xml;"&gt;&amp;lt;telerikPrimitives:RadTransitionControl x:Name="Target" /&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;h4&gt;View model:&lt;/h4&gt;
&lt;div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a4013044-355b-423c-8649-f1e073f298ac" class="wlWriterEditableSmartContent" style="margin: 0px; display: inline; float: none; padding: 0px;"&gt;
&lt;pre class="brush: c#;"&gt;        public NewTargetBaseViewModel Target
        {
            get { return target; }
            set
            {
                target = value;
                NotifyOfPropertyChange(() =&amp;gt; Target);
            }
        }&lt;/pre&gt;
&lt;/div&gt;&lt;div id="AdnBottom"&gt;&lt;div class="AdnBottomLeft" style="float:left"&gt;&lt;/div&gt;&lt;div class="AdnBottomRight" style="float:right"&gt;&lt;/div&gt;&lt;div style="clear:both"&gt;&lt;/div&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/mikaelkoskinen/~4/5ditMERSv2s" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/mikaelkoskinen/~3/5ditMERSv2s/post.aspx</link>
      <comments>http://mikaelkoskinen.net/post/CaliburnMicro-RadTransitionControl-custom-convention.aspx#comment</comments>
      <guid isPermaLink="false">http://mikaelkoskinen.net/post.aspx?id=5070d0cf-27a0-4607-8df9-1c44b6ebbc51</guid>
      <pubDate>Sun, 25 Dec 2011 09:06:00 +0200</pubDate>
      <category>wp7</category>
      <dc:publisher>miksu</dc:publisher>
      <pingback:server>http://mikaelkoskinen.net/pingback.axd</pingback:server>
      <pingback:target>http://mikaelkoskinen.net/post.aspx?id=5070d0cf-27a0-4607-8df9-1c44b6ebbc51</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://mikaelkoskinen.net/trackback.axd?id=5070d0cf-27a0-4607-8df9-1c44b6ebbc51</trackback:ping>
      <wfw:comment>http://mikaelkoskinen.net/post/CaliburnMicro-RadTransitionControl-custom-convention.aspx#comment</wfw:comment>
      <wfw:commentRss>http://mikaelkoskinen.net/syndication.axd?post=5070d0cf-27a0-4607-8df9-1c44b6ebbc51</wfw:commentRss>
    <feedburner:origLink>http://mikaelkoskinen.net/post.aspx?id=5070d0cf-27a0-4607-8df9-1c44b6ebbc51</feedburner:origLink></item>
  </channel>
</rss>

