<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Geert van der Cruijsen</title>
	<atom:link href="http://vdcruijsen.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://vdcruijsen.net</link>
	<description>A blog about Windows Phone &#38; Windows 8 development</description>
	<lastBuildDate>Mon, 29 Apr 2013 14:34:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<meta xmlns="http://www.w3.org/1999/xhtml" name="robots" content="noindex,follow" />
		<item>
		<title>Launching Skype from your own Windows Store App</title>
		<link>http://vdcruijsen.net/2013/04/launching-skype-from-your-own-windows-store-app/</link>
		<comments>http://vdcruijsen.net/2013/04/launching-skype-from-your-own-windows-store-app/#comments</comments>
		<pubDate>Mon, 29 Apr 2013 14:34:23 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Skype]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=447</guid>
		<description><![CDATA[One of the strong features of Windows 8 is the integration of apps with the Windows 8 OS and also the ability for applications to integrate with other applications. A scenario that can be useful for many applications is to &#8230; <a href="http://vdcruijsen.net/2013/04/launching-skype-from-your-own-windows-store-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the strong features of Windows 8 is the integration of apps with the Windows 8 OS and also the ability for applications to integrate with other applications. A scenario that can be useful for many applications is to call someone directly using skype from within your application. By using Protocol extensions this is really easy on Windows 8. </p>
<p><img title="Skype_Logo" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Skype_Logo" src="http://vdcruijsen.net/wp-content/uploads/2013/04/Skype_Logo.png" width="240" height="106">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
<p>Unfortunately there is no documentation from Skype on this subject yet so that’s why I’m writing this blogpost to explain how you can launch Skype from your application. The code is actually really simple. Skype has registered several protocol extensions (can be found in the AppxManifest.xml file of the skype app) and the only thing you’ll have to know is what parameters to add to this protocol to launch a specific task. </p>
<p>What i did to see which protocol extensions Skype has i opened up the directory of the Skype Windows Store app (program files\WindowsApps) and looked for the AppxManifest.xml file. when you open the file look for Extensions element and in there should be the protocols that the application is bound to.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extensions</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="skype"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="tel"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="sms"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="message-skype-com"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="message-messenger"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="audiocall-messenger"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum21" style="color: #606060">  21:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="videocall-messenger"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum23" style="color: #606060">  23:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="audiocall-skype-com"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum25" style="color: #606060">  25:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum26" style="color: #606060">  26:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Extension</span> <span style="color: #ff0000">Category</span><span style="color: #0000ff">="windows.protocol"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum27" style="color: #606060">  27:</span>           <span style="color: #0000ff">&lt;</span><span style="color: #800000">Protocol</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="videocall-skype-com"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum28" style="color: #606060">  28:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Extension</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>As you can see Skype has many protocols to launch the application, all for specific tasks. you can use tel or sms as generic protocols so people can choose what kind of app they use for calling or texting or use the more specific protocols especially made for skype: skype, message-skype-com, audiocall-skype-com etc.</p>
<p>Launching Skype and starting with a specific task is really easy. On he URL just add the phone number or skype id after the protocol name to launch the app and directly start a voice call or chat message.</p>
<p>In C# you can just create a new URI containing the protocol + username for example: <strong>message-skype-com:UserName. </strong>This will launch skype and will automatically start a chat session with the user “UserName”</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> var chatTo = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"message-skype-com:"</span> + UserNameTextBox.Text);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> await Windows.System.Launcher.LaunchUriAsync(chatTo);</pre>
<p><!--CRLF--></div>
</div>
<p>When you’ve created the URL just call Windows.System.Launcher.LaunchUriAsync and pass in the URL and you’re done. it doesn’t get easier than this.</p>
<p>For your convenience I&#8217;ve created a sample project that can be downloaded from my SkyDrive here: <a title="http://sdrv.ms/ZRcwSQ" href="http://sdrv.ms/ZRcwSQ">http://sdrv.ms/ZRcwSQ</a></p>
<p>The sample projects launches Skype on different ways, starting Audio calls, video calls etc.</p>
<p>As you could see the code itself is peanuts, just knowing what to call is the trick. i found out which parameters to pass to Skype by trial and error. Luckily passing in the skype username or phone number was one of the first things i tried. </p>
<p>I wish that there would be some kind of list of all applications that can be launched by using app to app communications but unfortunately </p>
<p>Happy coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Launching+Skype+from+your+own+Windows+Store+App&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2013%2F04%2Flaunching-skype-from-your-own-windows-store-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Launching+Skype+from+your+own+Windows+Store+App&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F04%2Flaunching-skype-from-your-own-windows-store-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Launching+Skype+from+your+own+Windows+Store+App&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F04%2Flaunching-skype-from-your-own-windows-store-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2013%2F04%2Flaunching-skype-from-your-own-windows-store-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2013/04/launching-skype-from-your-own-windows-store-app/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>App to App communication on WP8 session @ Techdays 2013 slidedeck + sample code</title>
		<link>http://vdcruijsen.net/2013/03/app-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code/</link>
		<comments>http://vdcruijsen.net/2013/03/app-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code/#comments</comments>
		<pubDate>Fri, 15 Mar 2013 14:36:08 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Techdays]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=441</guid>
		<description><![CDATA[Last week I did a session about App to App communication on Windows Phone 8 and people who attended asked me to make the source of the samples and the slide deck available. I was quite busy this week but &#8230; <a href="http://vdcruijsen.net/2013/03/app-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week I did a session about App to App communication on Windows Phone 8 and people who attended asked me to make the source of the samples and the slide deck available. I was quite busy this week but here it finally is.</p>
<p><iframe height="327" src="https://skydrive.live.com/embed?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211908&amp;authkey=AHndPJsfWMHBcx0&amp;em=2" frameborder="0" width="402" scrolling="no"></iframe>
<p>&nbsp;</p>
<p>You can download the 3 sample projects from my <a href="http://sdrv.ms/155Nq1X" target="_blank">skydrive here</a>. The 3 sample projects contain different apps showing different app to app scenarios:</p>
<p><strong>ColleaguesDemo</strong>: App used to show how to launch office apps from within your app by opening Word / Excel or PowerPoint files. This app is also bound to a custom file type .colleague. if you install the app and try to browse to <a href="http://demo.vdcruijsen.net/geert.colleague">http://demo.vdcruijsen.net/geert.colleague</a> this app should start because it is associated with .colleague files.</p>
<p><strong>MovieList + GMDB</strong>: MovieList is an app to store my movies. I wanted to be able to launch the GMDB (Geert’s movie database) app to watch the movie details or watch a trailer. so when you browse to a movie in the movielist you can launch GMDB from there. The GMDB app is associated with the GMDB: protocol so you can launch the app from either the MovieList app or by an URL in an SMS/mail or NFC tag like this: gmdb:movie?id=8 </p>
<p><img title="techdaysbanner2" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="techdaysbanner2" src="http://vdcruijsen.net/wp-content/uploads/2013/03/techdaysbanner2.jpg" width="240" height="94"></p>
<p>Hopefully you enjoyed my session at TechDays and see you there again hopefully next year or at some other Windows Phone event.</p>
<p>I’m really curious to see apps showing up in the marketplace using App to App scenario’s because it would really add something to the Windows Phone Ecosystem.</p>
<p>Happy Coding</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=App+to+App+communication+on+WP8+session+%40+Techdays+2013+slidedeck+%2B+sample+code&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2013%2F03%2Fapp-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=App+to+App+communication+on+WP8+session+%40+Techdays+2013+slidedeck+%2B+sample+code&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F03%2Fapp-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=App+to+App+communication+on+WP8+session+%40+Techdays+2013+slidedeck+%2B+sample+code&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F03%2Fapp-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2013%2F03%2Fapp-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2013/03/app-to-app-communication-on-wp8-session-techdays-2013-slidedeck-sample-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fun with ValueConverters: building a Mustachify.me converter for Windows Phone &amp; Windows 8</title>
		<link>http://vdcruijsen.net/2013/02/fun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8/</link>
		<comments>http://vdcruijsen.net/2013/02/fun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8/#comments</comments>
		<pubDate>Thu, 07 Feb 2013 09:50:04 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=432</guid>
		<description><![CDATA[Valueconverters are a really usefull feature when you are building an app using the MVVM pattern so you can bind properties from your viewmodel of a specific type to a element in the view which can only bound to another &#8230; <a href="http://vdcruijsen.net/2013/02/fun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Valueconverters are a really usefull feature when you are building an app using the MVVM pattern so you can bind properties from your viewmodel of a specific type to a element in the view which can only bound to another type of object. Using avalueconverter you can convert the value of one kind of object to a different kind so you can still bind them.</p>
<p>What I often see when looking at code from people who are new to MVVM is that they have a lot of properties in their viewmodels that can easily be reduced by using valueconverters. The best example which is used the most is probably the Boolean to Visibility converter. When building an app, chances are high that you want to show or hide certain UI elements depending on some boolean in your viewmodel. To bad the Visibility property of these elements only wants a bind to the Visibility enum and not your boolean. By using a value converter you can switch this boolean value to a Visibility without creating a new Visibility typed property in your viewmodel that I see a lot of people doing.</p>
<p>Don’t worry you don’t have to create all these converters yourself. A lot of them are already created by others and shared on several locations. Microsoft made a coding4fun toolkit that contains the most important converters like the one i described above. You can check out these converters here: <a title="http://coding4fun.codeplex.com/wikipage?title=Converters" href="http://coding4fun.codeplex.com/wikipage?title=Converters">http://coding4fun.codeplex.com/wikipage?title=Converters</a></p>
<p>So how hard is it to create your own converter? It’s really easy and I’ll show it by creating a new converter step by step in the rest of this post. I was watching someone demoing a fun app a few weeks back that used the site <a href="http://Mustachify.me">http://Mustachify.me</a> to add mustaches to pictures and i thought this could be a pretty cool converter to create and add to your application so you can change all your images in your apps to images with Mustaches.</p>
<p>To start let’s create a new Windows Phone 8 project (These valueconverters aren’t only for Windows Phone, you can also use them for Windows 8, WPF, Silverlight, etc) and we’ll choose the “Windows Phone Databound app” project template so we will get some out of the box simple MVVM implementation.</p>
<p>To make this as simple as possible let’s just open the MainViewModel.cs and remove the out of the box&nbsp; LocalizedSampleProperty, the Items collection and the IsDataLoaded and LoadData methods. Now we only have a SampleProperty left and we’ll rename this to property to PhotoUrl and give it a default value of some random picture</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">string</span> _photoUrl = <span style="color: #006080">"http://upload.wikimedia.org/wikipedia/commons/2/21/Steve_Ballmer_at_CES_2010_cropped.jpg"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #008000">/// Sample ViewModel property; this property is used in the view to display its value using a Binding</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #008000">/// &lt;returns&gt;&lt;/returns&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> PhotoUrl</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     get</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         <span style="color: #0000ff">return</span> _photoUrl;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     set</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>         <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> != _photoUrl)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>         {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>             _photoUrl = <span style="color: #0000ff">value</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>             NotifyPropertyChanged(<span style="color: #006080">"PhotoUrl"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>         }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Our simple viewmodel is ready so now lets create the UI for this example. Just remove everything inside the LayoutRoot Grid and place a new Pivot there with 2 pivot items. inside the pivot items we’ll place 2 images. 1 original and 1 with the added mustaches.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">phone:Pivot</span> <span style="color: #ff0000">Title</span><span style="color: #0000ff">="mustachifymeconverter"</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="1"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">phone:PivotItem</span> <span style="color: #ff0000">Header</span><span style="color: #0000ff">="default"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">="{Binding PhotoUrl}"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">phone:PivotItem</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">phone:PivotItem</span> <span style="color: #ff0000">Header</span><span style="color: #0000ff">="mustache"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">="{Binding PhotoUrl}"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">phone:PivotItem</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">phone:Pivot</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Since we haven’t implemented the valueconverter yet the app will now show just 2 images both bound to the same PhotoUrl property created in the viewmodel. To make our example build we’ll have to remove the MainLongListSelector_SelectionChanged and the OnNavigatedTo methods from the MainPage.xaml.cs and the code inside the Application_Activated method in the App.xaml.cs since these are not needed anymore. </p>
<p>Let’s run the app and see if everything is working. The app should look something like this, showing a picture of Steve without any mustache <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img title="mustachedemo1" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="mustachedemo1" src="http://vdcruijsen.net/wp-content/uploads/2013/02/mustachedemo14.png" width="270" height="480">&nbsp;&nbsp;&nbsp; </p>
<p>It’s time to add the MustachifyMeConverter to our project. Just create a new class called MustachifyMeConverter and make it implement :IValueConverter</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MustachifyMeConverter : IValueConverter</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> Convert(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>         <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> NotImplementedException();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> ConvertBack(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> NotImplementedException();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>When you implement the IValueConverter you’ll have to implement 2 methods. Convert and ConvertBack. Since <a href="http://Mustachify.me">http://Mustachify.me</a> only supports adding mustaches we’ll leave the ConvertBack as it is and only implement Convert. </p>
<p>Implementing the Mustachify.me converter Convert method is really simple. you actually only need 1 line of code: check if the string passed as a value is empty, if not just add “http://mustachify.me/?src=” in front of the old url and return it.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> Convert(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">return</span> <span style="color: #0000ff">value</span> != <span style="color: #0000ff">null</span> ? <span style="color: #006080">"http://mustachify.me/?src="</span> + <span style="color: #0000ff">value</span>.ToString() : <span style="color: #0000ff">string</span>.Empty;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> }</pre>
<p><!--CRLF--></div>
</div>
</p>
<p>Yes ValueConverters are really easy to create so let’s also use it in our app. Adding it to the XAML is also pretty easy. Since building the UI should be done in Blend (in my opinion) lets add the value converter in Blend! Fire up the Mainpage in Blend and select the image on the 2nd pivot page. In the properties window select the Source and choose “Create Data Binding”. In the popup you’ll see an option to select a ValueConverter on the left bottom of the window. </p>
<p><img title="mustachedemo2" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="mustachedemo2" src="http://vdcruijsen.net/wp-content/uploads/2013/02/mustachedemo2.png" width="547" height="480"></p>
<p>Press “Add value connector” and in the new window select the MustachifyMeConverter we created. Press Ok and we’re all done.</p>
<p><img title="mustachedemo3" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="mustachedemo3" src="http://vdcruijsen.net/wp-content/uploads/2013/02/mustachedemo3.png" width="320" height="480"></p>
<p>Fire up the app again and now the 2nd pivot item should have mustaches added to the picture without adding any code in our viewmodel to support this.</p>
<p><img title="mustachedemo1" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="mustachedemo1" src="http://vdcruijsen.net/wp-content/uploads/2013/02/mustachedemo15.png" width="270" height="480"><img title="mustachedemo4" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="mustachedemo4" src="http://vdcruijsen.net/wp-content/uploads/2013/02/mustachedemo4.png" width="278" height="480"></p>
</p>
</p>
</p>
</p>
<p>Hopefully this small tutorial gave you some ideas on how and when to use ValueConverters when building Windows Phone apps or any other XAML based apps using the MVVM pattern.</p>
<p>You can download the sample project here: <a title="http://sdrv.ms/VYhVVk" href="http://sdrv.ms/VYhVVk">http://sdrv.ms/VYhVVk</a></p>
<p>Happy coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Fun+with+ValueConverters%3A+building+a+Mustachify.me+converter+for+Windows+Phone+%26amp%3B+Windows+8&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2013%2F02%2Ffun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Fun+with+ValueConverters%3A+building+a+Mustachify.me+converter+for+Windows+Phone+%26amp%3B+Windows+8&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F02%2Ffun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Fun+with+ValueConverters%3A+building+a+Mustachify.me+converter+for+Windows+Phone+%26amp%3B+Windows+8&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F02%2Ffun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2013%2F02%2Ffun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2013/02/fun-with-valueconverters-building-a-mustachify-me-converter-for-windows-phone-windows-8/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Windows Phone 8 Emulator Skin Switcher 1.0 released on codeplex</title>
		<link>http://vdcruijsen.net/2013/01/windows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex/</link>
		<comments>http://vdcruijsen.net/2013/01/windows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex/#comments</comments>
		<pubDate>Fri, 11 Jan 2013 08:04:59 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Emulator]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=425</guid>
		<description><![CDATA[Last year when working on some Windows Phone 7 projects i thought it was a good idea to change the skin of the Phone emulator of all the developers in our team for screenshots and demos. I created a project &#8230; <a href="http://vdcruijsen.net/2013/01/windows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last year when working on some Windows Phone 7 projects i thought it was a good idea to change the skin of the Phone emulator of all the developers in our team for screenshots and demos. I created a project on codeplex and gathered all the skins i could find on the internet into a simple app where people could switch from the default skin to a Lumia 800, HTC device or Samsung phone for example. </p>
<p>When Windows Phone 8 was announced i received a lot of questions from people to update the skin switcher app to support Windows Phone 8 and finally today i had time to finish this project and upload version 1.0 on codeplex.</p>
<p>In the Windows Phone 8 Emulator Skin Switcher you can choose between 17 different skins from all currently available Windows Phone 8 devices. The app works the same way as it did for Windows Phone 7. Just start the skin switcher, select a skin and restart your emulator. You can select up to 3 different skins at the same time. 1 for each emulator resolution.</p>
<p><img title="emulator skin switcher wxga" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="emulator skin switcher wxga" src="http://vdcruijsen.net/wp-content/uploads/2013/01/emulatorskinswitcherwxga.png" width="531" height="400"> </p>
<p>Available skins at 1.0 release:</p>
<ul>
<li><b>WVGA</b>
<li>WP8 Default
<li>HTC 8S Blue
<li>HTC 8S Orange
<li>Nokia Lumia 820 Black
<li>Nokia Lumia 820 Cyan
<li>Nokia Lumia 820 Red
<li>Nokia Lumia 820 White
<li>Nokia Lumia 820 Yellow</li>
</ul>
<ul>
<li><b>WXGA</b>
<li>WP8 Default
<li>Nokia Lumia 920 Black
<li>Nokia Lumia 920 Grey
<li>Nokia Lumia 920 Red
<li>Nokia Lumia 920 White
<li>Nokia Lumia 920 Yellow</li>
</ul>
<ul>
<li><b>720p</b>
<li>WP8 Default
<li>HTC 8X Black
<li>HTC 8X Blue
<li>HTC 8X Neon
<li>HTC 8X Red
<li>Samsung Ativ S</li>
</ul>
<p>You can download the Windows Phone 8 Emulator Skin switcher at codeplex here:</p>
<p><a title="http://wp8emulatorskins.codeplex.com/" href="http://wp8emulatorskins.codeplex.com/">http://wp8emulatorskins.codeplex.com/</a></p>
<p>If you’re still working with Windows Phone 7 you can use the old Windows Phone 7 Emulator Skin Swicher which is also available on <a href="wp7emuskinswitcher.codeplex.com/" target="_blank">codeplex</a></p>
<p><img title="HTC_8S_Blue_Skin_Up_480x800" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="HTC_8S_Blue_Skin_Up_480x800" src="http://vdcruijsen.net/wp-content/uploads/2013/01/HTC_8S_Blue_Skin_Up_480x800.png" width="150" height="265"> <img title="HTC_8X_Neon_Skin_Down_720x1280" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="HTC_8X_Neon_Skin_Down_720x1280" src="http://vdcruijsen.net/wp-content/uploads/2013/01/HTC_8X_Neon_Skin_Down_720x1280.png" width="150" height="288"> <img title="Nokia_Lumia_820_Cyan_Skin_Up_480x800" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Nokia_Lumia_820_Cyan_Skin_Up_480x800" src="http://vdcruijsen.net/wp-content/uploads/2013/01/Nokia_Lumia_820_Cyan_Skin_Up_480x800.png" width="150" height="259"> <img title="Nokia_Lumia_820_Red_Skin_Up_480x800" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Nokia_Lumia_820_Red_Skin_Up_480x800" src="http://vdcruijsen.net/wp-content/uploads/2013/01/Nokia_Lumia_820_Red_Skin_Up_480x800.png" width="150" height="261"> <img title="Nokia_Lumia_920_Grey_Skin_Up_768x1280" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Nokia_Lumia_920_Grey_Skin_Up_768x1280" src="http://vdcruijsen.net/wp-content/uploads/2013/01/Nokia_Lumia_920_Grey_Skin_Up_768x1280.png" width="150" height="255"> <img title="Samsung_ATIV_S_Skin_Down_720x1280" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="Samsung_ATIV_S_Skin_Down_720x1280" src="http://vdcruijsen.net/wp-content/uploads/2013/01/Samsung_ATIV_S_Skin_Down_720x1280.png" width="150" height="288"> </p>
<p>If you have any feedback or if you’ve created a skin yourself and would like to have it added to the application let me know by adding a comment here or contact me on <a href="http://twitter.com/geertvdc" target="_blank">twitter</a></p>
<p>Happy Coding and testing using your skinned Windows Phone 8 emulator!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Windows+Phone+8+Emulator+Skin+Switcher+1.0+released+on+codeplex&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2013%2F01%2Fwindows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Windows+Phone+8+Emulator+Skin+Switcher+1.0+released+on+codeplex&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F01%2Fwindows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Windows+Phone+8+Emulator+Skin+Switcher+1.0+released+on+codeplex&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2013%2F01%2Fwindows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2013%2F01%2Fwindows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2013/01/windows-phone-8-emulator-skin-switcher-1-0-released-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Code samples + slide deck available of my &#8220;Masters in Microsoft&#8221; session on new Windows Phone 8 developer features</title>
		<link>http://vdcruijsen.net/2012/11/mim-slidedeck-codesamples-wp8-win8/</link>
		<comments>http://vdcruijsen.net/2012/11/mim-slidedeck-codesamples-wp8-win8/#comments</comments>
		<pubDate>Fri, 16 Nov 2012 10:16:50 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Avanade]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=413</guid>
		<description><![CDATA[This post is made for everyone who was at my session at the “Masters in Microsoft” event at the Avanade office yesterday. Hopefully you enjoyed my session! I got asked for the sample code and slide deck a couple of &#8230; <a href="http://vdcruijsen.net/2012/11/mim-slidedeck-codesamples-wp8-win8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This post is made for everyone who was at my session at the “Masters in Microsoft” event at the Avanade office yesterday. Hopefully you enjoyed my session! I got asked for the sample code and slide deck a couple of times after the event during the drinks so therefore I’m uploading them here so everyone can grab a copy if they want it.</p>
<p><img style="display: inline; border: 0px;" title="54676_459741017401140_295441675_o" src="http://vdcruijsen.net/wp-content/uploads/2012/11/54676_459741017401140_295441675_o.jpg" alt="54676_459741017401140_295441675_o" width="400" height="300" border="0" /></p>
<p>I’ve uploaded the slide deck as pdf and the complete visual studio with all the working samples is also included in the same directory on my skydrive:</p>
<p>you can download it <a href="http://sdrv.ms/THAd90" target="_blank">here</a></p>
<p>I’ve also uploaded Jermaine’s slide deck on Windows 8 to the same skydrive folder so you can also have a look at them as well.</p>
<p>If you have any questions regarding Windows Phone or Windows 8 development let me know on twitter <a href="http://twitter.com/geertvdc" target="_blank">@geertvdc</a> or just add the hashtag #wpnl and the Dutch Windows Phone community will help you!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Code+samples+%2B+slide+deck+available+of+my+%26ldquo%3BMasters+in+Microsoft%26rdquo%3B+session+on+new+Windows+Phone+8+developer+features&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2Fmim-slidedeck-codesamples-wp8-win8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Code+samples+%2B+slide+deck+available+of+my+%26ldquo%3BMasters+in+Microsoft%26rdquo%3B+session+on+new+Windows+Phone+8+developer+features&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2Fmim-slidedeck-codesamples-wp8-win8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Code+samples+%2B+slide+deck+available+of+my+%26ldquo%3BMasters+in+Microsoft%26rdquo%3B+session+on+new+Windows+Phone+8+developer+features&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2Fmim-slidedeck-codesamples-wp8-win8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2Fmim-slidedeck-codesamples-wp8-win8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/mim-slidedeck-codesamples-wp8-win8/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 8: Wallet and In-App purchases</title>
		<link>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/</link>
		<comments>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/#comments</comments>
		<pubDate>Mon, 05 Nov 2012 21:53:06 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=406</guid>
		<description><![CDATA[&#160;&#160; Welcome to the last day in this series of blog posts on the new features for developers of the Windows Phone 8 platform. Today, the 8th day we’ll talk on our last subject of the series, the wallet functionality &#8230; <a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/8daysofwindowsphone84.png" width="500" height="202">&nbsp;&nbsp; </p>
<p>Welcome to the last day in this series of blog posts on the new features for developers of the Windows Phone 8 platform. Today, the 8th day we’ll talk on our last subject of the series, the wallet functionality and how to use in-app purchases.</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/" target="_blank">Day 5: .net 4.5 &amp; C# 5.0</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/" target="_blank">Day 6: Speech API</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/" target="_blank">Day 7: Proximity capabilities</a>
<li><strong>Day 8: Wallet and In-App purchases </strong>
</p>
<p><img title="day8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day8.png" width="200" height="98"> </p>
<h3>Wallet</h3>
<p>The wallet application is meant to be a place on your phone where all kinds of apps can store things like deals or other things for example points you can save at gas stations, bars etc. Using the Wallet API you can add or read wallet items from and to your Wallet application.</p>
<p>The first thing we’ll do in our sample application is add a deal to the Wallet. In this example we’ll build a deal for 1 free beer that can be collected in your favorite bar. Before we start adding code we have to add the Wallet Capability to the WMAppManifest.xml file.</p>
<p><img title="wallet capability" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wallet capability" src="http://vdcruijsen.net/wp-content/uploads/2012/11/walletcapability.png" width="342" height="116"> </p>
<p>After that we’ll add a button to create a new free beer deal in the wallet to our MainPage.xaml</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ContentPanel"</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="1"</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">="12,0,12,0"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="FreeBeerButton"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="get 1 free beer deal!"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="FreeBeerButton_Click_1"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>At the click event we’ll add the code to create a new deal in the wallet. We start with creating a new Deal object passing a unique ID to it. on this deal you can set a lot of properties from a name to images and a barcode. In this example i’ve added some of the basic properties but barcodes can be really usefull when you want to be able to use the barcode in your favorite bar for example <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  When we’ve set all the properties we’ll call the SaveAsync method and the Deal will be saved. It’s a common practice to also open the wallet application to let the user know that you’ve saved something to the wallet. There is no special launcher for the Wallet application but you can open an URL starting with wallet:// that will trigger the Wallet to open.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> async <span style="color: #0000ff">void</span> FreeBeerButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     var beerDeal = <span style="color: #0000ff">new</span> Deal(<span style="color: #006080">"1FREEBEER"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     beerDeal.MerchantName = <span style="color: #006080">"MyBar"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     beerDeal.DisplayName = <span style="color: #006080">"1 free beer!"</span>; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     beerDeal.Description = <span style="color: #006080">"collect 1 free beer at your favorite bar"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     beerDeal.CustomerName = <span style="color: #006080">"Geert"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     beerDeal.ExpirationDate = DateTime.Now.AddDays(1);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     beerDeal.IssuerName = <span style="color: #006080">"Your Favorite Bar"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     beerDeal.NavigationUri = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"/mainpage.xaml?deal=freebeer"</span>, UriKind.Relative);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>     await beerDeal.SaveAsync(); </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>     Launcher.LaunchUriAsync(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"wallet://"</span>, UriKind.RelativeOrAbsolute));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>When we run the app and click the free beer button the wallet will open and our deal is visible. if we click our deal we can see it’s details. if you add a barcode the barcode will be visible here as well. There is also an option to go back to the app. If we would click the open app link the app will open using the NavigationURI property set to the Deal object. You can also mark deals here as used or delete them from your wallet.</p>
<p><img title="wallet1" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wallet1" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wallet1.png" width="200" height="327"> <img title="wallet2" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wallet2" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wallet2.png" width="200" height="327"> <img title="wallet3" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wallet3" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wallet3.png" width="200" height="327"> <img title="wallet4" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wallet4" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wallet4.png" width="200" height="327"> </p>
</p>
</p>
</p>
</p>
<p>Besides deals you can also add Payment Instruments. These objects are things like the points you can gather by shopping at the same store often so you can use these points to get some rewards. Creating a Payment Instrument works almost the same as a deal except then you use the PaymentInstrument object. The PaymentInstrument object also has property to set an amount which you can increase or decrease later.</p>
<p>If you want to use the Payment Instrument items from the wallet you’ll have to add an extra capability to the WMAppManifest.xml called the ID_CAP_WALLET_PAYMENTINSTRUMENTS</p>
<p>The third thing you can add to the Wallet are generic wallet items. this can be like a customer card with a barcode or number which you can use in shops to identify yourself as a returning customer. You can create generic wallet items using the WalletTransactionItem.</p>
<h3>In-app purchases</h3>
<p>A really important feature of Windows Phone 8 is the possibility to use in-app purchases. In Windows Phone 7 you could only do free apps, trial modes and paid apps. In-app purchases really add new scenario’s to make money. for example you can create a free game where you can buy new levels for a certain amount of money. Another example is a sports app where you can buy push notifications for a certain season instead of buying the game once and getting notifications forever. so how do we do this?</p>
<p>In-app purchases have to be created on the development portal. Log into your developer account at dev.windowsphone.com and upload a new application or go to the details of an existing app.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp1.png"><img title="inapp1" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp1" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp1_thumb.png" width="500" height="393"></a> </p>
<p>Click on the products tab and then click “Add in-app product” to create a new product that can be bought in our app.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp2.png"><img title="inapp2" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp2" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp2_thumb.png" width="500" height="394"></a> </p>
<p>First we’ll have to fill in the in-app product properties. This consists of a name, and Identifier. this identifier is important because we’ll need to reference this in our app.</p>
<p>you can also select Durable or Consumable as the product type. the difference between this is that durable products will be bought once and will be available forever after that. consumable products are bought once and then also used only once.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp3.png"><img title="inapp3" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp3" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp3_thumb.png" width="500" height="506"></a> </p>
<p>We can select a price and press save. after that we’ll also have to add a description for our product</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp4.png"><img title="inapp4" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp4" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp4_thumb.png" width="500" height="402"></a> </p>
<p>When adding your description you’ll have to add a title, description text and an image. press save again.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp5.png"><img title="inapp5" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp5" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp5_thumb.png" width="500" height="506"></a> <a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp6.png"><img title="inapp6" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp6" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp6_thumb.png" width="500" height="392"></a> </p>
<p>Now we’re ready to submit the in-app product. when we press Submit our product will be saved and can be used in our app after certification.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp7.png"><img title="inapp7" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="inapp7" src="http://vdcruijsen.net/wp-content/uploads/2012/11/inapp7_thumb.png" width="500" height="392"></a> </p>
<p>So now we have an in-app product we can try to buy it from within our app.</p>
<p>Let’s add a button again to buy our 30 new levels.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="BuyLevelsButton"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="buy 30 more levels!"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="BuyLevelsButton_Click_1"</span> <span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>At the click event we’ll add code to buy our item. First we’ll need to get a list of all available products for our app. We can get this from the CurrentApp object by calling the LoadListingInformationAsync. since we know there is only 1 product we’ll take a shorcut by selecting the first product but you could select your product by checking the ID here. When we have the product we can call the RequestProductPurchaseAsync method to launch the marketplace and let the user choose if he wants to do this extra purchase. When the user chooses to buy the product or not we go back to our code and check if the product is set to Active. If this is true we’ll have to call the ReportProductFulFillment method to tell the store the app knows the purchase is done and after that we can save a property somewhere that unlocks the new feature in your app. </p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> async <span style="color: #0000ff">void</span> BuyLevelsButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     var products = await CurrentApp.LoadListingInformationAsync();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     var product1 = products.ProductListings.FirstOrDefault();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     var boughtProduct  = await CurrentApp.RequestProductPurchaseAsync(product1.Value.ProductId, <span style="color: #0000ff">true</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     <span style="color: #0000ff">if</span> (CurrentApp.LicenseInformation.ProductLicenses[product1.Value.ProductId].IsActive)    </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     {                </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         CurrentApp.ReportProductFulfillment(product1.Value.ProductId);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         var saveBoughtProductstate = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Note that we don’t add any extra code or anything in a product. it’s just a boolean that is set to true. so in the example of 30 extra levels you can buy all levels should be in the package, you just disable some in your UI unless the boolean is set to true when the purchase is made.</p>
<p>I really like the possibilities of the in-app purchases and believe this will make more companies like newspapers to build apps for the Windows Phone platform.</p>
<p>You can download the sample project <a title="here" href="http://sdrv.ms/QSJ2yx">here</a></p>
<p>That’s all folks. the 8 days of Windows Phone 8 blog series has come to an end. Hopefully you enjoyed reading this series of posts and learned something from it.</p>
<p>If you missed some new features and would like a post on that topic let me know and i’ll see if i can add some extra posts.</p>
<p>Geert van der Cruijsen</p>
</p>
</li>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+8%3A+Wallet+and+In-App+purchases&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+8%3A+Wallet+and+In-App+purchases&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+8%3A+Wallet+and+In-App+purchases&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 7: Proximity capabilities</title>
		<link>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/</link>
		<comments>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/#comments</comments>
		<pubDate>Sun, 04 Nov 2012 20:19:37 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=380</guid>
		<description><![CDATA[&#160; Welcome back to the blog series 8 days of Windows Phone 8. Today, almost the last post we’ll dive into proximity capabilities also known as bluetooth and nfc. One note to this post is that i couldn’t test the &#8230; <a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/8daysofwindowsphone83.png" width="500" height="202"> </p>
<p>Welcome back to the blog series 8 days of Windows Phone 8. Today, almost the last post we’ll dive into proximity capabilities also known as bluetooth and nfc. One note to this post is that i couldn’t test the code on the emulator since bluetooth and nfc are both only testable on devices and when i wrote this post i didn’t have access to a phone yet so maybe the examples are not 100% working.</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/" target="_blank">Day 5: .net 4.5 &amp; C# 5.0</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/" target="_blank">Day 6: Speech API</a>
<li><strong>Day 7: Proximity capabilities </strong>
<li>Day 8: Wallet and In-App purchases
</p>
<p><img title="day7" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day7" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day7.png" width="200" height="98"> </p>
<h3>Bluetooth</h3>
<p>When you want to use bluetooth or NFC the first thing you’ll need to do is add the Proximity capability in the WMAppManifest.xml file in the capabilities tab.</p>
<p><img title="proximity capability" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="proximity capability" src="http://vdcruijsen.net/wp-content/uploads/2012/11/proximitycapability.png" width="345" height="93"> </p>
<p>When we’ve done this we’re ready to start building an app to communicate with another device through Bluetooth. Communicating with Bluetooth works through a client server type of connection. One phone needs to be the server and then another phone can connect to this server and the phones can communicate with each other.</p>
<p>To set up the server and client we’ll add 2 buttons, 1 to start the server and 1 to start the client.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ContentPanel"</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="1"</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">="12,0,12,0"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ServerButton"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="ServerButton_Click_1"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="server"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ClientButton"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="ClientButton_Click_1"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="client"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>at the click event of the server button we’ll add the following code to set up a PeerFinder object to listen to events. when another peer connects to our phone a ConnectionRequested event will be handled and we’ll show a MessageBox to confirm the user another device is connected.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> ServerButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     PeerFinder.Start();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     PeerFinder.ConnectionRequested += PeerFinder_ConnectionRequested;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span> }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span> async <span style="color: #0000ff">void</span> PeerFinder_ConnectionRequested(<span style="color: #0000ff">object</span> sender, ConnectionRequestedEventArgs args)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     MessageBox.Show(<span style="color: #006080">"Connected"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     _ss = await PeerFinder.ConnectAsync(args.PeerInformation);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>To connect to the server we’ll need to implement the client part. Under the click event we’ll add the following code to search for server phones and connect to them if we found one. We’ll use the PeerFinder again to search for other peers. when the FindAllPeers method returns we’ll check if there is an active server by checking the count property and when the count is greater than 0 we’ll connect to this peer and check it’s displayname.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">protected</span> async <span style="color: #0000ff">void</span> ClientButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     PeerFinder.Start(); </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     var p = await PeerFinder.FindAllPeersAsync(); </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">if</span> (p.Count &gt; 0) </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     { </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>         _ss = await PeerFinder.ConnectAsync(p[0]);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         <span style="color: #0000ff">string</span> phoneName = p[0].DisplayName;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     }</pre>
<p><!--CRLF--></div>
</div>
<p>So now we have 2 phones connected we can send a message from one phone to the other. We’ll add another button to the main page and add code to the click event to send a message to another phone.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> async <span style="color: #0000ff">void</span> SendMessageButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>         {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>             <span style="color: #0000ff">if</span> (_ss == <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>                 <span style="color: #0000ff">throw</span> <span style="color: #0000ff">new</span> Exception(<span style="color: #006080">"Socket not initialized"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>             DataWriter dw = <span style="color: #0000ff">new</span> DataWriter(ss.OutputStream);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>             dw.WriteString(<span style="color: #006080">"Hello Windows Phone 8"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>             await dw.StoreAsync();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>         }</pre>
<p><!--CRLF--></div>
</div>
<p>We’ll use the StreamSocket initialized when we created our connection to send the message.&nbsp; If the socket isnt initialize we’ll throw an exception but continue otherwise. Create a DataWriter from the StreamSocket OutputStream and use the WriteString method to write a string to the DataWriter. Now we can call the StoreAsync method to actually send the message to the other phone.</p>
<p>The last thing we need to add is receiving the message on the phone. We’ll connect the PeerFinder StreamSocket and call a new private method called WaitForMessage.</p>
<p>In this asynchronous method we’ll open a DataReader from the StreamSocket’s inputstream. From this datareader we can first read the length of the message and after that we can read the message itself. Now we’re all done in receiving the message through bluetooth.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> async <span style="color: #0000ff">void</span> PeerFinder_ConnectionRequested(<span style="color: #0000ff">object</span> sender, ConnectionRequestedEventArgs args)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     MessageBox.Show(<span style="color: #006080">"Connected"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     _ss = await PeerFinder.ConnectAsync(args.PeerInformation);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">string</span> message = await WaitForMessage();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> <span style="color: #0000ff">private</span> async Task&lt;<span style="color: #0000ff">string</span>&gt; WaitForMessage()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     DataReader dr = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     <span style="color: #0000ff">while</span> (<span style="color: #0000ff">true</span>)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>         <span style="color: #0000ff">if</span> (dr == <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>             dr = <span style="color: #0000ff">new</span> DataReader(_ss.InputStream);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>         await dr.LoadAsync(4);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>         <span style="color: #0000ff">uint</span> messageLen = (<span style="color: #0000ff">uint</span>)dr.ReadInt32();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>         await dr.LoadAsync(messageLen);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>         <span style="color: #0000ff">return</span> dr.ReadString(messageLen);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum21" style="color: #606060">  21:</span> }</pre>
<p><!--CRLF--></div>
</div>
<h3>NFC</h3>
<p>The other Proximity capability in Windows Phone is NFC. With NFC it’s possible to read NFC tags or to communicate from phone to phone. In this post we’ll dive deeper in how to connect from one phone to another using NFC. To send and receive messages using NFC we’ll add 2 buttons again to our MainPage.xaml</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="NfcSendButton"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="NfcSendButton_Click_1"</span>  <span style="color: #ff0000">Content</span><span style="color: #0000ff">="nfc send"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="NfcReceiveButton"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="NfcReceiveButton_Click_1"</span>   <span style="color: #ff0000">Content</span><span style="color: #0000ff">="nfc receive"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>At the click event of the Send button we’ll add the following code. We’ll create an instance of a ProximityDevice and the only thing we’ll have to do is call the PublishMessage method on this ProximityDevice. In this example we’re sending a string but it’s also possible to send binary data.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> NfcSendButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     ProximityDevice pd = ProximityDevice.GetDefault();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     <span style="color: #0000ff">if</span> (pd != <span style="color: #0000ff">null</span>) </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     { </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>         pd.PublishMessage(<span style="color: #006080">"8days"</span>, <span style="color: #006080">"Hello World!"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>After sending the message the last thing we’ll do today is receiving the message. Add the following code to the click event of the receive button. In the click eventhandler we’ll get an instance of the ProximityDevice and subscribe for messages and that’s all. Now when a message is received the NfcReceive method is called and we can just read the message.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> NfcReceiveButton_Click_1(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     ProximityDevice pd = ProximityDevice.GetDefault();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">if</span> (pd != <span style="color: #0000ff">null</span>)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>         <span style="color: #0000ff">long</span> Id = pd.SubscribeForMessage(<span style="color: #006080">"8days"</span>, NfcReceive);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span> }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> NfcReceive(ProximityDevice sender, ProximityMessage message)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     var m = message.DataAsString;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>As you can see implementing NFC is really really easy in Windows Phone 8 and i can’t wait for people to use this in their apps. I think all announced Windows Phone 8 devices have NFC capabilities so it can become really big on the platform.</p>
<p><img title="proximity" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="proximity" src="http://vdcruijsen.net/wp-content/uploads/2012/11/proximity.png" width="200" height="328"> </p>
<p>Tomorrow the last day of the series where we talk on the Wallet features and how to implement in app purchases.</p>
<p>You can download the sample code <a href="http://sdrv.ms/QSJ2yx" target="_blank">here</a></p>
<p>Geert van der Cruijsen</p>
</p>
</li>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+7%3A+Proximity+capabilities&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-7-proximity-capabilities%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+7%3A+Proximity+capabilities&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-7-proximity-capabilities%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+7%3A+Proximity+capabilities&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-7-proximity-capabilities%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-7-proximity-capabilities%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Days 6: Speech API</title>
		<link>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/</link>
		<comments>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 19:45:26 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[speech]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=354</guid>
		<description><![CDATA[&#160; Welcome again to the blog series called 8 days of Windows Phone 8 celebrating the release of Windows Phone 8 and the Windows Phone 8 SDK. Today, 5 days after the release it’s time for the 6th post in &#8230; <a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/8daysofwindowsphone82.png" width="500" height="202"> </p>
<p>Welcome again to the blog series called 8 days of Windows Phone 8 celebrating the release of Windows Phone 8 and the Windows Phone 8 SDK. Today, 5 days after the release it’s time for the 6th post in this series on the Speech APIs. Speech on Windows Phone 8 consists of 3 key aspects: Text to Speech, Speech to Text and Voice commands. In this post we’ll demo all 3.</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/" target="_blank">Day 5: .net 4.5 &amp; C# 5.0</a>
<li><strong>Day 6: Speech </strong>
<li>Day 7: Proximity capabilities
<li>Day 8: Wallet and In-App purchases
</p>
<p><img title="day6" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day6" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day6.png" width="200" height="98"> </p>
<h3>Text to speech</h3>
<p>The first of the 3 speech APIs we’ll discuss is the Text to Speech API. In Windows Phone 7 you’ll had to use the Bing speech API if you wanted to translate a written sentence into sound. In Windows Phone 8 this API is part of the Windows Phone API although under the hood it will probably still use Bing servers.</p>
<p>Let’s create a new project and the first thing we need to do is add the Speech Recognition capability in WMAppManifest.xml file in the Capabilities tab in Visual studio 2012.</p>
<p><img title="capabilities" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="capabilities" src="http://vdcruijsen.net/wp-content/uploads/2012/11/capabilities.png" width="312" height="146">&nbsp; </p>
<p>After that we’ll add a button to our Mainpage and add the following 2 lines of code to the click event of the button</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> SayHelloButton_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     SpeechSynthesizer ss = <span style="color: #0000ff">new</span> SpeechSynthesizer(); </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     ss.SpeakTextAsync(<span style="color: #006080">"8 days of windows phone 8, day 6"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Run the app and indeed you’ll only need 2 lines of code to get text to speech working. Great! Note that the SpeakTextAsync method of the SpeechSynthesizer is async. First API checked on to the next one you would think.. well no there is more! You can also change the language and the voice of the clip. Let’s add some code to alter the voice and language to a German Male voice:</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> SayGermanButton_Click_(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     SpeechSynthesizer ss = <span style="color: #0000ff">new</span> SpeechSynthesizer();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     VoiceInformation vi = InstalledVoices.All.Where(v =&gt; v.Language == <span style="color: #006080">"de-DE"</span> &amp;&amp; v.Gender == VoiceGender.Male).FirstOrDefault();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     ss.SetVoice(vi);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     ss.SpeakTextAsync(<span style="color: #006080">"8 Tage von Windows Phone 8, Tag 6"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>It’s only 2 lines extra to set the language and gender (yes could be 1 i know <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) and the rest stays the same. we press the button again (in the sample project i’ve added an extra button to show both scenarios). Now run the project and we’ll have a german talking voice. Now it’s time to go to the next topic, speech to text.</p>
<h3>Speech to text</h3>
<p>the text to speech we discussed in the previous paragraph is pretty cool but converting speech to text is even more amazing and about as easy to implement. Before we start we’ll have to add the microphone capability so we can capture the sounds from the microphone. Just check the box in the capabilities tab of the WMAppManifest.xml file.</p>
</li>
<p><img title="capabilities microphone" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="capabilities microphone" src="http://vdcruijsen.net/wp-content/uploads/2012/11/capabilitiesmicrophone.png" width="335" height="91"> </p>
<p>Now that the capability is added we can start adding code to add the speech recognition. We’ll add a button to ask how you are doing to the mainpage.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="AskStatusButton"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="how are you doing?"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="AskStatusButton_Click"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="StatusText"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ConfidenceText"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>in the code behind we’ll add code to the click event of this button and the results of the speech recognition we’ll be adding to the StatusText textblock. We’ll also add an extra textblock to display the confidence level of the speech recognition.</p>
<p>In the click event we start with adding an SpeechRecognizerUI object. On this SpeechRecognizerUI object we’ll be settings some properties, The ListenText property is the text that is shown as the title in the speech box as shown on the image below. the next property is the ExampleText. here you can add a sample answer the user could answer. After that we set the ReadoutEnabled property to true so the Phone will speak your text back to you. The last property we’ll add is the ShowConfirmation that shows the spoken line of text as a text on the screen.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> async <span style="color: #0000ff">void</span> AskStatusButton_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     SpeechRecognizerUI sr = <span style="color: #0000ff">new</span> SpeechRecognizerUI();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     sr.Settings.ListenText = <span style="color: #006080">"How are you doing?"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     sr.Settings.ExampleText = <span style="color: #006080">"I'm doing fine"</span>; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     sr.Settings.ReadoutEnabled = <span style="color: #0000ff">true</span>; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     sr.Settings.ShowConfirmation = <span style="color: #0000ff">true</span>; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     SpeechRecognitionUIResult result = await sr.RecognizeWithUIAsync();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     <span style="color: #0000ff">if</span> (result.ResultStatus == SpeechRecognitionUIStatus.Succeeded) </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         StatusText.Text = result.RecognitionResult.Text;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>         ConfidenceText.Text = result.RecognitionResult.TextConfidence.ToString();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>When we’ve set all these properties we can call the RecognizeWithUIAsync method to trigger the voice recognition. Note that on the first time this is accessed by the user the user has to accept that the voice clips will be send to the Microsoft Servers for processing. when they accept the speech recognition will start.</p>
<p><img title="speech1" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech1" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech1.png" width="200" height="327"> <img title="speech2" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech2" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech2.png" width="200" height="327"> <img title="speech3" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech3" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech3.png" width="200" height="327"> <img title="speech4" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech4" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech4.png" width="200" height="327"></p>
<p>When the speech recognition finishes you can check the result in code. The result that comes back from the RecognizeWithUIAsync has a text property and also a confidence level to check if the result is usable or not. In the sample project we add these results to the 2 textboxes we’ve added to the mainpage.</p>
<p>In some use cases you just want the user to choose between some options instead of just free text. this is really easy to implement with the SpeechRecognizerUI class. We’ll be adding another button and 2 more textboxes on the Main page to ask the user which day the current day of the week is.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Button</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="AskDayButton"</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">="which day is it?"</span> <span style="color: #ff0000">Click</span><span style="color: #0000ff">="AskDayButton_Click"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Button</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="DayText"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="DayConfidenceText"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>After that we’ll add code to the click event of the new button with almost the same code as before with some extra additions.&nbsp; </p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">private</span> async <span style="color: #0000ff">void</span> AskDayButton_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     SpeechRecognizerUI sr = <span style="color: #0000ff">new</span> SpeechRecognizerUI();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     sr.Settings.ListenText = <span style="color: #006080">"Which day is it today?"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     sr.Settings.ExampleText = <span style="color: #006080">"Friday"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     sr.Settings.ReadoutEnabled = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     sr.Settings.ShowConfirmation = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     sr.Recognizer.Grammars.AddGrammarFromList(<span style="color: #006080">"answer"</span>, <span style="color: #0000ff">new</span> <span style="color: #0000ff">string</span>[] { <span style="color: #006080">"Monday"</span>, <span style="color: #006080">"Tuesday"</span>, <span style="color: #006080">"Wednesday"</span>, <span style="color: #006080">"Thursday"</span>, <span style="color: #006080">"Friday"</span>, <span style="color: #006080">"Saturday"</span>, <span style="color: #006080">"Sunday"</span> });</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     SpeechRecognitionUIResult result = await sr.RecognizeWithUIAsync();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     <span style="color: #0000ff">if</span> (result.ResultStatus == SpeechRecognitionUIStatus.Succeeded)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>         DayText.Text = result.RecognitionResult.Text;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>         DayConfidenceText.Text = result.RecognitionResult.TextConfidence.ToString();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>The only extra line we’ll add is a list of available answers and the speech recognizer will only match the spoken answer to one of these answers. In our example i’ve added the names of the days of the week. </p>
<p><img title="speech5" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech5" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech5.png" width="200" height="327"> <img title="speech6" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech6" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech6.png" width="200" height="327"> <img title="speech7" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech7" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech7.png" width="200" height="327"> </p>
<p>When you run the app the app will only accept existing days of the week.</p>
<h3>Voice commands</h3>
</p>
</p>
</p>
</p>
</p>
</p>
<p>The last subject of today is voice commands. With voice commands you can start your app with a specific task or execute a task when you are already in your app. Voice commands always consist of 3 parts. The App name so the operating system knows which app to send the command to. the second part is the the command name and the third part is a Phrase which is a sort of parameter you can add to your command.</p>
<p>To enable voice commands you’ll have to add an xml file which contains the voice commands. To add this VCD file right click your project in Visual Studio and select Add new item and select the Voice Command Definition from the list.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/vcdfile.png"><img title="vcd file" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="vcd file" src="http://vdcruijsen.net/wp-content/uploads/2012/11/vcdfile_thumb.png" width="500" height="311"></a> </p>
<p>By default you’ll get an already filled in VCD file with some example commands and phrases. We’ll be changing this to add a command to start the app by asking what day it is today, tomorrow or yesterday. </p>
<p>The first thing you’ll have to add to a VCD file is the CommandPrefix. this is the word the operating system will use to find your app.. after that we’ll add a Command. this command needs a ListenFor element where you tell the operating system which text to listen for. you can also add a phrase to this command like i did with the {day}. this phrase with it’s options should also be added to the VCD file.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;?</span><span style="color: #800000">xml</span> <span style="color: #ff0000">version</span><span style="color: #0000ff">="1.0"</span> <span style="color: #ff0000">encoding</span><span style="color: #0000ff">="utf-8"</span>?<span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">VoiceCommands</span> <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">="http://schemas.microsoft.com/voicecommands/1.0"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>   <span style="color: #0000ff">&lt;</span><span style="color: #800000">CommandSet</span> <span style="color: #ff0000">xml:lang</span><span style="color: #0000ff">="en-US"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">CommandPrefix</span><span style="color: #0000ff">&gt;</span>8 days<span style="color: #0000ff">&lt;/</span><span style="color: #800000">CommandPrefix</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Example</span><span style="color: #0000ff">&gt;</span>what day is it today?<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Example</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Command</span> <span style="color: #ff0000">Name</span><span style="color: #0000ff">="DayToday"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Example</span><span style="color: #0000ff">&gt;</span>What day is it?<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Example</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">ListenFor</span><span style="color: #0000ff">&gt;</span>What day is it {day}<span style="color: #0000ff">&lt;/</span><span style="color: #800000">ListenFor</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Feedback</span><span style="color: #0000ff">&gt;</span>Checking the day<span style="color: #0000ff">&lt;/</span><span style="color: #800000">Feedback</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Navigate</span> <span style="color: #ff0000">Target</span><span style="color: #0000ff">="/MainPage.xaml"</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Command</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">PhraseList</span> <span style="color: #ff0000">Label</span><span style="color: #0000ff">="day"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span> today <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span> tomorrow <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>       <span style="color: #0000ff">&lt;</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span> yesterday <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Item</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">PhraseList</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>   <span style="color: #0000ff">&lt;/</span><span style="color: #800000">CommandSet</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum21" style="color: #606060">  21:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">VoiceCommands</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>&nbsp;</p>
<p>When we’ve added the VCD file we can register our VCD to the operating system. You’ll only have to do this once when your app runs for the first time but for now i’ll just add it to the constructor of our mainpage.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> MainPage()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     InitializeComponent();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     InitializeVoiceCommands();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> <span style="color: #0000ff">private</span> async System.Threading.Tasks.Task InitializeVoiceCommands()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     await VoiceCommandService.InstallCommandSetsFromFileAsync(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"ms-appx:///VoiceCommandDefinition1.xml"</span>));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>That’s all we need to do. to start our app using our voice. You can trigger the voice recognition by holding the windows button for a few seconds. You’ll now see the small “Listening” popup window. if you say “What can i say” or press the question mark you’ll go to a new page with the explanation on what commands are available. The first page will describe the commands that are build in into the system. if you slide to the right you’ll get an overview of all apps that support voice commands. Our app is listed here. When you click the app you’ll get a list of available commands for this app.</p>
<p><img title="speech8" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech8.png" width="200" height="327">&nbsp; <img title="speech9" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech9" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech9.png" width="200" height="327"><img title="speech10" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech10" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech10.png" width="200" height="327"> <img title="speech11" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech11" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech11.png" width="200" height="327"> </p>
<p>When we hold the windows button now and say “8 days, What day is it tomorrow?” our app will start and will open the Mainpage.xaml</p>
<p><img title="speech12" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="speech12" src="http://vdcruijsen.net/wp-content/uploads/2012/11/speech12.png" width="200" height="327"> </p>
<p>The voice command is sent to the MainPage.xaml on the querystring. overriding the OnNaigatedTo event we can check which voice command was used and also which phrase was used. </p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> OnNavigatedTo(NavigationEventArgs e)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     <span style="color: #0000ff">base</span>.OnNavigatedTo(e);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">if</span> (e.NavigationMode == System.Windows.Navigation.NavigationMode.New)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>         <span style="color: #0000ff">if</span> (NavigationContext.QueryString.ContainsKey(<span style="color: #006080">"voiceCommandName"</span>))</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>             <span style="color: #0000ff">string</span> command = NavigationContext.QueryString[<span style="color: #006080">"voiceCommandName"</span>];</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>The voice command and phrase are both added as seperate url parameters so if we run the app again and trigger it by asking what day it is tomorrow we can see the following results when we attach the debugger:</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/onnavigatedto.png"><img title="onnavigated to" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="onnavigated to" src="http://vdcruijsen.net/wp-content/uploads/2012/11/onnavigatedto_thumb.png" width="640" height="224"></a> </p>
<p>As you can see there is a parameter “day” which you can use in a switch statement for example to call the appropriate method.</p>
<p>you can download the sample project here: <a title="http://sdrv.ms/QSJ2yx" href="http://sdrv.ms/QSJ2yx">http://sdrv.ms/QSJ2yx</a></p>
<p>That’s all for today on the Speech API’s. Hopefully you’ll be back tomorrow to read my post on the Proximity APIs.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Days+6%3A+Speech+API&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-days-6-speech%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Days+6%3A+Speech+API&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-days-6-speech%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Days+6%3A+Speech+API&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-days-6-speech%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-days-6-speech%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 5: .net 4.5 &amp; C# 5.0</title>
		<link>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/</link>
		<comments>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/#comments</comments>
		<pubDate>Sat, 03 Nov 2012 14:49:31 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=348</guid>
		<description><![CDATA[&#160; Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 5th day of this series we’ll talk about the new features in the .net framework 4.5 and the C# 5.0 language that &#8230; <a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/8daysofwindowsphone81.png" width="500" height="202"> </p>
<p>Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 5th day of this series we’ll talk about the new features in the .net framework 4.5 and the C# 5.0 language that can help you build great Windows Phone apps. The main features we’ll handle in this post are the async and await keywords and the DataContractJsonSerializer</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><strong>Day 5: .net 4.5 &amp; C# 5.0 </strong>
<li>Day 6: Speech
<li>Day 7: Proximity capabilities
<li>Day 8: Wallet and In-App purchases
<p>&nbsp;</p>
<p>&nbsp;<img title="day5" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day5" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day5.png" width="240" height="118"> </p>
<h1>.net framework 4.5 &amp; C# 5.0</h1>
<p>With Windows 8 we’re also upgrading our applictions from silverlight to the .net 4.5 framework and the C# 5.0 language. This does give Windows Phone developers some new features that are not actually new features in the SDK but are really useful for you as a developer of mobile applications. One of these new features are the <strong>async</strong> and <strong>await</strong> keywords. This makes building asynchronous applications so much easier and your UI more responsive. The other thing i want to elaborate on today is the use of the <strong>DataContractJsonSerializer</strong>. This class helps you to serialize or deserialize json strings to or from objects. Really useful when you’re connecting to services on the web.</p>
<p>Unfortunately not all APIs in the SDK are rewritten to make use of these async and await keywords so you can’t use them to do calls from the web. WebClient and HttpWebRequest do not make use of these features so hopefully sometime we can use HttpClient like we can in Windows 8.</p>
<p>My ideal situation in creating a demo for this post was combining the async and await keywords together with the json serializer. so if we can’t use it when getting the file from the web lets just use a local file instead. local file access APIs are written using the <strong>Task</strong>, async and await keywords. so lets get started and build a very very basic To Do list app to check the </p>
<p>Create a new Windows Phone 8 project and add a ToDo class to store our things we need to so. It’s just a property bag with a Title, Date and some text. To save this file as a json file later we’ll add some attributes so the DataContractJsonSerializer knows how this object can be serialized to a json file. To do this add the [<strong>DataContract</strong>] attribute to the ToDo class and add the [<strong>DataMember</strong>] attribute to each property you want to be serialized to json. By default the Serializer will give the properties in the json file the same name as the properties in your class. If you want to have different names you can change this in the DataMember attribute as shown for the Content property which we changed to the word “Text”</p>
<p id="codeSnippetWrapper">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> [DataContract]</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> ToDo</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> {   </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     [DataMember]</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Title { get; set; }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     [DataMember]</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     <span style="color: #0000ff">public</span> DateTime Date { get; set; }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     [DataMember(Name=<span style="color: #006080">"Text"</span>)]</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Content { get; set; }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> }</pre>
<p><!--CRLF--></div>
</p>
<p>So we’ve created a simple container for our objects lets create a business service called ToDoService to save a list of To Do items and get them back again from a file stored in the Local Folder. Local folder is the root of your applications data store which was called the Isolated storage in Windows Phone 7.</p>
<p>First we’ll add a method to our ToDoService to save a list of To Do items.</p>
</li>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> async Task&lt;<span style="color: #0000ff">string</span>&gt; SaveToDos()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     List&lt;ToDo&gt; todos = <span style="color: #0000ff">new</span> List&lt;ToDo&gt;();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     todos.Add(<span style="color: #0000ff">new</span> ToDo(){Title=<span style="color: #006080">"todo 1"</span>, Date = DateTime.Now, Content=<span style="color: #006080">"finish this series of blogposts"</span>});</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     todos.Add(<span style="color: #0000ff">new</span> ToDo(){Title=<span style="color: #006080">"todo 2"</span>, Date = DateTime.Now, Content=<span style="color: #006080">"Pick up milk from the store"</span>});</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     todos.Add(<span style="color: #0000ff">new</span> ToDo(){Title=<span style="color: #006080">"todo 3"</span>, Date = DateTime.Now, Content=<span style="color: #006080">"Wash my car"</span>});</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     DataContractJsonSerializer dcjs = <span style="color: #0000ff">new</span> DataContractJsonSerializer(<span style="color: #0000ff">typeof</span>(List&lt;ToDo&gt;));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>     MemoryStream ms = <span style="color: #0000ff">new</span> MemoryStream();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     dcjs.WriteObject(ms,todos);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     <span style="color: #0000ff">string</span> json = Encoding.UTF8.GetString(ms.ToArray(),0,(<span style="color: #0000ff">int</span>)ms.Length);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>     StorageFile todoFile = await localFolder.CreateFileAsync(<span style="color: #006080">"todos.json"</span>,CreationCollisionOption.ReplaceExisting);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>     <span style="color: #0000ff">using</span> (var f = await todoFile.OpenStreamForWriteAsync())</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>     {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>         await f.WriteAsync(ms.ToArray(),0,(<span style="color: #0000ff">int</span>)ms.Length);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span>         f.Close();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum21" style="color: #606060">  21:</span>     }</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum22" style="color: #606060">  22:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum23" style="color: #606060">  23:</span>     <span style="color: #0000ff">return</span> json;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum24" style="color: #606060">  24:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Please note the async keyword before the return type of this method. by adding this, this method can be called asynchronous and it will always return a Task containing your return type. In the method we first add a few ToDo items to a list. after that we create a new DataContractJsonSerializer and in the constructor we add the type of object it should serialize. We then use the DataContractJsonSerializer to serialize our list of ToDo items to a json string which will be returned at the end of the method.</p>
<p>When we have this json string we’ll create a new file in the local folder by calling the CreateFileAsync method. please note the <strong>await</strong> keyword before this method which means that the code below this line should be waiting until this asynchronous call is finished. When we have the local file we’ll just write the json string to this file and close the stream.</p>
<p>So now the ToDo items are saved in the local file, lets read them back and show them on the screen. We’ll add a new method to our ToDoService called GetToDos() which will read the json file and will deserialize it back to a list of ToDo items.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> async Task&lt;List&lt;ToDo&gt;&gt; GetToDos()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     var localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     StorageFile todoFile = await localFolder.GetFileAsync(<span style="color: #006080">"todos.json"</span>);</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     DataContractJsonSerializer dcjs = <span style="color: #0000ff">new</span> DataContractJsonSerializer(<span style="color: #0000ff">typeof</span>(List&lt;ToDo&gt;));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     var stream = await todoFile.OpenStreamForReadAsync();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     var todos = dcjs.ReadObject(stream) <span style="color: #0000ff">as</span> List&lt;ToDo&gt;;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     <span style="color: #0000ff">return</span> todos;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>We’ll start again by getting a reference to the local folder and the json file in the local folder. When we have this StorageFile object we can now create a new DataContractJsonSerializer again. Now we open a stream from our StorageFile and pass it to the DataContractJsonSerializer to change it back to a List of ToDo items. We’re all done.</p>
<p>To finish up the demo application we’ll add a textbox to the mainpage where we can display our json string and we’ll also add an ItemsControl to display the To Do items.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ContentPanel"</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="1"</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">="12,0,12,0"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">ScrollViewer</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="JsonText"</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">="Wrap"</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">ItemsControl</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="TodoList"</span> <span style="color: #ff0000">ItemTemplate</span><span style="color: #0000ff">="{StaticResource TodoItemTemplate}"</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">="0,12,0,0"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">ItemsControl</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ScrollViewer</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>In our code behind we’ll hook everything up to write and read the data and show it on the page.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> async <span style="color: #0000ff">void</span> SaveAndGetTodos()</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>     ToDoService ts = <span style="color: #0000ff">new</span> ToDoService();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>     <span style="color: #0000ff">string</span> json = await ts.SaveToDos();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     List&lt;ToDo&gt; todos = await ts.GetToDos();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     JsonText.Text = json;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     TodoList.ItemsSource = todos;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>If we now run our application we’ll see the json string that is created and also the list of To Do items in the itemscontrol.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/day5demo.png"><img title="day5demo" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="day5demo" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day5demo_thumb.png" width="299" height="480"></a> </p>
<p>you can download the demo project here: <a title="http://sdrv.ms/QSJ2yx" href="http://sdrv.ms/QSJ2yx">http://sdrv.ms/QSJ2yx</a></p>
<p>Hopefully you enjoyed reading this post or learned some usefull features of the async and await keywords and the DataContractJsonSerializer. More tomorrow on one of the coolest new things in the SDK: the Speech APIs</p>
</p>
</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+5%3A+.net+4.5+%26amp%3B+C%23+5.0&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-5-net-4-5-c-5-0%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+5%3A+.net+4.5+%26amp%3B+C%23+5.0&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-5-net-4-5-c-5-0%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+5%3A+.net+4.5+%26amp%3B+C%23+5.0&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-5-net-4-5-c-5-0%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-5-net-4-5-c-5-0%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 4: New Screen Resolutions</title>
		<link>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/</link>
		<comments>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/#comments</comments>
		<pubDate>Fri, 02 Nov 2012 12:00:37 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=341</guid>
		<description><![CDATA[&#160; Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 4th day of this series we’ll dive into the new screen resolutions of Windows Phone 8 and what you should do to &#8230; <a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/11/8daysofwindowsphone8.png" width="500" height="202"> </p>
<p>Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 4th day of this series we’ll dive into the new screen resolutions of Windows Phone 8 and what you should do to support these as a Windows Phone developer.</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><strong>Day 4: New screen resolutions </strong>
<li>Day 5: .net 4.5 &amp; C# 5.0
<li>Day 6: Speech
<li>Day 7: Proximity capabilities
<li>Day 8: Wallet and In-App purchases
<p>&nbsp;</p>
<p><img title="day4" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day4" src="http://vdcruijsen.net/wp-content/uploads/2012/11/day4.png" width="200" height="98"> </p>
<h1>Available Screen resolutions</h1>
<p>3 screen resolutions are supported in Windows Phone 8: WVGA, WXGA and 720p. </p>
<table cellspacing="0" cellpadding="2" width="400" border="1">
<tbody>
<tr>
<td valign="top" width="133">&nbsp;</td>
<td valign="top" width="133">Resolution</td>
<td valign="top" width="133">Ratio</td>
</tr>
<tr>
<td valign="top" width="133">WVGA</td>
<td valign="top" width="133">480*800</td>
<td valign="top" width="133">15:9</td>
</tr>
<tr>
<td valign="top" width="133">WXGA</td>
<td valign="top" width="133">768*1280</td>
<td valign="top" width="133">15:9</td>
</tr>
<tr>
<td valign="top" width="133">720P</td>
<td valign="top" width="133">720*1280</td>
<td valign="top" width="133">16:9</td>
</tr>
</tbody>
</table>
<p>The most important thing to notice is there are 2 different screen ratio’s. 15:9 and 16:9. If you look at the picture below that is a representation of the 3 resolutions the WVGA (480*800) and the WXGA (768*1280) share the same Ratio so apps build for WVGA can be scaled to WXGA or the other way around. the 720P resolution however uses a 16:9 ratio that is higher so you have to make sure your UI layout is capable of using this longer screen estate. </p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/wp8resolutions.png"><img title="wp8 resolutions" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wp8 resolutions" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wp8resolutions_thumb.png" width="288" height="480"></a> </p>
<p>So what should you do to support all these resolutions? The first thing is all the assets Tile image etc should be used in the largest sizes. The OS will resize them to the right size for you. In your app however you should create a flexible UI that will scale certain UI elements like list boxes to change depending if the screen is longer as in the 720p resolution or shorter as in the other 2 resolutions. Also something to keep in mind is that WXGA is 1.6x the resolution of WVGA the canvas is still 480*800. all UI elements will be scaled to 160%. You don’t have to change your UI for WXGA compared to WVGA except for images. You can check for the current device resolution in code.</p>
<p>To check the current resolution in code you can use the properties in the Application.Current.Host object. In the example project I’ll print these properties on the screen so you can see the actual values in the screenshots below. We’ll also use these values to select appropriate images for the resolution.</p>
<p>First we’ll add some text fields to the main page XAML together with an image. In the code behind we’ll set these text boxes to the actual screen height/width/scale and resolution name properties.</p>
</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ContentPanel"</span> <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">="1"</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">="12,0,12,0"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Orientation</span><span style="color: #0000ff">="Horizontal"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;</span>Height<span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="TextHeight"</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Orientation</span><span style="color: #0000ff">="Horizontal"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;</span>Width<span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="TextWidth"</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Orientation</span><span style="color: #0000ff">="Horizontal"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;</span>Scale<span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="TextScale"</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span> <span style="color: #ff0000">Orientation</span><span style="color: #0000ff">="Horizontal"</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;</span>Resolution<span style="color: #0000ff">&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="TextResolution"</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">="{StaticResource PhoneTextNormalStyle}"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">TextBlock</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">="100"</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">="ScaledImage"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">Image</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; border-top: silver 1px solid; font-family: 'Courier New', courier, monospace; border-right: silver 1px solid; border-bottom: silver 1px solid; padding-bottom: 4px; direction: ltr; text-align: left; padding-top: 4px; padding-left: 4px; margin: 20px 0px 10px; border-left: silver 1px solid; line-height: 12pt; padding-right: 4px; max-height: 200px; width: 97.5%; background-color: #f4f4f4">
<div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum1" style="color: #606060">   1:</span> TextHeight.Text = Application.Current.Host.Content.ActualHeight.ToString();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum2" style="color: #606060">   2:</span> TextWidth.Text = Application.Current.Host.Content.ActualWidth.ToString();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum3" style="color: #606060">   3:</span> TextScale.Text = Application.Current.Host.Content.ScaleFactor.ToString();</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum4" style="color: #606060">   4:</span>&nbsp; </pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum5" style="color: #606060">   5:</span> <span style="color: #008000">//use the scale to check which resolution you're using</span></pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum6" style="color: #606060">   6:</span> <span style="color: #0000ff">switch</span> (Application.Current.Host.Content.ScaleFactor)</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum7" style="color: #606060">   7:</span> {</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum8" style="color: #606060">   8:</span>     <span style="color: #0000ff">case</span> 100:</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum9" style="color: #606060">   9:</span>         ScaledImage.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"Assets/wvga.png"</span>, UriKind.Relative));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum10" style="color: #606060">  10:</span>         TextResolution.Text = <span style="color: #006080">"WVGA"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum11" style="color: #606060">  11:</span>         <span style="color: #0000ff">break</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum12" style="color: #606060">  12:</span>     <span style="color: #0000ff">case</span> 150:</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum13" style="color: #606060">  13:</span>         ScaledImage.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"Assets/720p.png"</span>, UriKind.Relative));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum14" style="color: #606060">  14:</span>         TextResolution.Text = <span style="color: #006080">"720P"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum15" style="color: #606060">  15:</span>         <span style="color: #0000ff">break</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum16" style="color: #606060">  16:</span>     <span style="color: #0000ff">case</span> 160:</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum17" style="color: #606060">  17:</span>         ScaledImage.Source = <span style="color: #0000ff">new</span> BitmapImage(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">"Assets/wxga.png"</span>, UriKind.Relative));</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum18" style="color: #606060">  18:</span>         TextResolution.Text = <span style="color: #006080">"WXGA"</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum19" style="color: #606060">  19:</span>         <span style="color: #0000ff">break</span>;</pre>
<p><!--CRLF-->
<pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"><span id="lnum20" style="color: #606060">  20:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>&nbsp;</p>
<p>The 3 images: wvga, wxga and 720p are images scaled to the correct size. the WVGA image is 432*100 (the same size as the image width and height in the XAML). the 720p and WXGA are both larger the 720p emulator is 1.5x the size of the WVGA image and the WXGA image is 1.6x the size of the WVGA image. this image is chosen dynamically by the scale property as shown in the code above.</p>
<p>used images: (text font size is the same on all images to give you an idea of the image quality. click the image to see the actual size)</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/wvga.png"><img title="wvga" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wvga" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wvga_thumb.png" width="240" height="56"></a> </p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/720p.png"><img title="720p" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="720p" src="http://vdcruijsen.net/wp-content/uploads/2012/11/720p_thumb.png" width="240" height="56"></a> </p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/wxga.png"><img title="wxga" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wxga" src="http://vdcruijsen.net/wp-content/uploads/2012/11/wxga_thumb.png" width="240" height="55"></a> </p>
<p>results in the emulators for all 3 resolutions:</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/resolutionwvga.png"><img title="resolution wvga" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="resolution wvga" src="http://vdcruijsen.net/wp-content/uploads/2012/11/resolutionwvga_thumb.png" width="240" height="206"></a> <a href="http://vdcruijsen.net/wp-content/uploads/2012/11/resolution720p.png"><img title="resolution 720p" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="resolution 720p" src="http://vdcruijsen.net/wp-content/uploads/2012/11/resolution720p_thumb.png" width="240" height="208"></a> </p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/11/resolutionwxga.png"><img title="resolution wxga" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="resolution wxga" src="http://vdcruijsen.net/wp-content/uploads/2012/11/resolutionwxga_thumb.png" width="240" height="218"></a>&nbsp;</p>
<p>&nbsp;</p>
</li>
<p>So now we know how to handle images in your UI. the last part you need to know is that apps on the 720p resolutions have a higher height compared to the WVGA and WXGA resolution (as you can see in the screenshots above). If you fix your design on 800 pixels high you’ll have an empty piece of screen on the bottom that is not used by your app. It’s better to design your app with certain parts with dynamic heights of your page like a listbox, map control or scrollviewer so they will fill up the screen with just a bit longer list, map etc.</p>
<p>Hopefully this gives you an idea on how to build apps supporting all resolutions. </p>
<p>You can download the sample project here: <a title="http://sdrv.ms/QSJ2yx" href="http://sdrv.ms/QSJ2yx">http://sdrv.ms/QSJ2yx</a></p>
<p>Thanks for reading my 4th post in this series of 8 about the new features in Windows Phone 8. Tomorrow a post on some new features in the .net framework 4.5 and the C# 5.0 language which can be important for you as a Windows Phone developer.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+4%3A+New+Screen+Resolutions&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-4-new-screen-resolutions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+4%3A+New+Screen+Resolutions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-4-new-screen-resolutions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+4%3A+New+Screen+Resolutions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-4-new-screen-resolutions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F11%2F8-days-of-windows-phone-8-day-4-new-screen-resolutions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 3: Emulator &amp; Simulation Dashboard</title>
		<link>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/</link>
		<comments>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/#comments</comments>
		<pubDate>Wed, 31 Oct 2012 20:07:29 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Emulator]]></category>
		<category><![CDATA[simulation dashboard]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=319</guid>
		<description><![CDATA[Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 3rd day of this series we’ll dive into the new Emulator and the Simulation Dashboard in Visual Studio 2012. Day 1: SDK Overview &#8230; <a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/10/8daysofwindowsphone82.png" width="500" height="202"> </p>
<p>Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 3rd day of this series we’ll dive into the new Emulator and the Simulation Dashboard in Visual Studio 2012.</p>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><strong>Day 3: Emulator &amp; Simulation dashboard</strong>&nbsp;&nbsp;
<li>Day 4: New screen resolutions
<li>Day 5: .net 4.5 &amp; C# 5.0
<li>Day 6: Speech
<li>Day 7: Proximity capabilities
<li>Day 8: Wallet and In-App purchases
<p>&nbsp;</p>
<p><img title="day3" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day3" src="http://vdcruijsen.net/wp-content/uploads/2012/10/day3.png" width="200" height="98"> </p>
<h1>Windows Phone Emulator</h1>
</p>
<p>The Windows Phone 8 emulator has changed a lot from the Windows Phone 7 emulator. The new emulator is actually a Hyper-V virtual machine so it feels like an actual phone. When starting the Windows Phone 7 emulator you only had a your app, internet explorer and the settings app available for testing. When starting the Windows Phone 8 emulator you’ll see all the apps you would expect when you buy a Windows Phone. From the dialer to the people hub everything is there in the emulator.</p>
<p>The reason the new emulator is running in Hyper-V is also the reason why you can only develop for Windows Phone on Windows 8 Pro or higher. You’ll also need a processor that supports Second Level Address Translation (SLAT). This should be available on machines running an I3/I5/I7 processor from intel (my old dual core intel laptop wouldn’t run the emulator because of missing SLAT).</p>
<p>If you don’t have SLAT you can still develop apps in Visual studio and compile them you’ll only not be able to run the emulator.</p>
<p>When you open a new Windows Phone project in Visual studio you’ll see several options when choosing an emulator. You can choose to test on a connected device like you could in Windows Phone 7 and there are a bunch of emulators.</p>
<p>From the 4 emulators you can choose the WVGA, WXGA and 720P these are emulators which run in different resolutions. on the lowest resolution WVGA there’s an extra emulator that runs on 512MB internal memory. The others run on 1024MB. This 512MB emulator is the Windows Phone 8 equivalent of the 256MB Windows Phone 7 emulator which has some restrictions and will not run every app available in the store. Currently the only phone that is announced with 512MB is the HTC 8S. All other phones by HTC, Nokia and Samsung have 1024MB.</p>
<p><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="image" src="http://vdcruijsen.net/wp-content/uploads/2012/10/image1.png" width="240" height="188"> </p>
<p>When we press F5 and build and deploy our app the emulator boots up and will automatically launch your app. Booting the emulator will take a bit longer than it did on Windows Phone 7 but it’s understandable since it’s a complete working phone now instead of only your app running in a empty shell.</p>
<p><img title="wp8 emulator" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wp8 emulator" src="http://vdcruijsen.net/wp-content/uploads/2012/10/wp8emulator.png" width="180" height="296">&nbsp;<img title="theme settings" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="theme settings" src="http://vdcruijsen.net/wp-content/uploads/2012/10/themesettings.png" width="180" height="296">&nbsp;<img title="accent colors wp8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="accent colors wp8" src="http://vdcruijsen.net/wp-content/uploads/2012/10/accentcolorswp8.png" width="180" height="297"></p>
<p>When the emulator is started you can do everything you can do on a Windows Phone 8 device. you can select the theme color and language like you could on Windows Phone 7 and you can also check all build in apps like the market place, the people hub or the office hub. Great for inspiration when designing and developing your apps since These build-in apps implement the Microsoft Design Language and Windows Phone grid really well.</p>
<p>There is also an option to open aditional tools like you could on Windows Phone 7 by pressing the arrow key on the bottom of the menu bar next to the emulator. By default it will open the first tab where you can test the accelerometer. This works exactly the same as was the case for Windows Phone 7. you can move the phone around by clicking and dragging the emulator image to see the result in the emulator. You can also change the orientation or play a shake movement.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/10/accelerometer.png"><img title="accelerometer" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="accelerometer" src="http://vdcruijsen.net/wp-content/uploads/2012/10/accelerometer_thumb.png" width="550" height="319"></a>&nbsp;</p>
<p>the 2nd tab is the location tab. Again nothing changed here from Windows Phone 7. you can select a location on the map to see it change in the emulator immediately or record several locations and play it back with set intervals between the locations to emulate a moving phone.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/10/location.png"><img title="location" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="location" src="http://vdcruijsen.net/wp-content/uploads/2012/10/location_thumb.png" width="550" height="319"></a>&nbsp;</p>
<p>The third tab is the screenshot tab. You can take screenshots here of apps running on the emulator. For Windows Phone 7 developers again nothing else new here. On a side note, if you are testing on your device you can also take screenshots by holding the power button together with the start button.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/10/screenshot.png"><img title="screenshot" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="screenshot" src="http://vdcruijsen.net/wp-content/uploads/2012/10/screenshot_thumb.png" width="550" height="319"></a> </p>
<p>The last tab in the additional tools menu is the Network tab. On this tab you can see the which virtual network adapter the emulator is using.</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/10/network.png"><img title="network" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="network" src="http://vdcruijsen.net/wp-content/uploads/2012/10/network_thumb.png" width="550" height="319"></a>&nbsp;</p>
<h3>Simulation Dashboard</h3>
<p>The emulator gives you lots of features to test your application. You can test most test scenarios like test with multiple accent colors, dark/light theme. Test multiple languages and cultures etc. Some use cases however were really hard to test on Windows Phone 7. You had to have a device to test cases like what would happen when your phone goes on the lock screen or what happens on a slow data connection. Some of those cases like a slow data connection are still really hard to test in a consistent way even if you have a device. Luckily Microsoft had the same idea so they came up with a solution for these use cases called the Simulation Dashboard in Visual Studio 2012.</p>
<p>You can find the Simulation dashboard in the tools menu of Visual Studio.</p>
<p><img title="simulationdashboardlink" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="simulationdashboardlink" src="http://vdcruijsen.net/wp-content/uploads/2012/10/simulationdashboardlink.png" width="500" height="123"> </p>
<p>When you open the Simulation Dashboard you’ll see a new screen on the right where you can set some features of the emulator (don’t know why they didn’t add the simulation dashboard as a to the additional tools of the emulator, would be logical in my opinion)</p>
<p><img title="simulationdashboard" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="simulationdashboard" src="http://vdcruijsen.net/wp-content/uploads/2012/10/simulationdashboard.png" width="428" height="614"> </p>
<p>The first option is to change your network connection speed to 2G/3G/4G, Wi-Fi or no network. you can also switch the signal strength from good to poor. This gives you a lot of options to see what happens with your app when a user uses your app on a slow connection so you can see if you should improve your app to support slow connection scenarios.</p>
<p>The next option is to lock the screen of your emulator. really usefull when testing the new lock screen features as described in <a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">yesterdays post.</a> This feature can also be useful when building and testing apps that should be able to run under the lockscreen.</p>
<p>The last scenario is to trigger a reminder. this was also a pain to test before but now it’s just 1 press of a button and a reminder will pop up on your emulator. fun fact: if you press the snooze button another reminder WILL pop up again after the set time <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>That’s all i can tell you about the new features available in the Windows Phone 8 emulator and Simulation Dashboard. I think these features really add more value and make it easier for developers to build and test their applications for Windows Phone 8.</p>
<p>If you have any feedback on this post or this blog serie let me know on <a href="http://twitter.com/geertvdc" target="_blank">twitter</a> or a comment below this post. Tomorrow we’ll discuss what you should do to support all screen resolutions that are available in Windows Phone 8.</p>
</p>
</p>
</p>
</p>
</p>
</p>
<p>Geert van der Cruijsen</p>
</p>
</li>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+3%3A+Emulator+%26amp%3B+Simulation+Dashboard&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+3%3A+Emulator+%26amp%3B+Simulation+Dashboard&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+3%3A+Emulator+%26amp%3B+Simulation+Dashboard&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8 &#124; Day 2: Live tiles &amp; Lock screen</title>
		<link>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/</link>
		<comments>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 23:00:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=284</guid>
		<description><![CDATA[Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 2nd day of this series we’ll dive into the new possibilities of Windows Phone 8 live tiles and the lock screen. Day 1: &#8230; <a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img style="display: inline; border-width: 0px;" title="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/10/8daysofwindowsphone81.png" alt="8 days of windows phone 8" width="500" height="202" border="0" /></p>
<p>Welcome back to my series of blog posts called 8 days of Windows Phone 8. Today, the 2nd day of this series we’ll dive into the new possibilities of Windows Phone 8 live tiles and the lock screen.</p>
<ul>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/" target="_blank">Day 1: SDK Overview</a></li>
<li><strong>Day 2: Live tiles and Lock screen</strong></li>
<li>Day 3: Emulator &amp; Simulation dashboard</li>
<li>Day 4: New screen resolutions</li>
<li>Day 5: .net 4.5 &amp; C# 5.0</li>
<li>Day 6: Speech</li>
<li>Day 7: Proximity capabilities</li>
<li>Day 8: Wallet and In-App purchases&nbsp;
<p><img style="display: inline; border-width: 0px;" title="day2" src="http://vdcruijsen.net/wp-content/uploads/2012/10/day2.png" alt="day2" width="200" height="98" border="0" /></p>
<h1>Live tiles</h1>
<p>If you are familiar with developing for Windows Phone 7 you already know about live tiles. They are one if the unique features of Windows Phone that everyone loves. In Windows Phone 8 Microsoft added more possibilities to create live tiles and also made them more flexible for the end users to really personalize their phone.</p>
<p>One of the main changes is that live tiles now can be set by any user to 3 different sizes. Small, medium and wide. There are also 3 different templates to create live tiles that show information on different ways: the Flip template, the Cycle template and the Iconic template.</p>
<p>Sizes used for these templates are:</p>
<table width="511" border="2" cellspacing="0" cellpadding="2" align="center">
<tbody>
<tr>
<td valign="top" width="119"></td>
<td valign="top" width="159">Flip</td>
<td valign="top" width="126">Cycle</td>
<td valign="top" width="103">Iconic</td>
</tr>
<tr>
<td valign="top" width="133">Small</td>
<td valign="top" width="170">159 * 159px</td>
<td valign="top" width="134">159 * 159px</td>
<td valign="top" width="110">110 * 110px</td>
</tr>
<tr>
<td valign="top" width="138">Medium</td>
<td valign="top" width="170">336 * 336px</td>
<td valign="top" width="137">336 * 336px</td>
<td valign="top" width="114">202 * 202px</td>
</tr>
<tr>
<td valign="top" width="140">Wide</td>
<td valign="top" width="168">691 * 336px</td>
<td valign="top" width="138">691 * 336px</td>
<td valign="top" width="117">-</td>
</tr>
</tbody>
</table>
<p>You might expect that there would be even more resolutions for the images because of the new resolutions that are supported in Windows Phone 8 but this is not the case. The OS will scale the images for you so you only have to supply them once.</p>
<h3>Flip template</h3>
<p>In Windows Phone 7 it was possible to create tiles and set certain properties on them like a title, count, a back ground image and a text located on the back of the tile. In Windows Phone 8 this is still possible but Microsoft created 2 more tile templates to create live tiles. The template that was used in Windows Phone 7 is now called the Flip Template because it has data on it’s back and will flip at random intervals showing this data. The other templates are called the Iconic template and the Cycle template.</p>
<p>So lets start looking at some code. At the end of the post you can download all the example code in 1 project to set the different kinds of tiles. Let’s create a Flip tile first:</p>
<p>We start with a new empty project and add a button to set our flip template. Lets add a click event and place our tile creation code there to make it as easy as possible. In the click event we’ll start adding the code for adding the live tile</p>
<p>&nbsp;</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> FlipButton_Click(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>     ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span>     FlipTileData fliptile = <span style="color: #0000ff;">new</span> FlipTileData();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span>     fliptile.Title = <span style="color: #006080;">"WP8"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span>     fliptile.Count = 9;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span>     fliptile.BackTitle = <span style="color: #006080;">"day 2"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span>     fliptile.BackContent = <span style="color: #006080;">"back medium"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span>     fliptile.WideBackContent = <span style="color: #006080;">"back of the wide tile"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span>     fliptile.SmallBackgroundImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/159.png"</span>,UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>     fliptile.BackgroundImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/336.png"</span>, UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span>     fliptile.WideBackgroundImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/wide.png"</span>, UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;"> 17:</span>     tile.Update(fliptile);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;"> 18:</span> }</pre>
</div>
</div>
<p>First of you can get the current active tile by querying the ShellTile class. After that we’ll be creating a new FlipTileData object where we can set all the properties of the new tile. We’ll set the title, count and other properties. Some properties are only for the tile in small mode, some are only used in medium or wide mode and some are used in all modes like the count. We’re adding 3 different images for the 3 sizes of the tile. When we finished setting the properties on the tile we can call the update method on our tile object and pass the FlipTileData to it to set the new tile.</p>
<p>You can set the following properties on the flip tile:</p>
<table width="400" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="171">Title</td>
<td valign="top" width="229">The title is shown on the bottom left of the front of the tile. it will be shown on the medium and wide tiles.</td>
</tr>
<tr>
<td valign="top" width="171">Count</td>
<td valign="top" width="229">The count is the number in the black circle on the top right of every tile. The count is shown at all tile sizes.</td>
</tr>
<tr>
<td valign="top" width="171">BackgroundImage</td>
<td valign="top" width="229">The background image is the image shown on the background of the front of the tile at medium size</td>
</tr>
<tr>
<td valign="top" width="171">BackBackgroundImage</td>
<td valign="top" width="229">To set the background of the back of the tile use the BackBackgroundImage</td>
</tr>
<tr>
<td valign="top" width="171">BackContent</td>
<td valign="top" width="229">BackContent is the text shown on the back of a tile at medium size</td>
</tr>
<tr>
<td valign="top" width="171">BackTitle</td>
<td valign="top" width="229">Title shown on bottom left of the back of a tile on medium and wide size</td>
</tr>
<tr>
<td valign="top" width="171">SmallBackgroundImage</td>
<td valign="top" width="229">The background of the tile at small size.</td>
</tr>
<tr>
<td valign="top" width="171">WideBackgroundImage</td>
<td valign="top" width="229">The background of the tile ad wide size</td>
</tr>
<tr>
<td valign="top" width="171">WideBackBackgroundImage</td>
<td valign="top" width="229">The background of the back of the tile at wide size</td>
</tr>
<tr>
<td valign="top" width="171">WideBackContent</td>
<td valign="top" width="229">Text shown on the top left of the back of a tile at wide size</td>
</tr>
</tbody>
</table>
<p>The result will look something like this:</p>
<p>Small: (note small tile doesn’t flip)</p>
<p><img style="display: inline; border-width: 0px;" title="small" src="http://vdcruijsen.net/wp-content/uploads/2012/10/small.png" alt="small" width="240" height="158" border="0" /></p>
<p>Medium:</p>
<p><img style="display: inline; border-width: 0px;" title="medium" src="http://vdcruijsen.net/wp-content/uploads/2012/10/medium.png" alt="medium" width="240" height="158" border="0" /> <img style="display: inline; border-width: 0px;" title="medium example back" src="http://vdcruijsen.net/wp-content/uploads/2012/10/mediumexampleback.png" alt="medium example back" width="240" height="158" border="0" /></p>
<p>Wide:</p>
<p><img style="display: inline; border-width: 0px;" title="wide example" src="http://vdcruijsen.net/wp-content/uploads/2012/10/wideexample.png" alt="wide example" width="240" height="158" border="0" />  <img style="display: inline; border-width: 0px;" title="wide example back" src="http://vdcruijsen.net/wp-content/uploads/2012/10/wideexampleback.png" alt="wide example back" width="240" height="158" border="0" /></p>
<p>If you were used to creating live tiles in WP7 there aren’t that much changes as you can see. All that is different are the small and wide sizes of the tile.</p>
<h3>Iconic template</h3>
<p>The iconic template is a new template that is available in Windows Phone 8 and i think this is a really good addition to the Windows Phone SDK. Lots of apps use tiles with a white icon and a transparent background so it looks like the native Windows Phone apps. However lots of people have trouble sizing the icon and the count in the black circle doesn’t look as good as the build in apps like mail or the message hub. To make this easier for everyone Microsoft created the Iconic tile template and it works almost similar to the FlipTile except for we’re using a IconicTileData object instead of the FlipTileData. I think the Iconic tiles will be used a lot on Windows Phone 8.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> IconicButton_Click(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>     ShellTile tile = ShellTile.ActiveTiles.FirstOrDefault();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span>     IconicTileData icontile = <span style="color: #0000ff;">new</span> IconicTileData();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span>     icontile.Title = <span style="color: #006080;">"WP8"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span>     icontile.Count = 12;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span>     icontile.IconImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/202.png"</span>, UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span>     icontile.SmallIconImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/110.png"</span>, UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span>     icontile.WideContent1 = <span style="color: #006080;">"8 days of windows phone 8"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span>     icontile.WideContent2 = <span style="color: #006080;">"day 2"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>     icontile.WideContent3 = <span style="color: #006080;">"Live tiles and lock screen"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span>     ShellTile.Create(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"/MainPage.xaml"</span>,UriKind.Relative), icontile, <span style="color: #0000ff;">true</span>);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;"> 17:</span> }</pre>
</div>
</div>
<p>As you can see creating the tile is done the same way as the as the first tile we created except for using the IconicTileData.</p>
<p>The properties in the IconicTileData are a bit different. one key aspect are the images you can add to the Iconic tiles. They are set to different sizes compared to the other tile templates because they only use part of the tile. In the current beta build i’ve used to create this blogpost the images don’t seem to work that well but my guess this will be finished in the final SDK build.</p>
<p>Another thing that is different is the last line of generating the live tile. The default live tile is made by a FlipTileData object and you can’t update an existing tile to another template so we’re creating a new tile for the Iconic tile.</p>
<p>Small: (seems to be a bug in the 8.0 build of the sdk where the count falls of the edge of the tile. Don’t know if this only happens in the emulator or also on actual devices since i haven’t tested it on a device yet because i don’t have a device.)</p>
<p><img style="display: inline; border-width: 0px;" title="iconsmall" src="http://vdcruijsen.net/wp-content/uploads/2012/10/iconsmall.png" alt="iconsmall" width="240" height="158" border="0" /></p>
<p>Medium:</p>
<p><img style="display: inline; border-width: 0px;" title="iconmedium" src="http://vdcruijsen.net/wp-content/uploads/2012/10/iconmedium.png" alt="iconmedium" width="240" height="158" border="0" /></p>
<p>Wide: (also the rendering of this seems to be a bit off since there should be a margin below the icon that doesn’t seem to be here right now in this build of the SDK)</p>
<p><img style="display: inline; border-width: 0px;" title="iconwide" src="http://vdcruijsen.net/wp-content/uploads/2012/10/iconwide.png" alt="iconwide" width="240" height="158" border="0" /></p>
<p>The wide template also has 3 lines of text you can add to the wide tile. because of this this template is really versatile and probably one of the reasons this template will be used a lot. A complete list of the IconTileData properties is:</p>
<table width="400" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="200">Title</td>
<td valign="top" width="200">Title shown on bottom left of the tile in medium and wide size</td>
</tr>
<tr>
<td valign="top" width="200">Count</td>
<td valign="top" width="200">Count shown on the right of the icon image at all sizes</td>
</tr>
<tr>
<td valign="top" width="200">BackgroundColor</td>
<td valign="top" width="200">Set the background of the tile. if not set it will use the phone accent color</td>
</tr>
<tr>
<td valign="top" width="200">IconImage</td>
<td valign="top" width="200">Image used in the medium tile size</td>
</tr>
<tr>
<td valign="top" width="200">SmallIconImage</td>
<td valign="top" width="200">Image used in the small and wide (bottom right) tile size</td>
</tr>
<tr>
<td valign="top" width="200">WideContent1</td>
<td valign="top" width="200">Line 1 in the largest font on the wide tile size</td>
</tr>
<tr>
<td valign="top" width="200">WideContent2</td>
<td valign="top" width="200">Line 2 of text on the wide tile size</td>
</tr>
<tr>
<td valign="top" width="200">WideContent2</td>
<td valign="top" width="200">Line 3 of text on the wide tile size</td>
</tr>
</tbody>
</table>
<h3>Cycle template</h3>
<p>The Iconic tile adds a lot of new possibilities for the live tiles that developers tried to achieve on Windows Phone 7. One example of Windows Phone 7 tiles that lots of people liked was the photo tile where there is a set of images that get rotated in turns on the tile. On Windows Phone 7 there was no way to recreate this as a developer but now with Windows Phone 8 there is a possibility using the Cycle Template.</p>
<p>Creating a cycle live tile is done the same way as creating the other 2 templates so lets get started and implement the code under the 3rd button in our example app to create a Cycle tile.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> CycleButton_Click(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>     CycleTileData cycleicon = <span style="color: #0000ff;">new</span> CycleTileData();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span>     cycleicon.Title = <span style="color: #006080;">"WP8"</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span>     cycleicon.Count = 5;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span>     cycleicon.SmallBackgroundImage = <span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/159.png"</span>, UriKind.Relative);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span>     List&lt;Uri&gt; images = <span style="color: #0000ff;">new</span> List&lt;Uri&gt;();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span>     images.Add(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/cycle1.png"</span>, UriKind.Relative));</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span>     images.Add(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/cycle2.png"</span>, UriKind.Relative));</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span>     images.Add(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"Assets/cycle3.png"</span>, UriKind.Relative));</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span>     cycleicon.CycleImages = images;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span>     ShellTile.Create(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"/MainPage.xaml?id=cycle"</span>, UriKind.Relative), cycleicon, <span style="color: #0000ff;">true</span>);</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span> }</pre>
</div>
</div>
<p>The Cycle tile uses the CycleTileData object to set it’s properties and this tile has fewer properties compared to the other templates. The title and count are available as on every other template and the other property that is unique for this template is the CycleImages property. It’s an IEnumerable of Uri’s to images (1 size) that will be used on the medium and wide sizes. it will center the image if it is larger as the tile itself is showing only a part of the image. if the tile is set to small it will only show a static image set in the SmallBackgroundImage property.</p>
<p>Small:</p>
<p><img style="display: inline; border-width: 0px;" title="cyclesmall" src="http://vdcruijsen.net/wp-content/uploads/2012/10/cyclesmall.png" alt="cyclesmall" width="240" height="158" border="0" /></p>
<p>Medium:</p>
<p><img style="display: inline; border-width: 0px;" title="cyclemedium" src="http://vdcruijsen.net/wp-content/uploads/2012/10/cyclemedium.png" alt="cyclemedium" width="240" height="158" border="0" /></p>
<p>Large:</p>
<p><img style="display: inline; border-width: 0px;" title="cyclewide" src="http://vdcruijsen.net/wp-content/uploads/2012/10/cyclewide.png" alt="cyclewide" width="240" height="158" border="0" /></p>
<p>The IEnumerable of images used in the medium and wide tiles can contain up to 9 images and will be rotated using a smooth slide animation. The complete list of properties available in the CycleTileData is:</p>
<table width="400" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="200">Title</td>
<td valign="top" width="200">Tile shown on medium and wide tile sizes in the bottom left corner</td>
</tr>
<tr>
<td valign="top" width="200">Count</td>
<td valign="top" width="200">Counter shown on all tile sizes at the top right corner</td>
</tr>
<tr>
<td valign="top" width="200">SmallBackgroundImage</td>
<td valign="top" width="200">Static image shown at the background of the tile at small tile size</td>
</tr>
<tr>
<td valign="top" width="200">CycleImages</td>
<td valign="top" width="200">List of up to 9 images which will be rotated on the tile at medium and wide tile size.</td>
</tr>
</tbody>
</table>
<p>Looking at all the live tile features Microsoft added for Windows Phone 8 i believe it really adds some nice new options to create live tiles. I can’t wait for people to use them in their apps.</p>
<h1>Lock screen</h1>
<p>New in Windows Phone 8 is the possibility to add your own apps to the lock screen of Windows Phone 8. As a developer you can’t force an app to be shown on the lockscreen but you can enable your app for it so users can add your app to their lock screen. You can also change the lock screen image in your app by code.</p>
<h3>lock screen app icon, count and Text</h3>
<p>The image on the lock screen is an image you have to include in your project that uses a transparent background and a white icon.</p>
<p>To set the lock screen image ad an image of 30 * 30 pixels to your solution and open up the WMAppManifest.xml and change the DeviceLockImageURI element to the URL of your lock screen image. Also set the IsRelative attribute to true and IsResource attribute to false. The count and text will be taken of the live tile count property of the current main tile in your app.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">DeviceLockImageURI</span> <span style="color: #ff0000;">IsRelative</span><span style="color: #0000ff;">="true"</span> <span style="color: #ff0000;">IsResource</span><span style="color: #0000ff;">="false"</span><span style="color: #0000ff;">&gt;</span>Assets\LockImage.png<span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">DeviceLockImageURI</span><span style="color: #0000ff;">&gt;</span></pre>
<p>&nbsp;</p>
</div>
</div>
<p>To enable the lock screen image and text you also have to add the following lines of XML to the WMAppManifest.xml below the Tokens element</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Extensions</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Extension</span> <span style="color: #ff0000;">ExtensionName</span><span style="color: #0000ff;">="LockScreen_Notification_IconCount"</span> <span style="color: #ff0000;">ConsumerID</span><span style="color: #0000ff;">="{111DFF24-AA15-4A96-8006-2BFF8122084F}"</span> <span style="color: #ff0000;">TaskID</span><span style="color: #0000ff;">="_default"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Extension</span> <span style="color: #ff0000;">ExtensionName</span><span style="color: #0000ff;">="LockScreen_Notification_TextField"</span> <span style="color: #ff0000;">ConsumerID</span><span style="color: #0000ff;">="{111DFF24-AA15-4A96-8006-2BFF8122084F}"</span> <span style="color: #ff0000;">TaskID</span><span style="color: #0000ff;">="_default"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span> <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Extensions</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
<p>The settings for displaying data on the lock screen is now complete so we can change our settings on our phone to add our app to the lock screen. To do this. open up settings and go to the lock screen settings. On this screen you can select 1 app that can show the text (default is the calendar app) and 5 apps that are allowed to show an icon + counter. Select your app and you’re ready to go.</p>
<p><img style="display: inline; border-width: 0px;" title="settings" src="http://vdcruijsen.net/wp-content/uploads/2012/10/settings.png" alt="settings" width="200" height="333" border="0" /> <img style="display: inline; border-width: 0px;" title="lock screen" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockscreen.png" alt="lock screen" width="200" height="333" border="0" /> <img style="display: inline; border-width: 0px;" title="lock screen app added" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockscreenappadded.png" alt="lock screen app added" width="200" height="333" border="0" /> <img style="display: inline; border-width: 0px;" title="lock screen enabled" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockscreenenabled.png" alt="lock screen enabled" width="200" height="333" border="0" /></p>
<p>As you can see it uses the counter of our main tile (the flip tile example) and the the text is also the same as we’ve set to the BackContent property of the FlipTileData.</p>
<h3>Lock screen Image</h3>
<p>The last thing I’ll show you is how to set the lock screen background image from within your app. Like using the lock screen icon you’ll also need to add an extension to the WMAppManifest.xml to enable setting the lock screen image</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Extensions</span><span style="color: #0000ff;">&gt;</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Extension</span> <span style="color: #ff0000;">ExtensionName</span><span style="color: #0000ff;">="LockScreen_Background"</span> <span style="color: #ff0000;">ConsumerID</span><span style="color: #0000ff;">="{111DFF24-AA15-4A96-8006-2BFF8122084F}"</span> <span style="color: #ff0000;">TaskID</span><span style="color: #0000ff;">="_default"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span> <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Extensions</span><span style="color: #0000ff;">&gt;</span></pre>
</div>
</div>
<p>When you’ve added the extension to the manifest it’s time to start writing the code to change the lock screen image. First you’ll need to check if your app already provided the current lock screen image and if that isn’t the case you need to ask the user’s permission to change the lock screen image. if the user accepts you can change the lock screen image.</p>
<p>I’ve added an image of 768*1280 pixels (largest supported resolution right now) set the image to embedded resource and added the following code to the click event of the 4th button to set the lock screen image when we press the button.</p>
<div id="codeSnippetWrapper" style="overflow: auto; cursor: text; font-size: 8pt; font-family: 'Courier New', courier, monospace; direction: ltr; text-align: left; margin: 20px 0px 10px; line-height: 12pt; max-height: 200px; width: 97.5%; background-color: #f4f4f4; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">private</span> <span style="color: #0000ff;">void</span> LockBackgroundButton_Click(<span style="color: #0000ff;">object</span> sender, RoutedEventArgs e)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>     SetLockScreenImage();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span> }</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span> <span style="color: #0000ff;">private</span> async <span style="color: #0000ff;">void</span> SetLockScreenImage()</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span> {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span>     <span style="color: #008000;">//check if current app provided the lock screen image</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span>     <span style="color: #0000ff;">if</span> (!Windows.Phone.System.UserProfile.LockScreenManager.IsProvidedByCurrentApplication)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span>     {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span>         <span style="color: #008000;">//current image not set by current app ask permission</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span>         var permission = await Windows.Phone.System.UserProfile.LockScreenManager.RequestAccessAsync();</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>         <span style="color: #0000ff;">if</span> (permission == Windows.Phone.System.UserProfile.LockScreenRequestResult.Denied)</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span>         {</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span>             <span style="color: #008000;">//no permission granted so return without setting the lock screen image</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;"> 17:</span>             <span style="color: #0000ff;">return</span>;</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;"> 18:</span>         }</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum19" style="color: #606060;"> 19:</span>     }</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum20" style="color: #606060;"> 20:</span></pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum21" style="color: #606060;"> 21:</span>     Windows.Phone.System.UserProfile.LockScreen.SetImageUri(<span style="color: #0000ff;">new</span> Uri(<span style="color: #006080;">"ms-appx:///Assets/lockscreen.png"</span>, UriKind.Absolute));</pre>
<pre style="overflow: visible; font-size: 8pt; font-family: 'Courier New', courier, monospace; color: black; direction: ltr; text-align: left; margin: 0em; line-height: 12pt; width: 100%; background-color: #f4f4f4; border-style: none; padding: 0px;"><span id="lnum22" style="color: #606060;"> 22:</span> }</pre>
</div>
</div>
<p>As you can see the SetLockScreenImage is using the async keyword because asking the user for permission can only be done by using an async call. therefore we’re using the await keyword there when asking for permission and the app will wait untill the response comes back from the user.</p>
<p>When we run the app now and press the button we’ll see the old lock screen image being replaced by the newly added image</p>
<p><img style="display: inline; border-width: 0px;" title="lock screen before" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockscreenbefore.png" alt="lock screen before" width="200" height="333" border="0" /> <img style="display: inline; border-width: 0px;" title="lock permission" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockpermission.png" alt="lock permission" width="200" height="333" border="0" /></p>
<p>After pressing yes:</p>
<p><img style="display: inline; border-width: 0px;" title="lock screen new" src="http://vdcruijsen.net/wp-content/uploads/2012/10/lockscreennew.png" alt="lock screen new" width="200" height="333" border="0" /></p>
<p>This is all for day 2 of my series of blog posts called “8 days of Windows Phone 8”. Tomorrow we’ll have a look at the emulator and the simulation dashboard which give you a lot of options to test your apps.</p>
<p>Download the sample project here: <a title="http://sdrv.ms/QSJ2yx" href="http://sdrv.ms/QSJ2yx">http://sdrv.ms/QSJ2yx</a></p>
<p>Liked the post or have any feedback? leave a comment below!</p>
<p>Geert van der Cruijsen</li>
</ul>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8+%7C+Day+2%3A+Live+tiles+%26amp%3B+Lock+screen&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-2-live-tiles-lock-screen%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8+%7C+Day+2%3A+Live+tiles+%26amp%3B+Lock+screen&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-2-live-tiles-lock-screen%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8+%7C+Day+2%3A+Live+tiles+%26amp%3B+Lock+screen&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-2-live-tiles-lock-screen%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8-day-2-live-tiles-lock-screen%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>8 days of Windows Phone 8</title>
		<link>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/</link>
		<comments>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/#comments</comments>
		<pubDate>Tue, 30 Oct 2012 19:01:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[8 days]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=260</guid>
		<description><![CDATA[Yesterday Windows Phone 8 was announced at the live broadcasted event in San Francisco and today the SDK was made available to the public on BUILD. To celebrate this I wrote this series of blog posts to inform you on &#8230; <a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday Windows Phone 8 was announced at the live broadcasted event in San Francisco and today the SDK was made available to the public on BUILD. To celebrate this I wrote this series of blog posts to inform you on the new features in the Windows Phone 8 SDK. Inspired by the <a href="http://jeffblankenburg.com/31daysofmango/" target="_blank">31 days of Mango by Jeff Blankenburg</a> when Windows Phone 7.5 Mango was released I thought it was a good idea to create a blog series called “8 days of Windows Phone 8” where I could inform you on using the new features of the just released Windows Phone 8 SDK.
<p><img title="8 days of windows phone 8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="8 days of windows phone 8" src="http://vdcruijsen.net/wp-content/uploads/2012/10/8daysofwindowsphone8.png" width="500" height="202">
<p>This first day I would like to start off with a quick summary of all the features that are added in the new SDK. After that I’ll post a new post for the coming 7 days where we’ll dive deeper in each of these features with code samples and demo’s.
<li><strong>Day 1: SDK Overview </strong>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/" target="_blank">Day 5: .net 4.5 &amp; C# 5.0</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/" target="_blank">Day 6: Speech API</a>&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/" target="_blank">Day 7: Proximity capabilities</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/" target="_blank">Day 8: Wallet and In-App purchases</a>
<p>&nbsp;</p>
<p><img title="day1" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="day1" src="http://vdcruijsen.net/wp-content/uploads/2012/10/day1.png" width="200" height="98"> </p>
<h1>SDK overview</h1>
<p>So what’s new in the SDK? Well the most important change that was already announced before this SDK is the merge with the Windows 8 kernel. Because of this the foundation where Windows Phone 7 was built on was replaced by WinRT. In Windows Phone 8 you’ll have access to a subset of the full Windows 8 WinRT and it’s currently called WinPRT. (Don’t know if that will be the official name). The WinPRT contains a subset of the Windows 8 WinRT APIs and also contains a set of new APIs that are only used for phone specific features.<br />
<h2>Application Platform &amp; .net framework</h2>
<p>It’s now possible to build native applications in C++ and you can also use Direct3D to create 3d graphics on Windows Phone. Javascript and HTML however are not included in the SDK and I don’t know if Microsoft has any plans to add this in the future either.
<p>If you just want to port your Windows Phone 7.5 app to Windows Phone 8 it’s not that much work. A few namespaces have changed so you might have to replace the namespace of these controls. The controls that were moved by Microsoft are the Pivot and the Panorama controls because Microsoft wanted to improve their performance. The LongListSelector is also moved from the Silverlight Toolkit to the SDK itself. Existing Windows Phone 7.5 apps will also run on Windows Phone 8 devices so your existing apps will all keep working on the new devices that will be released.
<p>The new .net framework 4.5 and C# 5.0 language also add new features that are really useful when building apps. Some examples are the new async and await keywords and serialization features for JSON files. More on these new features at day 5.<br />
<h2>Tiles and notifications</h2>
<p>The new home screen of Windows Phone 8 with the 3 sizes of tiles also needs changes to the API to support this of course. It is now possible to set more texts and images on your tiles which will be used in the different size scenarios. A great addition is that you can also add notifications of your tiles to the lockscreen. In Windows Phone 7.5 it was only possible to see updates on your lockscreen for missed calls, text messages or emails but now you can set up to 5 different apps to have notifications on the lockscreen. It’s also possible to add a text notification to the lockscreen like in Windows Phone 7.5 the Agenda did. The user can select 1 application that is allowed to show it’s notifications there in text. The data of the count on the lockscreen and the text notification on the lockscreen are pulled from the data of the main Tile so you only have to set this to use these new features. More information and examples will be posted in tomorrow’s post that is completely dedicated to these features. </p>
<p><img title="wp8" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wp8" src="http://vdcruijsen.net/wp-content/uploads/2012/10/wp8.png" width="444" height="250"> </p>
<h2>Multi-resolution</h2>
<p>Microsoft also announced earlier that there will be multiple resolutions available on the phones. The 3 available resolutions are: 480X800 (WVGA), 768X1280 (WXGA) and 720&#215;1280 (720P). Both WVGA and WXGA are in a 15:9 ratio where 720P is 16:9 Ratio. Every app will always work on each phone. You can make your UI a bit flexible so that for example listboxes will fill the extra screen space that is available on the 16:9 ratio. If you don’t change anything to your existing design the app will still work but will show a bit of empty space below the app. On day 3 we’ll dive deeper in how to build a flexible UI with these new screen resolutions.<br />
<h2>Maps</h2>
<p>Microsoft replaced the old Bing maps by Nokia maps. New features of these maps are that you can use the system launchers to download a piece of map through the MapDownloaderTask and you can also use the MapsDirectionTask to get directions to a location on the map. You can also launch the Maps application by a MapTask Launcher.<br />
<h2>Speech</h2>
<p>Speech and voice commands are one of the coolest things in the SDK in my opinion. With the new features in the SDK you can start your app by saying commands like “Start MyApp, go to ThisPage”. You can also add a list of available commands which people will hear when they hold the Windows button and say “What can i say?”.<br />
<h2>Wallet &amp; In-app Purchases</h2>
<p>The wallet gives Windows Phone users a place where they can collect coupons, credit card and payment info and accounts, Memberships and loyalty cards. By adding a few capabilities in your manifest (So the user knows you’re going to use the wallet) you can extend the wallet with your apps. You can add/ read update or delete wallet items. (you can only change items linked to your app, so it’s not possible to steal someones credit card info for example). This feature will need to prove itself in the future if it is going to be used a lot or not. One other feature I know for sure will be used a lot are in app purchases. This feature finally gives you the possibility to charge your users for features in an app so the business models on making money are being extended by a lot. examples of this are: buying extra levels for a game. buy a month subscription to a newspaper app etc.<br />
<h2>Proximity</h2>
<p>NFC is one of the features in Windows Phone that are highly anticipated by all the users. It’s possibilities are endless and i’m really curious of what developers are going to use it for. All currently announced phones have NFC capabilities so only time will tell. More on this on day 7.<br />
<h2>Data Sense</h2>
<p>Data sense is a new feature in Windows Phone 8 that allows users to keep track of their data plan. The api also allows developers to support their users by adapting data usage in their apps by checking if the user is on a data plan or not. It can also check if the user exceeded his data plan or is near&nbsp; exceeding it and because of that it can disable (or ask the user to disable) certain parts of the app that use a lot of data.</p>
<p>&nbsp;<img title="wp8-2" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="wp8-2" src="http://vdcruijsen.net/wp-content/uploads/2012/10/wp82.jpg" width="398" height="254"> </p>
<h2>Simulation dashboard</h2>
<p>Some scenarios are always hard to test without a real device or even when you have a device simulating scenarios like low bandwidth or poor phone signal are nearly impossible to test even though chances are high actual users will run into these scenarios and they might break your app. Microsoft came with a really cool solution to this for Windows Phone 8 and it’s called the Simulation dashboard that is available in Visual Studio 2012. From the Simulation dashboard you can change the bandwidth or signal quality, throw interruptions like getting a call or a notification popup while your app is playing and you can even make the emulator jump to the lock screen to test if everything keeps working when you apps need to keep running under the lockscreen. At day 4 we’ll dive deeper in the possibilities of the new emulator and the simulation dashboard.</p>
<h2>Globalization</h2>
<p>Globalization and localization support was already quite good in Windows Phone 7.5 but now with Windows Phone 8 available in 180+ countries and 50+ languages Microsoft added support for apps to read from right to left which is common in certain languages. I don’t know if a lot of people are going to use these new globalization features but it is nice to mention it’s available.
<p>That was my quick overview of the SDK. From tomorrow on we’ll dive deeper in the SDK with code samples and more details. What will be discussed in the next blog posts of this series: </p>
<li><strong>Day 1: SDK Overview </strong>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-2-live-tiles-lock-screen/" target="_blank">Day 2: Live tiles and Lock screen</a>
<li><a href="http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8-day-3-emulator-simulation-dashboard/" target="_blank">Day 3: Emulator &amp; Simulation dashboard</a>&nbsp;&nbsp;
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-4-new-screen-resolutions/" target="_blank">Day 4: New screen resolutions</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-5-net-4-5-c-5-0/" target="_blank">Day 5: .net 4.5 &amp; C# 5.0</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-days-6-speech/" target="_blank">Day 6: Speech API</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-7-proximity-capabilities/" target="_blank">Day 7: Proximity capabilities</a>
<li><a href="http://vdcruijsen.net/2012/11/8-days-of-windows-phone-8-day-8-wallet-and-in-app-purchases/" target="_blank">Day 8: Wallet and In-App purchases</a>
<p>&nbsp;</p>
<p>Hopefully you’ll be back tomorrow for the next post in this series!</p>
<p>Geert van der Cruijsen </p>
</p>
</p>
</p>
</li>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=8+days+of+Windows+Phone+8&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=8+days+of+Windows+Phone+8&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=8+days+of+Windows+Phone+8&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2F8-days-of-windows-phone-8%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/10/8-days-of-windows-phone-8/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>I&#8217;ll be speaking on Windows 8 and Windows Phone 8 in November</title>
		<link>http://vdcruijsen.net/2012/10/ill-be-speaking-on-windows-8-and-windows-phone-8-in-november/</link>
		<comments>http://vdcruijsen.net/2012/10/ill-be-speaking-on-windows-8-and-windows-phone-8-in-november/#comments</comments>
		<pubDate>Sat, 27 Oct 2012 13:53:45 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Phone 8]]></category>
		<category><![CDATA[Avanade]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=253</guid>
		<description><![CDATA[November is going to be a big month for everyone who likes developing for Windows. 2 days ago Windows 8 was officially launched and this Monday Windows Phone 8 will be launched. Lots of events are organized and in November &#8230; <a href="http://vdcruijsen.net/2012/10/ill-be-speaking-on-windows-8-and-windows-phone-8-in-november/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>November is going to be a big month for everyone who likes developing for Windows. 2 days ago Windows 8 was officially launched and this Monday Windows Phone 8 will be launched.</p>
<p>Lots of events are organized and in November I’m speaking on two of them. First is a Dutch event called “<a href="http://bedrijfzoektapp.nl/">Bedrijf zoekt app</a>” held on the 13th in Bussum. In this session we’ll dive into the possibilities of building apps for Windows 8 without focusing on the development techniques themselves but we’ll be looking more into why companies should develop for Windows 8 and what are the possibilities when you’re going to develop apps for Windows 8.</p>
<p>More info on the “Bedrijf zoekt app” event <a href="http://bedrijfzoektapp.nl/">here</a>.</p>
<p><img title="bedrijf zoekt app - logo-vierkant" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="bedrijf zoekt app - logo-vierkant" src="http://vdcruijsen.net/wp-content/uploads/2012/10/bedrijfzoektapplogovierkant.jpg" width="145" height="138"> </p>
<p>2 days later on November 15th I&#8217;ll be doing a session on Windows Phone 8 on the Avanade “Masters in Microsoft” event held for software engineering students. This event is FREE and includes food before we start the sessions (should be enough reason for every student to sign up <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ). This evening I&#8217;ll be talking on all the new features of Windows Phone 8 and showing code demo’s on how to use these new features. </p>
<p>More info on how to sign up for this free event <a href="http://pro.delivermymailing.com/t/ViewEmail/r/7AC394E16EE1D5EA/FC1C0E32C980735ECE63909E3969C05F">here (Masters in Microsoft Event)</a></p>
<p><img title="avalogo" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="avalogo" src="http://vdcruijsen.net/wp-content/uploads/2012/10/avalogo.png" width="240" height="65"> </p>
<p>Hope to see you there!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=I%26rsquo%3Bll+be+speaking+on+Windows+8+and+Windows+Phone+8+in+November&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2Fill-be-speaking-on-windows-8-and-windows-phone-8-in-november%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=I%26rsquo%3Bll+be+speaking+on+Windows+8+and+Windows+Phone+8+in+November&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2Fill-be-speaking-on-windows-8-and-windows-phone-8-in-november%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=I%26rsquo%3Bll+be+speaking+on+Windows+8+and+Windows+Phone+8+in+November&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2Fill-be-speaking-on-windows-8-and-windows-phone-8-in-november%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F10%2Fill-be-speaking-on-windows-8-and-windows-phone-8-in-november%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/10/ill-be-speaking-on-windows-8-and-windows-phone-8-in-november/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving Windows 8 enterprise activation error 0&#215;80070005</title>
		<link>http://vdcruijsen.net/2012/09/solving-windows-8-enterprise-activation-error-0x80070005/</link>
		<comments>http://vdcruijsen.net/2012/09/solving-windows-8-enterprise-activation-error-0x80070005/#comments</comments>
		<pubDate>Sat, 01 Sep 2012 13:36:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=265</guid>
		<description><![CDATA[So Windows 8 RTM launched yesterday and lots of people installed their copy from MSDN. I did the same but after the installation i couldn’t get my copy to activate. I kept receiving an error 0&#215;80070005 when i wanted to &#8230; <a href="http://vdcruijsen.net/2012/09/solving-windows-8-enterprise-activation-error-0x80070005/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So Windows 8 RTM launched yesterday and lots of people installed their copy from MSDN. I did the same but after the installation i couldn’t get my copy to activate. I kept receiving an error 0&#215;80070005 when i wanted to activate my windows copy.</p>
<p>The problem is that you didn’t have to fill in your key during the installation and now Windows 8 is trying to activate with a default key which is failing.</p>
<p>You can fix this in a few easy steps:</p>
<ul>
<li>Press the “Windows” key on your keyboard or go back to the “Metro” start screen
<li>type “slui 3” and press enter
<li>a popup shows up where you can enter your new key. enter this key and press activate
<li>Your copy of windows 8 is now activated</li>
</ul>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/10/image.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; float: none; margin-left: auto; display: block; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="http://vdcruijsen.net/wp-content/uploads/2012/10/image_thumb.png" width="526" height="369"></a></p>
<p>Enjoy windows 8!</p>
<p>Geert van der Cruijsen </p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Solving+Windows+8+enterprise+activation+error+0x80070005&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F09%2Fsolving-windows-8-enterprise-activation-error-0x80070005%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Solving+Windows+8+enterprise+activation+error+0x80070005&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F09%2Fsolving-windows-8-enterprise-activation-error-0x80070005%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Solving+Windows+8+enterprise+activation+error+0x80070005&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F09%2Fsolving-windows-8-enterprise-activation-error-0x80070005%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F09%2Fsolving-windows-8-enterprise-activation-error-0x80070005%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/09/solving-windows-8-enterprise-activation-error-0x80070005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving Windows 8 enterprise activation error &quot;DNS name does not exist&quot; 0x8007232B</title>
		<link>http://vdcruijsen.net/2012/08/solving-windows-8-enterprise-activation-error-0x8007232b/</link>
		<comments>http://vdcruijsen.net/2012/08/solving-windows-8-enterprise-activation-error-0x8007232b/#comments</comments>
		<pubDate>Thu, 16 Aug 2012 06:43:13 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=238</guid>
		<description><![CDATA[So Windows 8 RTM launched yesterday and lots of people installed their copy from MSDN. I did the same but after the installation i couldn’t get my copy to activate. I kept receiving an error &#8220;DNS name does not exist &#8230; <a href="http://vdcruijsen.net/2012/08/solving-windows-8-enterprise-activation-error-0x8007232b/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So Windows 8 RTM launched yesterday and lots of people installed their copy from MSDN. I did the same but after the installation i couldn’t get my copy to activate. I kept receiving an error &#8220;DNS name does not exist &#8221; 0x8007232B when i wanted to activate my windows copy.</p>
<p><img title="windows 8 activation error 0x8007232b" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="windows 8 activation error 0x8007232b" src="http://vdcruijsen.net/wp-content/uploads/2012/08/windows8activationerror0x8007232b.png" width="420" height="293"> </p>
<p>The problem is that you didn’t have to fill in your key during the installation and now Windows 8 is trying to activate with a default key which is failing.</p>
<p>You can fix this in a few easy steps:</p>
<ul>
<li>Press the “Windows” key on your keyboard or go back to the “Metro” start screen
<li>type “slui 3” and press enter
<li>a popup shows up where you can enter your new key. enter this key and press activate
<li>Your copy of windows 8 is now activated </li>
</ul>
<p><img title="image" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; float: none; margin-left: auto; display: block; border-top-width: 0px; margin-right: auto" border="0" alt="image" src="http://vdcruijsen.net/wp-content/uploads/2012/08/image_thumb.png" width="526" height="369"></p>
<p>Enjoy windows 8!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Solving+Windows+8+enterprise+activation+error+%26quot%3BDNS+name+does+not+exist%26quot%3B+0x8007232B&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F08%2Fsolving-windows-8-enterprise-activation-error-0x8007232b%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Solving+Windows+8+enterprise+activation+error+%26quot%3BDNS+name+does+not+exist%26quot%3B+0x8007232B&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F08%2Fsolving-windows-8-enterprise-activation-error-0x8007232b%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Solving+Windows+8+enterprise+activation+error+%26quot%3BDNS+name+does+not+exist%26quot%3B+0x8007232B&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F08%2Fsolving-windows-8-enterprise-activation-error-0x8007232b%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F08%2Fsolving-windows-8-enterprise-activation-error-0x8007232b%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/08/solving-windows-8-enterprise-activation-error-0x8007232b/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Introducing: PhoneCompare for Windows Phone 7</title>
		<link>http://vdcruijsen.net/2012/04/introducing-phonecompare-for-windows-phone-7/</link>
		<comments>http://vdcruijsen.net/2012/04/introducing-phonecompare-for-windows-phone-7/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 18:45:32 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[PhoneCompare]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=234</guid>
		<description><![CDATA[I’ve built a new Windows Phone App that lets you compare 2 Windows Phone devices with all available specs right next to each other to see which is the best. You can also just check the specifications of one of &#8230; <a href="http://vdcruijsen.net/2012/04/introducing-phonecompare-for-windows-phone-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’ve built a new Windows Phone App that lets you compare 2 Windows Phone devices with all available specs right next to each other to see which is the best. You can also just check the specifications of one of the available windows phones at this moment when you are in a heated argument with friends or colleagues again where you are not sure if that phone had a 1.4GHZ processor or a 1.5 GHZ processor.</p>
<p>My new app is called PhoneCompare and is available in all Windows Phone Marketplaces for 99 cents. you can also install a free trial that has 100% of the functionality but shows ads.</p>
<p><img src="http://vdcruijsen.net/phonecompare/images/screenshots/phonecomparepano.png" /></p>
<p>PhoneCompare has the following features:</p>
<ul>
<li>List all available Windows Phones </li>
<li>Check specifications for a single phone to see its screen size, dimensions, weight, processor, storage, memory, battery and camera. </li>
<li>Select 2 phones to compare all these specs next to each other </li>
<li>Check the specs of your current phone </li>
<li>Browse phones by brand </li>
<li>View a list of new phones that are just released or are about to get released </li>
</ul>
<p><a href="http://windowsphone.com/s?appid=b9cd55b4-3cb2-4136-b1bc-ab248a56e43d"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/download.png" /></a></p>
<p>My plans for the future are to also make it possible to rate phones so you can see which phones are rated the highest and I also want to store most used phones by visitors of the app. All this in version 1.1 <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/screenshots/1.png" width="190" height="316" />&#160;<img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/screenshots/2.png" width="190" height="316" />&#160;<img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/screenshots/3.png" width="190" height="316" /></p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/screenshots/4.png" width="190" height="316" />&#160;<img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; border-top: 0px; border-right: 0px; padding-top: 0px" border="0" src="http://vdcruijsen.net/phonecompare/images/screenshots/5.png" width="190" height="316" />&#160;<img src="http://vdcruijsen.net/phonecompare/images/screenshots/6.png" width="190" height="316" /></p>
<p><img src="http://vdcruijsen.net/phonecompare/images/screenshots/7.png" width="190" height="316" />&#160;<img src="http://vdcruijsen.net/phonecompare/images/screenshots/8.png" width="190" height="316" /></p>
<p>If you have any feedback on this app please let me know by a comment on this post, by sending me a tweet <a href="http://twitter.com/geertvdc">@geertvdc</a> or by rating or using the in app mail function</p>
<p>Enjoy!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Introducing%3A+PhoneCompare+for+Windows+Phone+7&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fintroducing-phonecompare-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Introducing%3A+PhoneCompare+for+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fintroducing-phonecompare-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Introducing%3A+PhoneCompare+for+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fintroducing-phonecompare-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fintroducing-phonecompare-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/04/introducing-phonecompare-for-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Windows Phone developer introduction sessions at UTwente &amp; TU/E</title>
		<link>http://vdcruijsen.net/2012/04/windows-phone-developer-introduction-sessions-at-utwente-tue/</link>
		<comments>http://vdcruijsen.net/2012/04/windows-phone-developer-introduction-sessions-at-utwente-tue/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 07:21:03 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=231</guid>
		<description><![CDATA[Last week I visited Twente University and today I went to the University of Eindhoven to do a session on building your first Windows Phone App. This post is mainly created for visitors of those sessions so they can download &#8230; <a href="http://vdcruijsen.net/2012/04/windows-phone-developer-introduction-sessions-at-utwente-tue/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Last week I visited Twente University and today I went to the University of Eindhoven to do a session on building your first Windows Phone App. This post is mainly created for visitors of those sessions so they can download the slide deck and sample code we’ve created during the session.</p>
<p><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="imaginecup" border="0" alt="imaginecup" src="http://vdcruijsen.net/wp-content/uploads/2012/04/imaginecup.jpg" width="216" height="80" />&#160; <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="utwente" border="0" alt="utwente" src="http://vdcruijsen.net/wp-content/uploads/2012/04/utwente.jpg" width="183" height="80" />&#160; <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="tue" border="0" alt="tue" src="http://vdcruijsen.net/wp-content/uploads/2012/04/tue.png" width="139" height="80" /></p>
<p>My sample code and powerpoint deck including lots of resources to start developing for windows phone can be found here:</p>
<p><a title="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1485&amp;parid=EF12210979E9F6B0!1463" href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1485&amp;parid=EF12210979E9F6B0!1463">https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1485&amp;parid=EF12210979E9F6B0!1463</a></p>
<p>During the session we created a twitter app that downloads the data from an xml feed asynchronous and placing this list of twitter items in a listbox. After that we created some sample data and created a template for the listbox so the twitter list looks nice.</p>
<p>Hopefully these sessions made you join the Windows Phone community and I expect to see your apps in the marketplace soon <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you have any questions regarding Windows Phone development please send me an email or contact me on twitter <a href="http://twitter.com/GeertvdC">@geertvdc</a></p>
<p>Happy Coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Windows+Phone+developer+introduction+sessions+at+UTwente+%26amp%3B+TU%2FE&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fwindows-phone-developer-introduction-sessions-at-utwente-tue%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Windows+Phone+developer+introduction+sessions+at+UTwente+%26amp%3B+TU%2FE&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fwindows-phone-developer-introduction-sessions-at-utwente-tue%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Windows+Phone+developer+introduction+sessions+at+UTwente+%26amp%3B+TU%2FE&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fwindows-phone-developer-introduction-sessions-at-utwente-tue%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F04%2Fwindows-phone-developer-introduction-sessions-at-utwente-tue%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/04/windows-phone-developer-introduction-sessions-at-utwente-tue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the complementary color of the phone accent color in your WP7 app</title>
		<link>http://vdcruijsen.net/2012/03/using-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app/</link>
		<comments>http://vdcruijsen.net/2012/03/using-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app/#comments</comments>
		<pubDate>Mon, 26 Mar 2012 06:43:48 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=226</guid>
		<description><![CDATA[I’m building a Windows Phone app where I want to compare 2 objects to each other visually by showing graphs on how good each of the objects is performing. because I like to use the accent color in my apps &#8230; <a href="http://vdcruijsen.net/2012/03/using-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’m building a Windows Phone app where I want to compare 2 objects to each other visually by showing graphs on how good each of the objects is performing. because I like to use the accent color in my apps I was thinking of what would be a good second color for the other graph. Since I’m not a designer I did some research on colors and found out that every color has a complementary color that is exactly the opposite color of your primary color. (Probably some basic design knowledge I didn’t know that.</p>
<p>Calculating this color is done by simple math. Your primary color + the complementary color should add up to hex value FFFFFF (white) so if you just remove the R G and B values of your color from the max value 255 you’ll end up with your complementary color.</p>
<p>So how to do this in your windows phone project? Let me first show you the results and after that I’ll explain how I created a resource you can use in blend to bind to your complementary color. Below are screenshots of a sample app (download at the end of this post) that displays the phone accent color and its complementary color. I’ve taken screenshots of every color so you can see what the results look like. The first rectangle shows the phone accent color while the second shows it’s complementary color.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary1" border="0" alt="complementary1" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary1.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary2" border="0" alt="complementary2" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary2.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary3" border="0" alt="complementary3" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary3.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary4" border="0" alt="complementary4" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary4.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary5" border="0" alt="complementary5" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary5.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary6" border="0" alt="complementary6" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary6.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary7" border="0" alt="complementary7" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary7.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary8" border="0" alt="complementary8" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary8.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary9" border="0" alt="complementary9" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary9.png" width="126" height="240" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary10" border="0" alt="complementary10" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary10.png" width="126" height="240" /></p>
<p>So let’s see how to use this color in code. I’ve created a class calles “Resources” and I’ve added 2 public static properties in it. 1 called ComplementaryColor and 1 called ComplementaryColorBrush. You’ll use the Brush property mostly when binding but if you would like to have the color it’s also available.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Resources</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> Color _complementaryColor = <span style="color: #0000ff">new</span> Color()</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>         R = (<span style="color: #0000ff">byte</span>)(255 - ((Color)Application.Current.Resources[<span style="color: #006080">&quot;PhoneAccentColor&quot;</span>]).R),</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         G = (<span style="color: #0000ff">byte</span>)(255 - ((Color)Application.Current.Resources[<span style="color: #006080">&quot;PhoneAccentColor&quot;</span>]).G),</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         B = (<span style="color: #0000ff">byte</span>)(255 - ((Color)Application.Current.Resources[<span style="color: #006080">&quot;PhoneAccentColor&quot;</span>]).B),</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         A = ((Color)Application.Current.Resources[<span style="color: #006080">&quot;PhoneAccentColor&quot;</span>]).A</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>     };</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>     <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> Brush _complementaryColorBrush = <span style="color: #0000ff">new</span> SolidColorBrush(_complementaryColor);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> Color ComplementaryColor</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>         get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>             <span style="color: #0000ff">return</span> _complementaryColor;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> Brush ComplementaryColorBrush</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>         get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>             <span style="color: #0000ff">return</span> _complementaryColorBrush;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>The calculations of the complementary color is done by subtracting the R G and B values from the&#160; max of 255 and they are stored in a new Color property. this color is then used in our ComplementaryColorBrush.</p>
<p>To use these properties in blend we’ll just add this class as a resource in the App.xaml file:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Application.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">resources:Resources</span> <span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;Resources&quot;</span> <span style="color: #ff0000">d:IsDataSource</span><span style="color: #0000ff">=&quot;True&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ResourceDictionary</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Application.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>When we build our project and open up Expression blend we can now use this color by selecting the rectangle and going into the databinding menu for the fill property and then selecting the ComplementaryColorBrush.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://vdcruijsen.net/wp-content/uploads/2012/03/image.png" width="427" height="400" /></p>
<p>There you go. when you run your project now you’ll see the complementary color of your selected phone accent color</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary91.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="complementary9" border="0" alt="complementary9" src="http://vdcruijsen.net/wp-content/uploads/2012/03/complementary9_thumb.png" width="229" height="436" /></a></p>
<p>You can download my sample application incudling source from my skydrive <a href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1484&amp;parid=EF12210979E9F6B0!1483">here</a></p>
<p>Happy Coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Using+the+complementary+color+of+the+phone+accent+color+in+your+WP7+app&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fusing-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Using+the+complementary+color+of+the+phone+accent+color+in+your+WP7+app&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fusing-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Using+the+complementary+color+of+the+phone+accent+color+in+your+WP7+app&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fusing-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fusing-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/03/using-the-complementary-color-of-the-phone-accent-color-in-your-wp7-app/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Build your first Windows Phone app sample code and powerpoint deck from my session @ Windesheim Zwolle</title>
		<link>http://vdcruijsen.net/2012/03/build-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle/</link>
		<comments>http://vdcruijsen.net/2012/03/build-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle/#comments</comments>
		<pubDate>Tue, 06 Mar 2012 19:59:16 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=211</guid>
		<description><![CDATA[Yesterday I did a hands on Windows Phone development session to show students of the Windesheim in Zwolle how to build their first application. If you were at yesterdays session I hope you got inspired to start making Windows Phone &#8230; <a href="http://vdcruijsen.net/2012/03/build-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I did a hands on Windows Phone development session to show students of the Windesheim in Zwolle how to build their first application.</p>
<p>If you were at yesterdays session I hope you got inspired to start making Windows Phone apps and hope to see your apps in the Imagine Cup this year.</p>
<p><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="imaginecup" border="0" alt="imaginecup" src="http://vdcruijsen.net/wp-content/uploads/2012/03/imaginecup.jpg" width="243" height="90" />&#160;<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="windesheim" border="0" alt="windesheim" src="http://vdcruijsen.net/wp-content/uploads/2012/03/windesheim.png" width="136" height="90" /></p>
<p><a title="https://www.imaginecup.com/" href="https://www.imaginecup.com/">https://www.imaginecup.com/</a></p>
<p>The app we’ve build during the class was a simple twitter app that downloads json data asynchronous and parses the json objects to c# objects. We then bind a list of these TwitterItems to a listbox on the MainPage.xaml and create a ItemTemplate for the listbox items by using Expression Blend Sample data created from the&#160; TwitterItem object.</p>
<p>The visual studio project and powerpoint deck can be downloaded here on my skydrive:</p>
<p><a title="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1480&amp;parid=EF12210979E9F6B0!1463" href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1480&amp;parid=EF12210979E9F6B0!1463">https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1480&amp;parid=EF12210979E9F6B0!1463</a></p>
<p>The sample project contains a few extra steps that I didn’t have time for during the session itself but it shows how to post a message to a social network by using the ShareStatusTask and it also contains basic navigation.</p>
<p>During the session I also showed the use of a open source tool to generate classes from json. you can download this tool from codeplex here:</p>
<p><a title="http://jsonclassgenerator.codeplex.com/" href="http://jsonclassgenerator.codeplex.com/">http://jsonclassgenerator.codeplex.com/</a></p>
<p>to use these classes you’ll need a dll compiled for windows phone. you can get that one here on codeplex:</p>
<p><a title="http://json.codeplex.com/" href="http://json.codeplex.com/">http://json.codeplex.com/</a></p>
<p>If you have any question about the sample code or Windows Phone in general contact my by mail or send me a tweet at <a href="http://twitter.com/geertvdc">@geertvdc</a></p>
<p>Happy Coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Build+your+first+Windows+Phone+app+sample+code+and+powerpoint+deck+from+my+session+%40+Windesheim+Zwolle&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fbuild-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Build+your+first+Windows+Phone+app+sample+code+and+powerpoint+deck+from+my+session+%40+Windesheim+Zwolle&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fbuild-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Build+your+first+Windows+Phone+app+sample+code+and+powerpoint+deck+from+my+session+%40+Windesheim+Zwolle&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fbuild-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F03%2Fbuild-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/03/build-your-first-windows-phone-app-sample-code-and-powerpoint-deck-from-my-session-windesheim-zwolle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Demo code and ppt deck from my Techdays talk on WP7 Push notifications, Live tiles and background agents available</title>
		<link>http://vdcruijsen.net/2012/02/demo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available/</link>
		<comments>http://vdcruijsen.net/2012/02/demo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 15:39:40 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[dotnetmag]]></category>
		<category><![CDATA[Techdays]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=205</guid>
		<description><![CDATA[It’s they day after the Techdays 2012 in the Netherlands and everyone is fully inspired by all the new knowledge they acquired at the event. I got questions from people asking for the powerpoint deck and my demo code so &#8230; <a href="http://vdcruijsen.net/2012/02/demo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It’s they day after the Techdays 2012 in the Netherlands and everyone is fully inspired by all the new knowledge they acquired at the event. I got questions from people asking for the powerpoint deck and my demo code so I told them I would upload it here. I had 2 sessions on the Techdays and both were on Windows Phone push notifications and live tiles. The session on the Geeknight was an introduction level session and in the session on Friday I showed all the details on how to use them with lots of code.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="techdays_logo_2" border="0" alt="techdays_logo_2" src="http://vdcruijsen.net/wp-content/uploads/2012/02/techdays_logo_21.jpg" width="171" height="240" /></p>
<p>The PowerPoint deck from my geeknight session on push notifications and livetiles&#160; is available here: <a title="https://skydrive.live.com/#!/view.aspx?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211464" href="https://skydrive.live.com/#!/view.aspx?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211464">Download or View PPT</a></p>
<p>The PowerPoint deck from the level 300 Push notifications, live tiles and background agents session is available here: <a title="https://skydrive.live.com/#!/view.aspx?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211465" href="https://skydrive.live.com/#!/view.aspx?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211465">Download or View PPT</a></p>
<p>In both sessions I used the same demo project that can be downloaded here: <a href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1467&amp;parid=EF12210979E9F6B0!1463">Download ZIP file</a></p>
<p><strike>My session that was held on Friday was also filmed for Channel 9. I’ll add a link to the video when it’s uploaded there.</strike></p>
<p>Update: the session is now available on Channel 9. you can watch it here:</p>
<p> <iframe style="width: 600px; height: 304px" src="http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/Push-notifications-live-tiles-and-background-agents-for-Windows-Phone-7/player?w=600&amp;h=304" frameborder="0" scrolling="no"></iframe>
<p><a title="http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/Push-notifications-live-tiles-and-background-agents-for-Windows-Phone-7" href="http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/Push-notifications-live-tiles-and-background-agents-for-Windows-Phone-7">http://channel9.msdn.com/Events/TechDays/Techdays-2012-the-Netherlands/Push-notifications-live-tiles-and-background-agents-for-Windows-Phone-7</a></p>
<p>If you have any questions on implementing push notifications, live tiles or background agents send me a tweet on <a href="http://twitter.com/geertvdc">@geertvdc</a> or comment on this post.</p>
<p>Happy Coding</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Demo+code+and+ppt+deck+from+my+Techdays+talk+on+WP7+Push+notifications%2C+Live+tiles+and+background+agents+available&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Fdemo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Demo+code+and+ppt+deck+from+my+Techdays+talk+on+WP7+Push+notifications%2C+Live+tiles+and+background+agents+available&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Fdemo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Demo+code+and+ppt+deck+from+my+Techdays+talk+on+WP7+Push+notifications%2C+Live+tiles+and+background+agents+available&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Fdemo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Fdemo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/02/demo-code-and-ppt-deck-from-my-techdays-talk-on-wp7-push-notifications-live-tiles-and-background-agents-available/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>TechdaysNL 2012 Lots of WP7, Win8, Metro and ASP.NET MVC sessions. Which sessions to pick?</title>
		<link>http://vdcruijsen.net/2012/02/techdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick/</link>
		<comments>http://vdcruijsen.net/2012/02/techdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 21:57:41 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Metro]]></category>
		<category><![CDATA[Techdays]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=198</guid>
		<description><![CDATA[This thursday Microsoft Techdays 2012 kicks off for Dutch developers working on the Microsoft platform. This year I’m speaking at 2 sessions on Windows Phone but I’m also going to visit other sessions during the 2 days of the conventions. &#8230; <a href="http://vdcruijsen.net/2012/02/techdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This thursday Microsoft Techdays 2012 kicks off for Dutch developers working on the Microsoft platform. This year I’m speaking at 2 sessions on Windows Phone but I’m also going to visit other sessions during the 2 days of the conventions. Here is the schedule I made with sessions I’m planning on going to. It seems there are some really cool Windows Phone sessions but Windows 8 and ASP.NET MVC also has my interests. During the event I’ll keep you posted with updates on twitter and afterwards I’ll write my experiences in a new blogpost again. Here are the sessions I’m going to visit.</p>
<p><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="badge_speaking" border="0" alt="badge_speaking" src="http://vdcruijsen.net/wp-content/uploads/2012/02/badge_speaking.png" width="240" height="155" /></p>
<h2>Thursday February 16th</h2>
<h2>09:15 &#8211; 10:45 – Keynote</h2>
<p>Ofcourse I’m going to visit the keynote session that kicks off the event. This year the keynote is presented by 5 speakers: <a href="http://techdays.nl/SprekerDetail.aspx?cid=1989">Ben Riga</a>, <a href="http://techdays.nl/SprekerDetail.aspx?cid=2248">Brian Keller </a>, <a href="http://techdays.nl/SprekerDetail.aspx?cid=2326">Serge van Schie</a>, <a href="http://techdays.nl/SprekerDetail.aspx?cid=2327">Theo Rinsema</a>, <a href="http://techdays.nl/SprekerDetail.aspx?cid=2510">Bryan Agnetta</a></p>
<h2>11:05 &#8211; 12:20 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2261">What&#8217;s new in ASP.NET 4.5 + Visual Studio 11</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2244">Mads Kristensen</a></strong></h2>
<p>I haven’t seen that much of asp.net 4.5 since my focus lately was on Windows Phone and Windows 8 development so I’m really curious on what Mads is going to show us here.</p>
<h2></h2>
<h2>13:30 &#8211; 14:45 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2256">Deep Dive into Metro</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2510">Bryan Agnetta</a></strong></h2>
<p>Since I already am quite up to date with Windows Phone Localization I’m skipping Ben Riga’s session on that subject (which is really important to know if you’re developing WP7 apps!) and going to widen my horizon to become a better “DeVigner” by improving my design skills in the session of Bryan Agnetta.</p>
<h2>15:05 &#8211; 16:20 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2364">A look at ASP.NET MVC 4</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2356">Scott Guthrie </a></strong></h2>
<p>When “the Gu” is speaking on an event it’s not an option not to visit at least 1 of his sessions. I’m a big fan of ASP.NET MVC since the first technical preview but haven’t seen that much of the 4th version except for some videos from BUILD. Really looking forward on hearing what Scott has to say on this subject.</p>
<h2></h2>
<h2>16:30 &#8211; 17:45 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2371">Scott Guthrie Unplugged</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2356">Scott Guthrie </a></strong></h2>
<p>Really looking forward on this session. Scott is a reall “Gu”ru and I’m really curios on seeing him answer questions from the audience. I have some questions for him on his vision on the future of mobile and the web. Let’s see if he can answer it <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Another session that I would like to visit but is at the same time is: <a href="http://techdays.nl/AgendaDetail.aspx?cid=2262">Fully leverage the Microsoft application platform with BizTalk, Server AppFabric and Azure AppFabric</a>. Ah well I’ll watch that one on channel 9 later then.</p>
<h2>&#160;</h2>
<h2>GeekNight</h2>
<h2>19:15 &#8211; 19:55 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2421">Beginnen met ontwikkelen voor Windows Phone</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2255">Maarten Struys</a></strong></h2>
<p>This session is in the same room as my session that held is right after this session. Ok I’m not a starting wp7 developer but It’s good to see this session so I can adapt my session to this one if a lot of people are staying after this session for my session.</p>
<h2>20:05 &#8211; 20:45 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2422">Push notifications en live tiles</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2409">Geert van de Cruijsen</a></strong></h2>
<p>Time to do my own session. In this session I’ll give an introduction to push notifications and live tiles in your Windows Phone applications. If you are a starting wp7 developer this is the session for you. If you are a more advanced wp7 developer come to my session on friday on the Techdays on the same subject.</p>
<h2>20:55 &#8211; 21:35 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2446">Stand Up Windows Phone Development</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2238">Fons Sonnemans</a></strong></h2>
<p>After my session Fons Sonnemans is doing the next session in the WP7 track. He’s going to build an application in 1 hour. Let’s see what he’s up to.</p>
<p>&#160;</p>
<h2>Friday February 17th</h2>
<h2>09:15 &#8211; 10:30 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2302">Going mobile with ASP.NET MVC 4</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2233">Erik van Appeldoorn</a></strong></h2>
<p>The debate on building native phone applications vs mobile web is an ongoing discussion. Let’s see what Erik can do using ASP.NET MVC4 for the mobile platform. Another session that got my attention is a session from my collegue Jesse Houwing: <a href="http://techdays.nl/AgendaDetail.aspx?cid=2523">Code review features in TFS vNext</a> so there is a chance I’m visiting that one instead.</p>
<h2>10:50 &#8211; 12:05 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2282">Building Services for Phone / Tablet using WebAPI</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2229">Matt Milner</a></strong></h2>
<p>This session can be really usefull if you are planning on doing push notifications for a mobile app for example or if you just want to create an app using your own created API for your website. WebAPI is a really nice new framework by Microsoft which I don’t know that much about right now. hopefully this session will give me some good info on that.</p>
<h2>13:15 &#8211; 14:30 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2524">Laat je Windows Phone 7 app tot leven komen met push notifications, live tiles en background agents</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2409">Geert van de Cruijsen</a></strong></h2>
<p>It’s time again to do a presentation myself. This session will explain all the ins and outs of push notifications, live tiles and background agents in your wp7 applications. If you don’t like Windows Phone visit my colleague Christiaan Veeningen’s session: <a href="http://techdays.nl/AgendaDetail.aspx?cid=2480">Bouw Metro apps met Javascript voor Windows 8</a>. In our original planning I was going to do this presentation together with him but doing 3 sessions was a bit to much for me to prepare for.</p>
<h2>14:50 &#8211; 16:05 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2289">Windows Phone Metro Design Session End-to-End</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2511">Tom Eddings</a>, <a href="http://techdays.nl/SprekerDetail.aspx?cid=2512">Dave Crawford</a></strong></h2>
<p>Another UX session I’m going to visit. My last project building Windows Phone applications where I worked together with Avanade UX colleagues really got me interested in the design parts so I’m exited on what Tom and Dave are going to tell us.</p>
<h2>16:15 &#8211; 17:30 – <strong><a href="http://techdays.nl/AgendaDetail.aspx?cid=2308">Unit testing your Windows Phone 7 applications</a> &#8211; <a href="http://techdays.nl/SprekerDetail.aspx?cid=2138">Olaf Conijn</a></strong></h2>
<p>Picking a level 400 session as the last session on a Friday a smart choice? We’ll see. I already have experience in unit testing wp7 applications but I’m sure Olaf has some really nice tips for us.</p>
<p>So this is my list of sessions I’m visiting at the TechDays. Please let me know which ones you are visiting in the comments</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=TechdaysNL+2012+Lots+of+WP7%2C+Win8%2C+Metro+and+ASP.NET+MVC+sessions.+Which+sessions+to+pick%3F&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Ftechdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=TechdaysNL+2012+Lots+of+WP7%2C+Win8%2C+Metro+and+ASP.NET+MVC+sessions.+Which+sessions+to+pick%3F&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Ftechdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=TechdaysNL+2012+Lots+of+WP7%2C+Win8%2C+Metro+and+ASP.NET+MVC+sessions.+Which+sessions+to+pick%3F&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Ftechdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F02%2Ftechdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/02/techdaysnl-2012-lots-of-wp7-win8-metro-and-asp-net-mvc-sessions-which-sessions-to-pick/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 emulator skin switcher 1.2 released on Codeplex</title>
		<link>http://vdcruijsen.net/2012/01/windows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex/</link>
		<comments>http://vdcruijsen.net/2012/01/windows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 09:45:23 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=192</guid>
		<description><![CDATA[Version 1.0 and 1.1 of my Windows Phone 7 emulator skin switcher were hosted on my SkyDrive but I got several requests from people to move it to Codeplex so I did that this afternoon. From now on the latest &#8230; <a href="http://vdcruijsen.net/2012/01/windows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Version 1.0 and 1.1 of my Windows Phone 7 emulator skin switcher were hosted on my SkyDrive but I got several requests from people to move it to Codeplex so I did that this afternoon.</p>
<p>From now on the latest version + source can be found on <a title="http://wp7emuskinswitcher.codeplex.com/" href="http://wp7emuskinswitcher.codeplex.com/">http://wp7emuskinswitcher.codeplex.com/</a></p>
<p>With the move to Codeplex I also upgraded the version to 1.2. here is the Changelog:</p>
<ul>
<li>Fixed a bug where the skin switcher broke the back button of the emulator when people used certain custom skins before they used the skin switcher.</li>
<li>Added working volume, camera + power buttons on the Lumia 800 skins</li>
<li>Added a White Lumia 800 skin made by Derek Orr</li>
<li>Added a Zune HD skin made by Ben Pinkerton</li>
</ul>
<p><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="phones" border="0" alt="phones" src="http://vdcruijsen.net/wp-content/uploads/2012/01/phones1.png" width="531" height="200" /></p>
<p>Enjoy!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Windows+Phone+7+emulator+skin+switcher+1.2+released+on+Codeplex&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Fwindows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Windows+Phone+7+emulator+skin+switcher+1.2+released+on+Codeplex&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Fwindows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Windows+Phone+7+emulator+skin+switcher+1.2+released+on+Codeplex&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Fwindows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Fwindows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/01/windows-phone-7-emulator-skin-switcher-1-2-released-on-codeplex/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Testing the SH WP ApplicationBar in an Multiselectlist MVVM scenario</title>
		<link>http://vdcruijsen.net/2012/01/testing-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario/</link>
		<comments>http://vdcruijsen.net/2012/01/testing-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario/#comments</comments>
		<pubDate>Fri, 06 Jan 2012 17:06:16 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[ApplicationBar]]></category>
		<category><![CDATA[codeplex]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=188</guid>
		<description><![CDATA[If you’re developing for Windows Phone 7 and are using MVVM you’re probably familiar with the problem that you cannot bind the out of the box ApplicationBar because it is not a silverlight control. Since the early days of WP7 &#8230; <a href="http://vdcruijsen.net/2012/01/testing-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you’re developing for Windows Phone 7 and are using MVVM you’re probably familiar with the problem that you cannot bind the out of the box ApplicationBar because it is not a silverlight control. Since the early days of WP7 there are lots of solutions and workarounds to work with the application bar but most of them do have some (minor) downsides in using them. The application bar solutions that are used the most are probably the <a href="http://phone7.codeplex.com/">BindableApplicationBar from PhoneFX</a>, another <a href="http://bindableapplicationb.codeplex.com/">BindableApplicationBar</a> or <a href="http://appbarutils.codeplex.com/">AppBarUtils</a>.</p>
<p>Up untill now I was using the PhoneFX BindableApplicationBar but I really disliked the problem that you can’t bind the visibility property of the ApplicationBarButtons to hide or show them when you need them. A common example where you use this is in a Scenario with a MultiSelectList on a page where you want to be able to hide the “Remove” button as long as you didn’t select an item yet and hide the “Select” button when you are already in the selection mode. This week I was reading a blogpost on <a href="http://www.windowsphonegeek.com/articles/Advanced-ApplicationBar-for-Windows-Phone">Windows Phone Geek about the AdvancedApplicationBar</a> and I read that this new ApplicationBar solution did support binding the Visibility of ApplicationBarButtons so it was time to put this one to the test.</p>
<p>In this post I’ll walk you through my the code I produced to get a nice MultiSelectList control (from the silverlight wp7 toolkit ) working with the applicationbar without writing any codebehind. I used <a href="http://mvvmlight.codeplex.com/">MVVM light</a> for this sample so an empty <a href="http://mvvmlight.codeplex.com/">MVVM light</a> project with references added to the <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> and the <a href="http://shwp.codeplex.com/">SH WP ApplicationBar</a> will be my starting point.</p>
<p>The idea is to build an application showing a MultiSelectList with some messages that you can select and delete by using the ApplicationBarButtons just as the build in Mail application does.</p>
<p>Lets first start of building some of the plumbing to get this application going. We’ll create a Message Class that is going to be our Class containing the information for each message. We’ll keep this Class plain and simple:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Message</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Sender { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">public</span> DateTime Date { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Content { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>We’ll also need a property in the ViewModel to expose a list of these Messages which we can fill with dummy data and that can be bound in the MultiSelectList. We’ll create a property in the ViewModel called Messages and will fill these for this small example in the constructor of the MainViewModel.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #008000">/// Initializes a new instance of the MainViewModel class.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">public</span> MainViewModel()</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> i = 0; i &lt; 10; i++)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         Message m = <span style="color: #0000ff">new</span> Message();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         m.Sender = <span style="color: #006080">&quot;Sender &quot;</span> + i.ToString();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         m.Date = DateTime.Now.AddHours(i);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         m.Content = <span style="color: #006080">&quot;This is a sample message &quot;</span> + i.ToString();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>         Messages.Add(m);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span> <span style="color: #008000">/// The &lt;see cref=&quot;Messages&quot; /&gt; property's name.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> MessagesPropertyName = <span style="color: #006080">&quot;Messages&quot;</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span> <span style="color: #0000ff">private</span> ObservableCollection&lt;Message&gt; _messages = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span> <span style="color: #008000">/// Sets and gets the Messages property.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span> <span style="color: #008000">/// Changes to that property's value raise the PropertyChanged event. </span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span> <span style="color: #0000ff">public</span> ObservableCollection&lt;Message&gt; Messages</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>         <span style="color: #0000ff">return</span> _messages;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span>     set</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span>         <span style="color: #0000ff">if</span> (_messages == <span style="color: #0000ff">value</span>)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>         _messages = <span style="color: #0000ff">value</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>         RaisePropertyChanged(MessagesPropertyName);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Now the data is there it’s time to create the UI. One of the best parts of using MVVM is creating the UI in Expression Blend so lets use that. We’ll add a MultiSelectList Control to the page (it’s a control that comes in the silverlight toolkit for wp7) and bind the itemsource to the Messages property. We’ll also add the AdvancedApplicationBar from the SH WP library to the page and create 2 buttons to be used on the ApplicationBar, a select button and a delete button. Set the size of the MultiSelectList to Autosize –&gt; full and make sure the AdvancedApplicationBar control is located in the Layoutroot. Set the text of the 2 ApplicationBarButtons to Select and Remove and also select an image for the buttons.</p>
<p><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="multiselectlist" border="0" alt="multiselectlist" src="http://vdcruijsen.net/wp-content/uploads/2012/01/multiselectlist.png" width="400" height="250" /></p>
<p>When you rebuild now you’ll see 10 lines of code in the multiselect list. Change the ItemTemplate for the MultiSelectList by creating an empty template and adding 3 textboxes to them binding them to our 3 fields in our Message Class: Sender, Date and Content. Give all of them a pretty style and we’re ready to go on.</p>
<p><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="itemtemplate" border="0" alt="itemtemplate" src="http://vdcruijsen.net/wp-content/uploads/2012/01/itemtemplate.png" width="399" height="165" /></p>
<p>Your Xaml for the contentgrid should look like this</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;ContentGrid&quot;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>       <span style="color: #ff0000">Grid</span>.<span style="color: #ff0000">Row</span><span style="color: #0000ff">=&quot;1&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;537&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">toolkit:MultiselectList</span> <span style="color: #ff0000">ItemsSource</span><span style="color: #0000ff">=&quot;{Binding Messages}&quot;</span> <span style="color: #ff0000">ItemTemplate</span><span style="color: #0000ff">=&quot;{StaticResource MessageTemplate}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBar</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Select&quot;</span> <span style="color: #ff0000">IconUri</span><span style="color: #0000ff">=&quot;/Images/ApplicationBar.Select.png&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Remove&quot;</span> <span style="color: #ff0000">IconUri</span><span style="color: #0000ff">=&quot;/Images/ApplicationBar.Delete.png&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Sh:AdvancedApplicationBar</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>The Xaml for the ItemTemplate looks like this</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">phone:PhoneApplicationPage.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">DataTemplate</span> <span style="color: #ff0000">x:Key</span><span style="color: #0000ff">=&quot;MessageTemplate&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Sender}&quot;</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">=&quot;{StaticResource PhoneTextLargeStyle}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Date}&quot;</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">=&quot;{StaticResource PhoneTextAccentStyle}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Content}&quot;</span> <span style="color: #ff0000">Style</span><span style="color: #0000ff">=&quot;{StaticResource PhoneTextNormalStyle}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">StackPanel</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">DataTemplate</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">phone:PhoneApplicationPage.Resources</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>When we run our application now the output should be similar to this. You can tap on the left side of the screen to select items in the list just like you can in the build in mail application.</p>
<p><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="messages1" border="0" alt="messages1" src="http://vdcruijsen.net/wp-content/uploads/2012/01/messages1.png" width="250" height="417" />&#160;<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="messages2" border="0" alt="messages2" src="http://vdcruijsen.net/wp-content/uploads/2012/01/messages2.png" width="250" height="417" /></p>
<p>It is pretty weird to have the Remove button visible when you’re not in selection mode of the MultiSelectList and the same thing goes for the Select button that’s still visible when the MultiSelectList is in selectionMode. To fix this we’ll bind the Visibility property of these ApplicationBarButtons to a boolean property that is also 2 way bound to the IsSelectionEnabled property of the MultiSelectList.</p>
<p>To do this we first need to add a boolean property to the ViewModel called IsInSelectionMode</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #008000">/// The &lt;see cref=&quot;IsInSelectionMode&quot; /&gt; property's name.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> IsInSelectionModePropertyName = <span style="color: #006080">&quot;IsInSelectionMode&quot;</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">bool</span> _isInSelectionMode = <span style="color: #0000ff">false</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #008000">/// Sets and gets the IsInSelectionMode property.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> <span style="color: #008000">/// Changes to that property's value raise the PropertyChanged event. </span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">bool</span> IsInSelectionMode</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>         <span style="color: #0000ff">return</span> _isInSelectionMode;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>     set</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>         <span style="color: #0000ff">if</span> (_isInSelectionMode == <span style="color: #0000ff">value</span>)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>         _isInSelectionMode = <span style="color: #0000ff">value</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         RaisePropertyChanged(IsInSelectionModePropertyName);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>When we have this property we can bind the property to the IsSelectionEnabled property of the MultiSelectList. For some reason this can’t be done in Blend since the DataBinding button is greyed out but coding it in Xaml does work. The binding looks like this in Xaml</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">toolkit:MultiselectList</span> <span style="color: #ff0000">ItemsSource</span><span style="color: #0000ff">=&quot;{Binding Messages}&quot;</span> <span style="color: #ff0000">ItemTemplate</span><span style="color: #0000ff">=&quot;{StaticResource MessageTemplate}&quot;</span> <span style="color: #ff0000">IsSelectionEnabled</span><span style="color: #0000ff">=&quot;{Binding IsInSelectionMode, Mode=TwoWay}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>The Visibility property of the ApplicationBarButtons isn’t a boolean type so we’ll need a converter to convert the boolean to a Visibility Property. I’m using 2 converters here. 1 is converting the boolean value True to Visibility.Visible and the other converter is also an inverter and is converting True to Visibility.Collapsed. </p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #008000">/// Converts a boolean to Visibililty</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #008000">///[ValueConversion(typeof(bool), typeof(Visibility))]</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> BooleanToVisibilityConverter : IValueConverter</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     <span style="color: #cc6633">#region</span> IValueConverter Members</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> Convert(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>         Visibility result = Visibility.Collapsed;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>         <span style="color: #0000ff">bool</span> val;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>         <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> != <span style="color: #0000ff">null</span> &amp;&amp;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>             <span style="color: #0000ff">bool</span>.TryParse(<span style="color: #0000ff">value</span>.ToString(), <span style="color: #0000ff">out</span> val))</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>             result = val ? Visibility.Visible : Visibility.Collapsed;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>         <span style="color: #0000ff">return</span> result;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> ConvertBack(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>         <span style="color: #008000">//You can't convert back</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>     <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span> <span style="color: #008000">/// Converts a boolean to Collapsed Visibililty</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span> <span style="color: #008000">///[ValueConversion(typeof(bool), typeof(Visibility))]</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> BooleanInverterToVisibilityConverter : IValueConverter</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>     <span style="color: #cc6633">#region</span> IValueConverter Members</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> Convert(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span>             Visibility result = Visibility.Collapsed;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span>             <span style="color: #0000ff">bool</span> val;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>             <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> != <span style="color: #0000ff">null</span> &amp;&amp;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span>                 <span style="color: #0000ff">bool</span>.TryParse(<span style="color: #0000ff">value</span>.ToString(), <span style="color: #0000ff">out</span> val))</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum50">  50:</span>             {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum51">  51:</span>                 result = val ? Visibility.Collapsed : Visibility.Visible;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum52">  52:</span>             }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum53">  53:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum54">  54:</span>             <span style="color: #0000ff">return</span> result;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum55">  55:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum56">  56:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum57">  57:</span>         <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> ConvertBack(<span style="color: #0000ff">object</span> <span style="color: #0000ff">value</span>, Type targetType, <span style="color: #0000ff">object</span> parameter, System.Globalization.CultureInfo culture)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum58">  58:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum59">  59:</span>             <span style="color: #008000">//You can't convert back</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum60">  60:</span>             <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum61">  61:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum62">  62:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum63">  63:</span>         <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum64">  64:</span>     }</pre>
<p><!--CRLF--></div>
</div>
<p>Lets Bind the boolean value using the converter to the ApplicationBarIcons. Your Xaml should look like this:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Select&quot;</span> <span style="color: #ff0000">IconUri</span><span style="color: #0000ff">=&quot;/Images/ApplicationBar.Select.png&quot;</span> <span style="color: #ff0000">Visibility</span><span style="color: #0000ff">=&quot;{Binding IsInSelectionMode, Converter={StaticResource BooleanInverterToVisibilityConverter}}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Remove&quot;</span> <span style="color: #ff0000">IconUri</span><span style="color: #0000ff">=&quot;/Images/ApplicationBar.Delete.png&quot;</span> <span style="color: #ff0000">Visibility</span><span style="color: #0000ff">=&quot;{Binding IsInSelectionMode, Converter={StaticResource BooleanToVisibilityConverter}}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>If you run the application again you should be able to see the icons showing up and hiding at the correct times now.</p>
<p>To finish this sample and blogpost up we want the Select button to put the MultiSelectMode in selection mode and the remove button should remove the selected items. Lets start with the Select button. We’ll create a RelayCommand in the viewmodel that puts the MultiSelectList into selectionMode.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">private</span> RelayCommand _messageListToSelectModeCommand;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #008000">/// Gets the MessageListToSelectModeCommand.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">public</span> RelayCommand MessageListToSelectModeCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         <span style="color: #0000ff">return</span> _messageListToSelectModeCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>             ?? (_messageListToSelectModeCommand = <span style="color: #0000ff">new</span> RelayCommand(</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>                 () =&gt;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>                 {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>                     IsInSelectionMode = <span style="color: #0000ff">true</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>                 }));</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>On the Select ApplicationBarButton we’ll add an EventToCommand behavior that will trigger this RelayCommand. I did this in Blend but the Xaml that is created will look like this:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;Select&quot;</span> <span style="color: #ff0000">IconUri</span><span style="color: #0000ff">=&quot;/Images/ApplicationBar.Select.png&quot;</span> <span style="color: #ff0000">Visibility</span><span style="color: #0000ff">=&quot;{Binding IsInSelectionMode, Converter={StaticResource BooleanInverterToVisibilityConverter}}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:EventTrigger</span> <span style="color: #ff0000">EventName</span><span style="color: #0000ff">=&quot;Click&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>             <span style="color: #0000ff">&lt;</span><span style="color: #800000">GalaSoft_MvvmLight_Command:EventToCommand</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{Binding MessageListToSelectModeCommand, Mode=OneWay}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>         <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:EventTrigger</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Sh:AdvancedApplicationBarIconButton</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Running the application again will show us that using the select button puts the MultiSelectList in selectionmode so that part is finished. It only took 1 line of code in the relaycommand.</p>
<p>Removing the items is a bit more work since you can’t do a 2 way binding on the SelectedItems of a MultiSelectList because it is not a dependency property. The best way to get this working is setting up a property in the Viewmodel that is going to contain the selected items and update this list every time the selectionchanged event is fired by another EventToCommandBehavior that triggers a RelayCommand called SelectedMessagesChangedCommand. The SelectedMessagesChangedCommand will update the ViewModel property that will later be used to delete the items.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #008000">/// The &lt;see cref=&quot;SelectedMessages&quot; /&gt; property's name.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> SelectedMessagesPropertyName = <span style="color: #006080">&quot;SelectedMessages&quot;</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">private</span> ObservableCollection&lt;Message&gt; _selectedMessages = <span style="color: #0000ff">null</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> <span style="color: #008000">/// Sets and gets the SelectedMessages property.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span> <span style="color: #008000">/// Changes to that property's value raise the PropertyChanged event. </span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> <span style="color: #0000ff">public</span> ObservableCollection&lt;Message&gt; SelectedMessages</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>         <span style="color: #0000ff">return</span> _selectedMessages;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>     set</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>         <span style="color: #0000ff">if</span> (_selectedMessages == <span style="color: #0000ff">value</span>)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>             <span style="color: #0000ff">return</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>         }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>         _selectedMessages = <span style="color: #0000ff">value</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>         RaisePropertyChanged(SelectedMessagesPropertyName);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span> <span style="color: #0000ff">private</span> RelayCommand&lt;IList&gt; _selectedMessagesChangedCommand;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum33">  33:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum34">  34:</span> <span style="color: #008000">/// Gets the SelectedMessagesChangedCommand.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum35">  35:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum36">  36:</span> <span style="color: #0000ff">public</span> RelayCommand&lt;IList&gt; SelectedMessagesChangedCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum37">  37:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum38">  38:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum39">  39:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum40">  40:</span>         <span style="color: #0000ff">return</span> _selectedMessagesChangedCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum41">  41:</span>             ?? (_selectedMessagesChangedCommand = <span style="color: #0000ff">new</span> RelayCommand&lt;IList&gt;(ExecuteSelectedMessagesChangedCommand));</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum42">  42:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum43">  43:</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum44">  44:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum45">  45:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> ExecuteSelectedMessagesChangedCommand(IList parameter)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum46">  46:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum47">  47:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum48">  48:</span>     SelectedMessages = <span style="color: #0000ff">new</span> ObservableCollection&lt;Message&gt;(parameter.Cast&lt;Message&gt;());</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum49">  49:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Make sure the EventToCommand behavior is passing the SelectedItems as a command property. This can all be done in Blend but here is the Xaml that should be generated by Blend</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:EventTrigger</span> <span style="color: #ff0000">EventName</span><span style="color: #0000ff">=&quot;SelectionChanged&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">GalaSoft_MvvmLight_Command:EventToCommand</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{Binding SelectedMessagesChangedCommand, Mode=OneWay}&quot;</span> <span style="color: #ff0000">CommandParameter</span><span style="color: #0000ff">=&quot;{Binding SelectedItems, ElementName=multiselectList}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:EventTrigger</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Now we have the selected messages in our viewmodel we can use our last RelayCommand called DeleteSelectedMessagesCommand to remove the selected messages.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">private</span> RelayCommand _deleteSelectedMessagesCommand;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #008000">/// &lt;summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #008000">/// Gets the DeleteSelectedMessagesCommand.</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> <span style="color: #0000ff">public</span> RelayCommand DeleteSelectedMessagesCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>     get</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         <span style="color: #0000ff">return</span> _deleteSelectedMessagesCommand</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>             ?? (_deleteSelectedMessagesCommand = <span style="color: #0000ff">new</span> RelayCommand(</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>                 () =&gt;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>                 {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>                     <span style="color: #0000ff">foreach</span> (Message m <span style="color: #0000ff">in</span> SelectedMessages)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>                     {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>                         Messages.Remove(m);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>                     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>                 }));</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>     }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>This needs to be triggered again from an EventToCommand behavior attached to the remove ApplicationBarButton.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">i:EventTrigger</span> <span style="color: #ff0000">EventName</span><span style="color: #0000ff">=&quot;Click&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>         <span style="color: #0000ff">&lt;</span><span style="color: #800000">GalaSoft_MvvmLight_Command:EventToCommand</span> <span style="color: #ff0000">Command</span><span style="color: #0000ff">=&quot;{Binding DeleteSelectedMessagesCommand, Mode=OneWay}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:EventTrigger</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">i:Interaction.Triggers</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>We can run our application again and when you press the remove button the selected items should be removed.</p>
<p>This sample proves the SH WP AdvancedApplicationBar is working pretty good and it proves it has features that I didn’t get to work in the BindableApplicationBar for example the Visibility of the ApplicationBarButtons. I think I’m going to use this ApplicationBar more often in my projects.</p>
<p>Hopefully this sample is usefull for you to see what the SH WP ApplicationBar is up to or just to get an impression on how to work with a bit more advanced ApplicationBar scenario’s using MVVM.</p>
<p>Sourcecode for the sample project can be downloaded <a href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1459&amp;parid=EF12210979E9F6B0!134">here</a></p>
<p>Happy Coding</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Testing+the+SH+WP+ApplicationBar+in+an+Multiselectlist+MVVM+scenario&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ftesting-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Testing+the+SH+WP+ApplicationBar+in+an+Multiselectlist+MVVM+scenario&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ftesting-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Testing+the+SH+WP+ApplicationBar+in+an+Multiselectlist+MVVM+scenario&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ftesting-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ftesting-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/01/testing-the-sh-wp-applicationbar-in-an-multiselectlist-mvvm-scenario/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fixing the The Target &#8220;GetCopyToOutputDirectoryContentProjectItems&#8221; does not exist in the project exception when building your WP7 project</title>
		<link>http://vdcruijsen.net/2012/01/fixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project/</link>
		<comments>http://vdcruijsen.net/2012/01/fixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:28:37 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[SDK]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[XNA]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=180</guid>
		<description><![CDATA[My colleague was installing the Windows Phone 7.1 SDK today and we received the following errors during installation plus a popup box that the bootstrapper had an exception: Setup could not install the following components: Microsoft XNA game Studio 4.0 &#8230; <a href="http://vdcruijsen.net/2012/01/fixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>My colleague was installing the Windows Phone 7.1 SDK today and we received the following errors during installation plus a popup box that the bootstrapper had an exception:</p>
<p>Setup could not install the following components:</p>
<ul>
<li>Microsoft XNA game Studio 4.0 Refresh</li>
<li>Windows Phone SDK 7.1 Extensions for XNA Game Studio 4.0</li>
</ul>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2012/01/sdk-error.jpg"><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="sdk error" border="0" alt="sdk error" src="http://vdcruijsen.net/wp-content/uploads/2012/01/sdk-error_thumb.jpg" width="516" height="462" /></a></p>
<p>We retried installing the SDK after a full uninstall and a reboot but this wouldn’t help. This error kept appearing. In the end my idea was that we didn’t need XNA any time soon so we would just let this rest and see if everything was still working. Visual studio 2010 opened up fine, Blend&#160; was working All the templates for a&#160; phone project were there so everything seemed ok.</p>
<p>A few hours later when my colleague opened up an already made project from source control and tried to build the project she informed me that she was getting build errors so I had a look. The exception was </p>
<p><strong><em>The Target “GetCopyToOutputDirectoryContentProjectItems” does not exist in the project</em> </strong></p>
<p>I never heard of this error before and checked if the project was still building on my machine. Ofcourse it was so the problem was somewhere in her environment. I didn’t immediately make the connection of the XNA installation failure but after some searching I found out that it had to do with some of the MSBUILD .target files that Windows Phone 7.1 projects use that have dependencies on the XNA Game studio.</p>
<p>Getting XNA Game studio installed properly seemed the solution so we tried to get that fixed. The solution is in getting the XNA studio installed without use of the bootstrapper that was crashing and Aaron Stebner made a good post on how to do that <a href="http://blogs.msdn.com/b/astebner/archive/2009/06/12/9740290.aspx">here</a>.</p>
<p>Follow all the steps in Aarons guide (the file from step 9 didn’t exist for me so I skipped it) and after this the project would build again.</p>
<p>Everyone happy and back to coding <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://vdcruijsen.net/wp-content/uploads/2012/01/wlEmoticon-smile.png" /> Hopefully this post can help someone else when they run into the same problems as we did because we’ve spend to much precious time to fix this.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Fixing+the+The+Target+%26ldquo%3BGetCopyToOutputDirectoryContentProjectItems%26rdquo%3B+does+not+exist+in+the+project+exception+when+building+your+WP7+project&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ffixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Fixing+the+The+Target+%26ldquo%3BGetCopyToOutputDirectoryContentProjectItems%26rdquo%3B+does+not+exist+in+the+project+exception+when+building+your+WP7+project&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ffixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Fixing+the+The+Target+%26ldquo%3BGetCopyToOutputDirectoryContentProjectItems%26rdquo%3B+does+not+exist+in+the+project+exception+when+building+your+WP7+project&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ffixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2012%2F01%2Ffixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2012/01/fixing-the-the-target-getcopytooutputdirectorycontentprojectitems-does-not-exist-in-the-project-exception-when-building-your-wp7-project/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>WP7 Emulator Skin Switcher v1.1 released &#8211; now containing 23 skins (Nokia, Samsung, HTC and more)</title>
		<link>http://vdcruijsen.net/2011/12/wp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more/</link>
		<comments>http://vdcruijsen.net/2011/12/wp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more/#comments</comments>
		<pubDate>Sun, 25 Dec 2011 10:15:18 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=172</guid>
		<description><![CDATA[After the first release of my skin switcher last week I got replies from a lot of people asking for more skins of Samsung, HTC and other devices. I tried to get in contact with all the skin creators out &#8230; <a href="http://vdcruijsen.net/2011/12/wp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After the first release of my skin switcher last week I got replies from a lot of people asking for more skins of Samsung, HTC and other devices. I tried to get in contact with all the skin creators out there who had published a skin to ask if I could add it to the application. Luckily all said yes so I’ve included a lot of new skins. I also used my spare time in this holiday season to create some new skins that I couldn’t find online yet.</p>
<p>Version 1.1 contains a total of 23 emulator skins from popular devices as the HTC Titan, HTC Radar, HTC Trophy, HTC Mozart, HTC HD7, Samsung Focus S, Samsung Omnia W, Samsung Omnia 7, Samsung Focus, Fujitsu IS12T in green and black, ZTE Tania, Nokia Lumia 710 and the Nokia Lumia 800.</p>
<p>Big thanks to Jeff Wilcox, Jeff Blankenburg, Danijel Malik, Georg Kalus and Pedro Lamas for adding their skins to the application. </p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="emulator skin switcher" border="0" alt="emulator skin switcher" src="http://vdcruijsen.net/wp-content/uploads/2011/12/emulator-skin-switcher.png" width="520" height="360" /></p>
<p><strike>You can download version 1.1 here now: </strike></p>
<p><strong>Update! version 1.2 is released and the project is moved to codeplex. you can find the newest version here: </strong><a title="http://wp7emuskinswitcher.codeplex.com/" href="http://wp7emuskinswitcher.codeplex.com/"><strong>http://wp7emuskinswitcher.codeplex.com/</strong></a></p>
<p>Total list of skins:</p>
<ul>
<li>Default skin – Microsoft </li>
<li>Fujitsu IS12T Green &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Fujitsu IS12T Black &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Generic unbranded skin &#8211; <a href="http://www.jeff.wilcox.name/" target="_blank">Jeff Wilcox</a> </li>
<li>HTC Arrive (7pro) &#8211; <a href="http://www.jeffblankenburg.com/2011/12/17/want-to-change-your-windows-phone-emulator/" target="_blank">Jeff Blankenburg</a> </li>
<li>HTC HD7 &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>HTC Mozart &#8211; <a href="http://arkcore.wordpress.com/2011/04/28/windows-phone-7-emulator-htc-mozart-skin/" target="_blank">Danijel Malik</a> </li>
<li>HTC Radar Silver &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>HTC Titan &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>HTC Trophy &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 Black Blue &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 Black Yellow &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Black &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Blue &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Pink &#8211; <a href="http://www.leitning.de/2011/nokia-lumia-800-windows-phone-emulator-skin/" target="_blank">Georg Kalus</a> </li>
<li>Nokia Lumia 800 Black &#8211; <a href="http://www.pedrolamas.com/windows-phone/nokia-lumia-800-skin/" target="_blank">Pedro Lamas</a> </li>
<li>Nokia Lumia 800 Blue &#8211; <a href="http://www.leitning.de/2011/nokia-lumia-800-windows-phone-emulator-skin/" target="_blank">Georg Kalus</a> </li>
<li>Nokia Lumia 800 Pink &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Samsung Focus &#8211; <a href="http://www.jeff.wilcox.name/" target="_blank">Jeff Wilcox</a> </li>
<li>Samsung Focus S &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Samsung Omnia 7 &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Samsung Omnia W &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>ZTE Tania &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
</ul>
<p>If you created a skin or want to create a skin that’s not included and you want to get it listed in the application yet let me know and I’ll add it for you including your name and a link to your blog or website.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="emulator skin switcher 2" border="0" alt="emulator skin switcher 2" src="http://vdcruijsen.net/wp-content/uploads/2011/12/emulator-skin-switcher-2.png" width="520" height="360" /></p>
<p>Here are some screenshots of newly added skins</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="fujitsuis12t" border="0" alt="fujitsuis12t" src="http://vdcruijsen.net/wp-content/uploads/2011/12/fujitsuis12t.png" width="180" height="357" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="htcradar" border="0" alt="htcradar" src="http://vdcruijsen.net/wp-content/uploads/2011/12/htcradar.png" width="183" height="358" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="htctitan" border="0" alt="htctitan" src="http://vdcruijsen.net/wp-content/uploads/2011/12/htctitan.png" width="196" height="357" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="samsungfocuss" border="0" alt="samsungfocuss" src="http://vdcruijsen.net/wp-content/uploads/2011/12/samsungfocuss.png" width="195" height="357" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="samsungomniaw" border="0" alt="samsungomniaw" src="http://vdcruijsen.net/wp-content/uploads/2011/12/samsungomniaw.png" width="192" height="357" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="ztetania" border="0" alt="ztetania" src="http://vdcruijsen.net/wp-content/uploads/2011/12/ztetania.png" width="192" height="357" /></p>
<p>If for some reason the application is not working and your emulator stopped working after usage of the application let me know and I’ll help you to get everything working again!</p>
<p>Happy coding!</p>
<p>Geert van der Cruijsen</p>
<ul><!--EndFragment--></ul>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=WP7+Emulator+Skin+Switcher+v1.1+released+-+now+containing+23+skins+%28Nokia%2C+Samsung%2C+HTC+and+more%29&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=WP7+Emulator+Skin+Switcher+v1.1+released+-+now+containing+23+skins+%28Nokia%2C+Samsung%2C+HTC+and+more%29&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=WP7+Emulator+Skin+Switcher+v1.1+released+-+now+containing+23+skins+%28Nokia%2C+Samsung%2C+HTC+and+more%29&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/wp7-emulator-skin-switcher-v1-1-released-now-containing-23-skins-nokia-samsung-htc-and-more/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Emulator Skin Switcher 1.0 Beta</title>
		<link>http://vdcruijsen.net/2011/12/windows-phone-7-emulator-skin-switcher-1-0-beta/</link>
		<comments>http://vdcruijsen.net/2011/12/windows-phone-7-emulator-skin-switcher-1-0-beta/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 15:47:02 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/2011/12/windows-phone-7-emulator-skin-switcher-1-0-beta/</guid>
		<description><![CDATA[In the last few weeks several people started creating their own skins for the Windows Phone 7 Emulator. Switching between different skins was a lot of work by copying files manually to the emulator directory every time you wanted to &#8230; <a href="http://vdcruijsen.net/2011/12/windows-phone-7-emulator-skin-switcher-1-0-beta/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In the last few weeks several people started creating their own skins for the Windows Phone 7 Emulator. Switching between different skins was a lot of work by copying files manually to the emulator directory every time you wanted to switch. From now on this is not needed anymore because you can use the Windows Phone 7 Emulator Skin Switcher application I’ve created.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="wp7EmulatorSkinSwitcher" border="0" alt="wp7EmulatorSkinSwitcher" src="http://vdcruijsen.net/wp-content/uploads/2011/12/wp7EmulatorSkinSwitcher.png" width="520" height="360" /></p>
<p><strike>You can download the application here: </strike><a href="https://skydrive.live.com/redir.aspx?cid=ef12210979e9f6b0&amp;resid=EF12210979E9F6B0!1458&amp;parid=EF12210979E9F6B0!124" target="_blank"><strike>Download</strike></a></p>
<p><strong>Update! version 1.2 is released and the project is moved to codeplex. you can find the newest version here: </strong><a title="http://wp7emuskinswitcher.codeplex.com/" href="http://wp7emuskinswitcher.codeplex.com/"><strong>http://wp7emuskinswitcher.codeplex.com/</strong></a></p>
<p>This version is the first <strong><u>beta</u></strong> release with my first set of skins. I added 2 skins from <a href="http://www.leitning.de/2011/nokia-lumia-800-windows-phone-emulator-skin/" target="_blank">Georg Kalus</a>: the Blue Nokia Lumia 800 and the White/Pink Nokia Lumia 710. I’ve also included the Black Nokia Lumia 800 skin from <a href="http://www.pedrolamas.com/windows-phone/nokia-lumia-800-skin/" target="_blank">Pedro Lamas</a></p>
<p>The complete list of skins included in the application now are:</p>
<ul>
<li>Default skin – Microsoft </li>
<li>Nokia Lumia 710 Black Blue &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 Black Yellow &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Black &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Blue &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
<li>Nokia Lumia 710 White Pink &#8211; <a href="http://www.leitning.de/2011/nokia-lumia-800-windows-phone-emulator-skin/" target="_blank">Georg Kalus</a> </li>
<li>Nokia Lumia 800 Black &#8211; <a href="http://www.pedrolamas.com/windows-phone/nokia-lumia-800-skin/" target="_blank">Pedro Lamas</a> </li>
<li>Nokia Lumia 800 Blue &#8211; <a href="http://www.leitning.de/2011/nokia-lumia-800-windows-phone-emulator-skin/" target="_blank">Georg Kalus</a> </li>
<li>Nokia Lumia 800 Pink &#8211; <a href="http://twitter.com/geertvdc" target="_blank">Geert van der Cruijsen</a> </li>
</ul>
<p>I’m planning on adding more skins in the near future but didn’t have time for it yet. If you have skins I can use please let me know by comment or on <a href="http://twitter.com/geertvdc" target="_blank">twitter</a></p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="lumia710white" border="0" alt="lumia710white" src="http://vdcruijsen.net/wp-content/uploads/2011/12/lumia710white.png" width="190" height="359" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="lumia800pink" border="0" alt="lumia800pink" src="http://vdcruijsen.net/wp-content/uploads/2011/12/lumia800pink.png" width="190" height="345" /><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="lumia710black" border="0" alt="lumia710black" src="http://vdcruijsen.net/wp-content/uploads/2011/12/lumia710black.png" width="190" height="359" /></p>
<p>&#160;</p>
<p>Hopefully this will make your Windows Phone 7 projects even more fun to test!</p>
<p>Happy Coding</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Windows+Phone+7+Emulator+Skin+Switcher+1.0+Beta&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwindows-phone-7-emulator-skin-switcher-1-0-beta%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Windows+Phone+7+Emulator+Skin+Switcher+1.0+Beta&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwindows-phone-7-emulator-skin-switcher-1-0-beta%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Windows+Phone+7+Emulator+Skin+Switcher+1.0+Beta&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwindows-phone-7-emulator-skin-switcher-1-0-beta%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fwindows-phone-7-emulator-skin-switcher-1-0-beta%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/windows-phone-7-emulator-skin-switcher-1-0-beta/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Creating dynamic Windows Phone 7 live tile images client side</title>
		<link>http://vdcruijsen.net/2011/12/creating-dynamic-windows-phone-7-live-tile-images-client-side/</link>
		<comments>http://vdcruijsen.net/2011/12/creating-dynamic-windows-phone-7-live-tile-images-client-side/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 15:36:31 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Live Tiles]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/2011/12/creating-dynamic-windows-phone-7-live-tile-images-client-side/</guid>
		<description><![CDATA[One of the best parts of windows phone that makes Windows Phone stand out are the live tiles. Microsoft enables you to do a few out of the box customizations to the live tiles but&#160; when you want to go &#8230; <a href="http://vdcruijsen.net/2011/12/creating-dynamic-windows-phone-7-live-tile-images-client-side/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the best parts of windows phone that makes Windows Phone stand out are the live tiles. Microsoft enables you to do a few out of the box customizations to the live tiles but&#160; when you want to go all out most people think you’ll need to generate the images on a server using ASP.NET and then send them to the application as a notification. This is not always the case, you can also create custom tiles client side running on your phone to show custom messages or imitate the outlook tile for example with a number of how many unread messages you have.</p>
<p>First lets sum up what you can do by default and after that we’ll go into going beyond this and creating even better live tiles by adding multiple images or multiple texts to a live tile using the colors and fonts of your choice.</p>
<p>By default you can set the following properties on a live tile</p>
<ul>
<li>Title (shown in the bottom left)</li>
<li>Count (black circle with a number between 1 and 99)</li>
<li>BackGroundImage (image to show on your tile)</li>
<li>BackTitle (shown in the bottom left on the backside of the tile)</li>
<li>BackContent (piece of text shown on the backside of the tile)</li>
<li>BackBackGroundImage (Image on the backside of the tile)</li>
</ul>
<p>Ok this is pretty cool but what if we want to make something like Runkeeper does in their app as shown in the following picture:<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="runkeeper live tile" border="0" alt="runkeeper live tile" src="http://vdcruijsen.net/wp-content/uploads/2011/12/runkeeper-live-tile.png" width="600" height="200" /></p>
<p>So how do we generate such image on the client side in Silverlight? The trick behind all this is that you can render a user control as a WriteableBitmap and store this image in the isolated storage of your phone so you can use it as the tile BackGroundImage. The final working codesample is linked at the bottom of this post but I’ll show all code to build this example in this blogpost.</p>
<p>We start of creating a new Silverlight for Windows Phone project. Normally I would use MVVM but for this example I want to make it as simple as possible to focus on the tile part.</p>
<p>We’ll create a new UserControl called “TileControl” which is going to be used as our live tile and a “TileData” class to be used for containing the data we’ll be showing on the&#160; live tile.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TileData</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Text1 { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Text2 { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> ImageSource { get; set; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Create the TileControl, set it to 173 by 173pixels and set the background to use PhoneAccentBrush so the live tile has the color the user has selected. Lets make our designers happy and open up the TileControl in expression blend so our designers (or if you are a devigner you!) can design our live tile with dynamic data.</p>
<p>Add a few text boxes and a image to the control so you have something like this:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;LayoutRoot&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;173&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;173&quot;</span> <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;{StaticResource PhoneAccentBrush}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;55&quot;</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;4,4,3,0&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span> <span style="color: #ff0000">Foreground</span><span style="color: #0000ff">=&quot;White&quot;</span> <span style="color: #ff0000">FontSize</span><span style="color: #0000ff">=&quot;24&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;0,64,-17,-3&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">FontSize</span><span style="color: #0000ff">=&quot;64&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Right&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;70&quot;</span> <span style="color: #ff0000">Foreground</span><span style="color: #0000ff">=&quot;White&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;6,55,0,13&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;100&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Left&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>In the Data window click the icon “Create sample data from class” and select the TileData class.</p>
<p><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="create sample data" border="0" alt="create sample data" src="http://vdcruijsen.net/wp-content/uploads/2011/12/create-sample-data.png" width="400" height="600" /></p>
<p>Edit the sample data so we have some nice data to show. I used the following data:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">CustomLiveTileExample:TileData</span> <span style="color: #ff0000">xmlns:CustomLiveTileExample</span><span style="color: #0000ff">=&quot;clr-namespace:CustomLiveTileExample&quot;</span> </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> <span style="color: #ff0000">ImageSource</span><span style="color: #0000ff">=&quot;ApplicationIcon.png&quot;</span> </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> <span style="color: #ff0000">Text1</span><span style="color: #0000ff">=&quot;The first Text&quot;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span> <span style="color: #ff0000">Text2</span><span style="color: #0000ff">=&quot;9&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p>Now drag the fields from the test data window to the text and image control to bind them. After this your XAML should look like this and the design surface should already show a nice live tile with an image and 2 texts. In our code we’ll databind this control to a programmatically filled TileData object.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;LayoutRoot&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;137&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;137&quot;</span> <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;{StaticResource PhoneAccentBrush}&quot;</span> <span style="color: #ff0000">d:DataContext</span><span style="color: #0000ff">=&quot;{d:DesignData /SampleData/TileDataSampleData.xaml}&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;55&quot;</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;4,4,3,0&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Top&quot;</span> <span style="color: #ff0000">Foreground</span><span style="color: #0000ff">=&quot;White&quot;</span> <span style="color: #ff0000">FontSize</span><span style="color: #0000ff">=&quot;21.333&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Text1}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">TextBlock</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;0,50,-10,11&quot;</span> <span style="color: #ff0000">TextWrapping</span><span style="color: #0000ff">=&quot;Wrap&quot;</span> <span style="color: #ff0000">FontSize</span><span style="color: #0000ff">=&quot;48&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Right&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;70&quot;</span> <span style="color: #ff0000">Foreground</span><span style="color: #0000ff">=&quot;White&quot;</span> <span style="color: #ff0000">Text</span><span style="color: #0000ff">=&quot;{Binding Text2}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;12,51,65,17&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;60&quot;</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;{Binding ImageSource}&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</div>
<p><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="blend tile" border="0" alt="blend tile" src="http://vdcruijsen.net/wp-content/uploads/2011/12/blend-tile.png" width="201" height="199" /></p>
<p>The live tile is ready so lets head back to the main page of our application and add the logic to set the live tile. To trigger the creation of the live tile I’ve added a button on the page and attached a click event. in the button1_Click method I’ll add all code needed to create the live tile.</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> button1_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>         {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>             TileControl frontTile = <span style="color: #0000ff">new</span> TileControl();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>             TileData tileData = <span style="color: #0000ff">new</span> TileData() { ImageSource = <span style="color: #006080">&quot;/ApplicationIcon.png&quot;</span>, Text1 = <span style="color: #006080">&quot;The first text&quot;</span>, Text2 = <span style="color: #006080">&quot;8&quot;</span> };</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>             frontTile.DataContext = tileData;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>             frontTile.Measure(<span style="color: #0000ff">new</span> Size(173, 173));</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>             frontTile.Arrange(<span style="color: #0000ff">new</span> Rect(0, 0, 173, 173));</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>             var bmp = <span style="color: #0000ff">new</span> WriteableBitmap(173, 173);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>             bmp.Render(frontTile, <span style="color: #0000ff">null</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>             bmp.Invalidate();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>             var isf = IsolatedStorageFile.GetUserStoreForApplication();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>             var filename = <span style="color: #006080">&quot;/Shared/ShellContent/tile.jpg&quot;</span>;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>             <span style="color: #0000ff">if</span> (!isf.DirectoryExists(<span style="color: #006080">&quot;/Shared/ShellContent&quot;</span>))</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>             {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>                 isf.CreateDirectory(<span style="color: #006080">&quot;/Shared/ShellContent&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>             }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>             <span style="color: #0000ff">using</span> (var stream = isf.OpenFile(filename, System.IO.FileMode.OpenOrCreate))</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>             {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span>                 bmp.SaveJpeg(stream, 173, 173, 0, 100);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum24">  24:</span>             }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum25">  25:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum26">  26:</span>             var data = <span style="color: #0000ff">new</span> StandardTileData</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum27">  27:</span>             {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum28">  28:</span>                 BackgroundImage = <span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;isostore:&quot;</span> + filename, UriKind.Absolute)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum29">  29:</span>             };</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum30">  30:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum31">  31:</span>             ShellTile.Create(<span style="color: #0000ff">new</span> Uri(<span style="color: #006080">&quot;/MainPage.xaml&quot;</span>, UriKind.Relative), data);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum32">  32:</span>         }</pre>
<p><!--CRLF--></div>
</div>
<p>First we’ll create a TileControl object called frontTile, then we’ll fill it with our tileData by creating a TileData object and setting the DataContext to tileData. After this we’ll create a WriteableBitmap and set it to 173 by 173 pixels. Well use the Render method to render the usercontrol as a bitmap.</p>
<p>After that we’ll check if the directory in the isolated storage exists and if it doesn’t we’ll create it. After that we’ll open the tile file and use the SaveJpeg method to save the WritableBitmap as a .jpg file (bit of a shame you can’t do png that’s why we’ve set the background color to the PhoneAccentColor). after saving the image the only thing we need to do is Call Create on the ShellTile and we’re done.</p>
<p>Lets run the app, press the button and there it is, our dynamically created livetile.</p>
<p><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="app1" border="0" alt="app1" src="http://vdcruijsen.net/wp-content/uploads/2011/12/app1.png" width="250" height="476" />&#160;&#160;&#160; <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="app2" border="0" alt="app2" src="http://vdcruijsen.net/wp-content/uploads/2011/12/app2.png" width="250" height="476" /></p>
<p>Download Sample project:</p>
<p><iframe style="padding-bottom: 0px; background-color: #fcfcfc; padding-left: 0px; padding-right: 0px; padding-top: 0px" title="Preview" height="120" marginheight="0" src="https://skydrive.live.com/embed?cid=EF12210979E9F6B0&amp;resid=EF12210979E9F6B0%211456&amp;authkey=AFWKfMr5Pk2Y0oY" frameborder="0" width="98" marginwidth="0" scrolling="no"></iframe></p>
<p>Happy coding!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Creating+dynamic+Windows+Phone+7+live+tile+images+client+side&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fcreating-dynamic-windows-phone-7-live-tile-images-client-side%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Creating+dynamic+Windows+Phone+7+live+tile+images+client+side&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fcreating-dynamic-windows-phone-7-live-tile-images-client-side%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Creating+dynamic+Windows+Phone+7+live+tile+images+client+side&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fcreating-dynamic-windows-phone-7-live-tile-images-client-side%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fcreating-dynamic-windows-phone-7-live-tile-images-client-side%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/creating-dynamic-windows-phone-7-live-tile-images-client-side/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Tutorial: How to use the Silverlight Toolkit transitions without writing XAML by using the Toolkit behavior extensions</title>
		<link>http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/</link>
		<comments>http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 09:06:53 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[codeplex]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/</guid>
		<description><![CDATA[In my last post I announced the new Codeplex project I’ve started called the Windows Phone Silverlight toolkit behavior extensions. In this post I’ll explain how to use the behaviors in this project in Expression Blend to create beautiful page &#8230; <a href="http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In my last post I announced the new Codeplex project I’ve started called the <a href="http://phonetoolkitbehavior.codeplex.com/" target="_blank">Windows Phone Silverlight toolkit behavior extensions</a>. In this post I’ll explain how to use the behaviors in this project in Expression Blend to create beautiful page transitions supplied by the <a href="http://silverlight.codeplex.com/" target="_blank">Silverlight Toolkit for windows Phone</a> without writing any code or XAML!</p>
<h1>how to get started</h1>
<p>Download the <a href="http://silverlight.codeplex.com/" target="_blank">silverlight toolkit for windows phone</a> and the <a href="http://phonetoolkitbehavior.codeplex.com/" target="_blank">Windows Phone Silverlight toolkit behavior extensions</a> and install both libraries on your system.</p>
<p>After the installation start Expression Blend and create a new Windows Phone 7 Project.</p>
<p>In the projects window right click “References” and select “Add Reference”<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add reference" border="0" alt="add reference" src="http://vdcruijsen.net/wp-content/uploads/2011/12/add-reference.png" width="521" height="269" /></p>
<p>Select the Microsoft.Phone.Controls.Toolkit.dll file and press “Open”<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add reference 2" border="0" alt="add reference 2" src="http://vdcruijsen.net/wp-content/uploads/2011/12/add-reference-2.png" width="525" height="367" /></p>
<p>Select the PhoneToolkit.Extensions.Behaviors.dll and press “Open”<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add reference 3" border="0" alt="add reference 3" src="http://vdcruijsen.net/wp-content/uploads/2011/12/add-reference-3.png" width="525" height="367" /></p>
<p>You should now have Microsoft.Phone.Controls.Toolkit.dll and PhoneToolkit.Extensions.Behaviors.dll in your References list.<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="add reference 4" border="0" alt="add reference 4" src="http://vdcruijsen.net/wp-content/uploads/2011/12/add-reference-4.png" width="525" height="339" /></p>
<p>Before the transition behaviors work you will have to change 1 thing in the code because that is just how the Silverlight Toolkit Transitions work. so open App.xaml.cs and locate the following Class: “PhoneApplicationFrame”<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="PhoneApplicationFrame" border="0" alt="PhoneApplicationFrame" src="http://vdcruijsen.net/wp-content/uploads/2011/12/PhoneApplicationFrame.png" width="472" height="176" /></p>
<p>And Change it to “TransitionFrame”<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="TransitionFrame" border="0" alt="TransitionFrame" src="http://vdcruijsen.net/wp-content/uploads/2011/12/TransitionFrame.png" width="472" height="176" /></p>
<p>Build the project and after building the new behaviors will be added to the Assets window.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="behavior" border="0" alt="behavior" src="http://vdcruijsen.net/wp-content/uploads/2011/12/behavior.png" width="519" height="324" /></p>
<p>You can drag and drop the new behaviors on your PhoneApplicationPage to enable the tilt effect or enable a page transition. In the Example below I’ve added the EnableTiltEffectBehavior to enable the tilting effect on every clickable usercontrol and I’ve added a TransitionTurnstileInBehavior to show a turnstile animation on entering the page and a TransitionTurnstileOutBehavior to show a turnstile animation on leaving the page.</p>
<p><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="objectsandtimeline" border="0" alt="objectsandtimeline" src="http://vdcruijsen.net/wp-content/uploads/2011/12/objectsandtimeline.png" width="521" height="241" /></p>
<p>The transition behaviors have 2 properties where you can set the animation for forward and backward transitions. by default the most common animations are selected.<img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="properties" border="0" alt="properties" src="http://vdcruijsen.net/wp-content/uploads/2011/12/properties.png" width="321" height="262" /></p>
<p>To test if everything is working drag a button on the content grid and add a second page to your application. The button should now have a tilt effect and you should have turnstile animations when navigating between the pages.</p>
<p>If you want to disable the tilt effect for a specific usercontrol you can add the SuppressTiltEffectBehavior on that control and the control will no longer have a tilt effect.</p>
<p>I’ve added a complete sample application showing all the transitions and tilt effect behaviors on the codeplex site of the <a href="http://phonetoolkitbehavior.codeplex.com/" target="_blank">Windows Phone Toolkit Behavior Extensions</a></p>
<p>If anything isn’t working contact me on <a href="http://twitter.com/geertvdc" target="_blank">twitter</a> or post a comment</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Tutorial%3A+How+to+use+the+Silverlight+Toolkit+transitions+without+writing+XAML+by+using+the+Toolkit+behavior+extensions&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Ftutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Tutorial%3A+How+to+use+the+Silverlight+Toolkit+transitions+without+writing+XAML+by+using+the+Toolkit+behavior+extensions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Ftutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Tutorial%3A+How+to+use+the+Silverlight+Toolkit+transitions+without+writing+XAML+by+using+the+Toolkit+behavior+extensions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Ftutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Ftutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Started a new Codeplex project: Windows Phone Silverlight Toolkit Behavior Extensions</title>
		<link>http://vdcruijsen.net/2011/12/started-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions/</link>
		<comments>http://vdcruijsen.net/2011/12/started-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 08:46:22 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Behaviors]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[codeplex]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/2011/12/started-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions/</guid>
		<description><![CDATA[Of all windows phone development that is done in the world I think almost everyone is using the Windows Phone Silverlight Toolkit you can get from Codeplex. This toolkit adds a lot of new controls and also other cool features &#8230; <a href="http://vdcruijsen.net/2011/12/started-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Of all windows phone development that is done in the world I think almost everyone is using the <a href="http://silverlight.codeplex.com/">Windows Phone Silverlight Toolkit</a> you can get from Codeplex. This toolkit adds a lot of new controls and also other cool features as page transitions and a tilt effect on usercontrols so users will get more feedback when clicking in the UI.</p>
<p>This week I started working on a new project with a <a href="https://twitter.com/#!/marklamb">designer</a> and he asked me how to insert the page transitions on a windows phone application page and I showed him that you’ll have to add a piece of XAML to your code and the page transitions will work. He asked me “Can’t I do this in the designer mode without touching any code?” I didn’t have any right answer for him so that’s why I’ve spend part of my weekend to build some behaviors that can be used to drag this functionality on pages in Expression Blend.</p>
<p>There are behaviors for every type of transition available in the silverlight toolkit. for each transitiontype there is an “in” and “out” behavior for entering and leaving the page. Besides the transition behaviors I’ve also created a behavior to turn the tilteffect on or off</p>
<ul>
<li>EnableTiltEffectBehavior </li>
<li>SuppressTiltBehavior </li>
<li>TransitionRollInBehavior </li>
<li>TransitionRollOutBehavior </li>
<li>TransitionRotateInBehavior </li>
<li>TransitionRotateOutBehavior </li>
<li>TransitionSlideInBehavior </li>
<li>TransitionSlideOutBehavior </li>
<li>TransitionSwivelInBehavior </li>
<li>TransitionSwivelOutBehavior </li>
<li>TransitionTurnstileInBehavior </li>
<li>TransitionTurnstileOutBehavior </li>
</ul>
<p>You can download the behaviors here: (important: you also need the silverlight toolkit for this to work)</p>
<p><a title="http://phonetoolkitbehavior.codeplex.com/" href="http://phonetoolkitbehavior.codeplex.com/">http://phonetoolkitbehavior.codeplex.com/</a></p>
<p>On the codeplex site you’ll find a msi release containing the dll that you can include in your project to use these behaviors and I’ve also included a sample application. I’ll also upload the sample application to the marketplace so you can easily test out the performance etc without any trouble.</p>
<p>For a compete tutorial check this <a href="http://vdcruijsen.net/2011/12/tutorial-how-to-use-the-silverlight-toolkit-transitions-without-writing-xaml-by-using-the-toolkit-behavior-extensions/" target="_blank">blogpost</a>.</p>
<p>This is currently the first release so every feedback is welcome. please let me know by adding a comment here or contact me on <a href="http://twitter.com/geertvdc">twitter</a></p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Started+a+new+Codeplex+project%3A+Windows+Phone+Silverlight+Toolkit+Behavior+Extensions&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fstarted-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Started+a+new+Codeplex+project%3A+Windows+Phone+Silverlight+Toolkit+Behavior+Extensions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fstarted-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Started+a+new+Codeplex+project%3A+Windows+Phone+Silverlight+Toolkit+Behavior+Extensions&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fstarted-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fstarted-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/started-a-new-codeplex-project-windows-phone-silverlight-toolkit-behavior-extensions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New blog template</title>
		<link>http://vdcruijsen.net/2011/12/new-blog-template/</link>
		<comments>http://vdcruijsen.net/2011/12/new-blog-template/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 16:30:30 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/2011/12/new-blog-template/</guid>
		<description><![CDATA[I got a bit bored with my old blog template so I finally switched to a new one that fitted me better. This new template is better readable and clean and I like the orange color that fits with my &#8230; <a href="http://vdcruijsen.net/2011/12/new-blog-template/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I got a bit bored with my old blog template so I finally switched to a new one that fitted me better. This new template is better readable and clean and I like the orange color that fits with my employer <a href="http://www.avanade.com">Avanade</a>. The top picture is inspired by my work and passion for Windows Phone so that’s why I’ve chosen an Image of a Metro line. <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.vdcruijsen.net/wp-content/uploads/2011/12/wlEmoticon-winkingsmile.png" /></p>
<p>If you like my template it’s a free template for WordPress called “Twenty Eleven 1.2” and you can just download it from the template gallery in WordPress.</p>
<p>Enjoy!</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=New+blog+template&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fnew-blog-template%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=New+blog+template&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fnew-blog-template%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=New+blog+template&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fnew-blog-template%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fnew-blog-template%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/new-blog-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switching Dark/Light theme in Blend for Windows Phone</title>
		<link>http://vdcruijsen.net/2011/12/switching-darklight-theme-in-blend-for-windows-phone/</link>
		<comments>http://vdcruijsen.net/2011/12/switching-darklight-theme-in-blend-for-windows-phone/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 08:52:32 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[Expression Blend]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/2011/12/switching-darklight-theme-in-blend-for-windows-phone/</guid>
		<description><![CDATA[Today a small tip on how to change the design view of your windows phone 7 application in Expression Blend so you can see it in light or dark theme or check how all the different accent colors look: This &#8230; <a href="http://vdcruijsen.net/2011/12/switching-darklight-theme-in-blend-for-windows-phone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today a small tip on how to change the design view of your windows phone 7 application in Expression Blend so you can see it in light or dark theme or check how all the different accent colors look:</p>
<p>This is basic functionality but when I asked around I noticed most people don’t know about this feature so that’s why I wrote this blogpost.</p>
<p>By default in Expression Blend your app will show using the dark theme and the blue accent color. To see how your app looks in white just open the Device window by clicking “Window” –&gt; “Device”</p>
<p><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="blend device window" border="0" alt="blend device window" src="http://www.vdcruijsen.net/wp-content/uploads/2011/12/blend-device-window.png" width="370" height="224" /></p>
<p>When the device window is opened you can switch to the light or dark theme by clicking one of the icons. You can also select the accent color from the pulldown box on the right.</p>
<p><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="blend select white theme" border="0" alt="blend select white theme" src="http://www.vdcruijsen.net/wp-content/uploads/2011/12/blend-select-white-theme.png" width="322" height="197" /></p>
<p>The result:</p>
<p><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="blackwhite blend" border="0" alt="blackwhite blend" src="http://www.vdcruijsen.net/wp-content/uploads/2011/12/blackwhite-blend1.png" width="514" height="157" /></p>
<p>Happy <strike>Coding!</strike> Designing!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Switching+Dark%2FLight+theme+in+Blend+for+Windows+Phone&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fswitching-darklight-theme-in-blend-for-windows-phone%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Switching+Dark%2FLight+theme+in+Blend+for+Windows+Phone&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fswitching-darklight-theme-in-blend-for-windows-phone%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Switching+Dark%2FLight+theme+in+Blend+for+Windows+Phone&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fswitching-darklight-theme-in-blend-for-windows-phone%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F12%2Fswitching-darklight-theme-in-blend-for-windows-phone%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/12/switching-darklight-theme-in-blend-for-windows-phone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Pubcenter not showing ads in your windows phone 7 app?</title>
		<link>http://vdcruijsen.net/2011/11/microsoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app/</link>
		<comments>http://vdcruijsen.net/2011/11/microsoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app/#comments</comments>
		<pubDate>Thu, 17 Nov 2011 19:26:55 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Admob]]></category>
		<category><![CDATA[PubCenter]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[WP7 Mango]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/2011/11/microsoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app/</guid>
		<description><![CDATA[The free apps I had in the marketplace were running Google’s Admob as adprovider because when I wrote the apps Microsoft Pubcenter wasn’t available in the Netherlands yet. When I was upgrading my Apps to Mango I found out that &#8230; <a href="http://vdcruijsen.net/2011/11/microsoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The free apps I had in the marketplace were running Google’s Admob as adprovider because when I wrote the apps Microsoft Pubcenter wasn’t available in the Netherlands yet. When I was upgrading my Apps to Mango I found out that version 4.0.4 that is currently the latest release of the Windows Phone Admob SDK is broken will always give you exceptions when you include this control. Seeing Google wasn’t to keen on fixing this since it was mentioned a lot in admob sdk Google groups I decided to switch to Microsoft Pubcenter because it came available for Dutch people.</p>
<p>Implementing the control is easy by just <a href="http://www.microsoft.com/download/en/details.aspx?id=8729">installing the SDK</a>, create an account, adding the control to your page and filling in the applicationid and the adunitid. if you still need a guide this one explains all the details:</p>
<p><a title="http://blogs.msdn.com/b/urmila/archive/2011/03/10/displaying-ads-on-windows-phone-7-apps-the-basics.aspx" href="http://blogs.msdn.com/b/urmila/archive/2011/03/10/displaying-ads-on-windows-phone-7-apps-the-basics.aspx">http://blogs.msdn.com/b/urmila/archive/2011/03/10/displaying-ads-on-windows-phone-7-apps-the-basics.aspx</a></p>
<p>So the control is added to the page and you’re ready to go. If you followed all the instructions the ads should show up fine. Not for you?</p>
<p>I had the same problem when I was testing my application. I did most of my testing in the emulator and the ads would show up fine right there. When I started testing on my phone I noticed that only the ad placeholder was shown for really short time and after that the ad was hidden. Trying to find out what the differences could be between my phone and the emulator my first thoughts were the Culture of the phone since my phone is running in Dutch Culture nl-NL and the emulator is running en-US by default. When I switched the culture on the emulator to being Dutch the ads also stop showing there. </p>
<p>So what is the problem and how did I fix it?</p>
<p>The Pubcenter Adcontrol has a nice event called “ErrorOccured” and you can subscribe to this event to see what is happening. (or just attach the debugger and set it to break on exceptions)</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> MainPage()</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>     InitializeComponent();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     adcontrol.ErrorOccurred += <span style="color: #0000ff">new</span> EventHandler&lt;Microsoft.Advertising.AdErrorEventArgs&gt;(adcontrol_ErrorOccurred);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>&#160; </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span> <span style="color: #0000ff">void</span> adcontrol_ErrorOccurred(<span style="color: #0000ff">object</span> sender, Microsoft.Advertising.AdErrorEventArgs e)</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span> {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>In the adcontrol_ErrorOccurred eventhandler you can log your error the adcontrol is throwing or handle it the way you want to. The error I kept getting when using the Dutch Culture was: </p>
<p><strong><font size="3" face="Courier New">Microsoft.Advertising.Mobile.Shared.AdException &#8211; No ad available.</font></strong></p>
<p>My guess was that this was happening because there aren’t any Dutch ads yet so I tried to change the settings of the adcontrol by changing the CountryOrRegion, Language and even the Latitude and Longitude attributes to somewhere in the United States but this doesn’t help. I made a ticket at the Pubcenter helpdesk and they told me a new algorithm just went live and it can be that there aren’t to many ads yet so it’s possible to get a disappearing ad control once in a while when you’re running less common cultures. Trying to change the country or culture DOES NOT WORK so you’ll just have to wait (It’s not like Admob is a better alternative since that one isn’t working at all)</p>
<p>I would encourage everyone to just leave the ad in and the requests to the Pubcenter servers will show that there is a lot of space for ads to be sold so advertisers will jump in and use this space.</p>
<p>Nokia seems the first to jump in because the last few days I seem to receive Nokia Lumia ads when using a Dutch culture <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh btw this method also works when you’re having other issues with your ad control ofcourse. just check the exception to see what’s going on. The one thing I keep forgetting every time I add the AdControl are the capabilities in the WMAppManifest.xml. when you do this you’ll get another AdException:</p>
<p><font size="3" face="Courier New"><strong>Microsoft.Advertising.Mobile.Shared.AdException &#8211; Required capabilities are missing from manifest (WMAppManifest.xml): ID_CAP_NETWORKING, ID_CAP_PHONEDIALER, ID_CAP_IDENTITY_USER, ID_CAP_MEDIALIB, ID_CAP_WEBBROWSERCOMPONENT.</strong></font></p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Microsoft+Pubcenter+not+showing+ads+in+your+windows+phone+7+app%3F&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F11%2Fmicrosoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Microsoft+Pubcenter+not+showing+ads+in+your+windows+phone+7+app%3F&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F11%2Fmicrosoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Microsoft+Pubcenter+not+showing+ads+in+your+windows+phone+7+app%3F&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F11%2Fmicrosoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F11%2Fmicrosoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/11/microsoft-pubcenter-not-showing-ads-in-your-windows-phone-7-app/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PinPin 1.2 update now available in the WP7 Marketplace</title>
		<link>http://vdcruijsen.net/2011/08/pinpin-1-2-update-now-available-in-the-wp7-marketplace/</link>
		<comments>http://vdcruijsen.net/2011/08/pinpin-1-2-update-now-available-in-the-wp7-marketplace/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 06:27:12 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[PinPin]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/2011/08/pinpin-1-2-update-now-available-in-the-wp7-marketplace/</guid>
		<description><![CDATA[First note I want to make: The “Error retrieving ATM locations” bug is fixed in this release! Here is the story on how it all went down: Since PinPin’s launch last week I’ve been loaded with feedback from people, most &#8230; <a href="http://vdcruijsen.net/2011/08/pinpin-1-2-update-now-available-in-the-wp7-marketplace/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>First note I want to make: The “Error retrieving ATM locations” bug is fixed in this release!</p>
<p>Here is the story on how it all went down:</p>
<p>Since PinPin’s launch last week I’ve been loaded with feedback from people, most of them were positive but there was also a large group of people who weren’t able to get ATM locations. At first I didn’t have any idea how this was possible since I had tested at many locations in the Netherlands and had asked several colleagues to test the app and it worked for everyone.</p>
<p>Luckily&#160; lots of people were able to find the feedback form in my app and when I received a mail from <a href="http://twitter.com/#!/MoaskeFoto/">Marco</a> who had a dev unlocked phone and was receiving the errors I found my chance to find out what was causing the bug. I made a version 1.1 and submitted it to the marketplace (that wasn’t smart because that’s why it took so long to get 1.2 out) but also mailed it to Marco so he could test. 1.1 had the option to save the errors and send a mail with the Error messages and a stacktrace so I could see what was going wrong. </p>
<p>With the error report I received from Marco I could see it was something in the response from the webservice I’m calling to get the ATM data but still couldn’t see what the error was exactly. I again added more logging to the app and asked Marco to test again. This time I could compare my request and response from the server to his and then I found out: The Dutch regional settings were screwing things up. Ofcourse this is a major concern for an app that is only used in the Netherlands <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://vdcruijsen.net/images/7b8274329805_7294/wlEmoticon-smile.png" /></p>
<p>I fixed the bug but had to wait untill version 1.1 had passed certification before I could submit 1.2 Wednesday night 1.1 was approved and I immediately submitted 1.2. Today I received another mail from Microsoft that 1.2 also passed certification. From now on everyone should be able to use PinPin!</p>
<p>If you find any bug in version 1.2 please let me know and I’ll try to fix it asap again. </p>
<p>It can take a while before you’ll get the 1.2 update notification from your phone but you could also manually uninstall your current PinPin installation and reinstall from the marketplace you’ll download version 1.2.</p>
<p>Big thanks to Marco and everyone else who has send feedback concerning this bug. Hopefully you can enjoy PinPin now and if you do don’t try to rate and review the app, it only takes a few seconds!</p>
<p>&#160;</p>
<table border="0" cellspacing="0" cellpadding="2" width="542">
<tbody>
<tr>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/7b8274329805_7294/1_thumb.png"><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="1_thumb" border="0" alt="1_thumb" src="http://vdcruijsen.net/images/7b8274329805_7294/1_thumb_thumb.png" width="150" height="244" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/7b8274329805_7294/2_thumb.png"><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="2_thumb" border="0" alt="2_thumb" src="http://vdcruijsen.net/images/7b8274329805_7294/2_thumb_thumb.png" width="150" height="244" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/7b8274329805_7294/4_thumb2.png"><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="4_thumb2" border="0" alt="4_thumb2" src="http://vdcruijsen.net/images/7b8274329805_7294/4_thumb2_thumb.png" width="150" height="244" /></a></td>
</tr>
</tbody>
</table>
<p>Oh and if you didn’t have PinPin yet, you can download it here:</p>
<p><a href="http://windowsphone.com/s?appid=0f9ec45e-a5b9-4dbf-b33f-6917a7a44e44"><img style="margin: 4px auto; display: block; float: none" title="Download PinPin for WP7" border="0" alt="Download PinPin for WP7" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/WP7_App_Download.png" width="152" height="50" /></a></p>
<p>&#160;</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=PinPin+1.2+update+now+available+in+the+WP7+Marketplace&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F08%2Fpinpin-1-2-update-now-available-in-the-wp7-marketplace%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=PinPin+1.2+update+now+available+in+the+WP7+Marketplace&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F08%2Fpinpin-1-2-update-now-available-in-the-wp7-marketplace%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=PinPin+1.2+update+now+available+in+the+WP7+Marketplace&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F08%2Fpinpin-1-2-update-now-available-in-the-wp7-marketplace%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F08%2Fpinpin-1-2-update-now-available-in-the-wp7-marketplace%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/08/pinpin-1-2-update-now-available-in-the-wp7-marketplace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing: PinPin for Windows Phone 7</title>
		<link>http://vdcruijsen.net/2011/07/introducing-pinpin-for-windows-phone-7/</link>
		<comments>http://vdcruijsen.net/2011/07/introducing-pinpin-for-windows-phone-7/#comments</comments>
		<pubDate>Tue, 26 Jul 2011 14:24:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[PinPin]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[WP7 Mango]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/?p=119</guid>
		<description><![CDATA[I’m proud to announce my 2nd Windows Phone 7 application available in the marketplace. The new app is called PinPin and is an app to locate an ATM near your location. The app is really simple at this first release, &#8230; <a href="http://vdcruijsen.net/2011/07/introducing-pinpin-for-windows-phone-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’m proud to announce my <a href="http://sociallookout.vdcruijsen.net/">2nd</a> Windows Phone 7 application available in the marketplace. The new app is called PinPin and is an app to locate an ATM near your location. The app is really simple at this first release, just open the app and the app will retrieve ATM location information near your GPS location.</p>
<p>At this moment PinPin only works if you are located in the Netherlands because there is no worldwide ATM location data available. I’m still looking for this data so if someone knows where to get this please let me know.</p>
<p><img style="background-image: none; margin: 4px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="PinPin" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/200.png" alt="PinPin Logo" width="200" height="200" border="0" /></p>
<p>Below are some screenshots of the application:</p>
<table width="542" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/1_3.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="1" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/1_thumb_3.png" alt="1" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/2_3.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="2" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/2_thumb_3.png" alt="2" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/3_3.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="3" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/3_thumb_3.png" alt="3" width="148" height="244" border="0" /></a></td>
</tr>
<tr>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/4_4.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="4" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/4_thumb_4.png" alt="4" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/5.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="5" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/5_thumb.png" alt="5" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/6.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="6" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/6_thumb.png" alt="6" width="148" height="244" border="0" /></a></td>
</tr>
<tr>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/7_3.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="7" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/7_thumb_3.png" alt="7" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"><a href="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/8_4.png"><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="8" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/8_thumb_4.png" alt="8" width="148" height="244" border="0" /></a></td>
<td valign="top" width="180"></td>
</tr>
</tbody>
</table>
<p>PinPin is available for FREE in the Windows Phone marketplace. download it by clicking the button below:</p>
<p><a href="http://windowsphone.com/s?appid=0f9ec45e-a5b9-4dbf-b33f-6917a7a44e44"><img style="background-image: none; margin: 4px auto; padding-left: 0px; padding-right: 0px; display: block; float: none; padding-top: 0px; border-width: 0px;" title="Download PinPin for WP7" src="http://vdcruijsen.net/images/Introducing-PinPin-for-Windows-Phone-7_12F99/WP7_App_Download.png" alt="Download PinPin for WP7" width="152" height="50" border="0" /></a></p>
<p>Special Thanks to <a href="http://chris-online.nl">Christiaan Veeningen</a> for telling me to build this app <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If like or dislike the app please let me know by rating the app or by submitting a review. You can also contact me through twitter <a href="http://twitter.com/geertvdc">@geertvdc</a> or leave a comment here on my blog.</p>
<p>This is currently the first release of PinPin. I have more plans for the app in the future, here is a roadmap of what to come:</p>
<ul>
<li>Add Dutch language</li>
<li>Get Directions (Will have to wait for Mango)</li>
<li>Add more Bank logo’s</li>
<li>Add more countries</li>
<li>Review Comments I get from you!</li>
</ul>
<p>Hopefully you’ll enjoy this new app!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Introducing%3A+PinPin+for+Windows+Phone+7&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fintroducing-pinpin-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Introducing%3A+PinPin+for+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fintroducing-pinpin-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Introducing%3A+PinPin+for+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fintroducing-pinpin-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fintroducing-pinpin-for-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/07/introducing-pinpin-for-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WP7 App hub error: The [NeutralResourceLanguage] attribute is missing on the entry assembly. (2003)</title>
		<link>http://vdcruijsen.net/2011/07/wp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003/</link>
		<comments>http://vdcruijsen.net/2011/07/wp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 19:03:39 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[App hub]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/2011/07/wp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003/</guid>
		<description><![CDATA[Today the Microsoft Windows Phone 7 App Hub got a makeover. My new app was ready for deployment yesterday so logging into the new App hub to deploy my app today was the plan. After uploading my .xap file the &#8230; <a href="http://vdcruijsen.net/2011/07/wp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today the Microsoft Windows Phone 7 App Hub got a makeover. My new app was ready for deployment yesterday so logging into the new App hub to deploy my app today was the plan.</p>
<p>After uploading my .xap file the app hub told me the “NeatralResourceLanguage” attribute was missing with the following error:</p>
<p><span style="font-family: Consolas;">The [NeutralResourceLanguage] attribute is missing on the entry assembly. (2003)</span></p>
<p>Not sure what this error means I started looking in Visual Studio. and found the solution for the problem.</p>
<ul>
<li>In Visual Studio 2010 rightclick your project and choose properties</li>
<li>At the application tab click the “Assembly information…” button</li>
<li>Fill the Neutral Language in the popup</li>
<li>Press ok!</li>
<li>You’re ready to go!</li>
</ul>
<p><img style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" src="http://vdcruijsen.net/images/WP7-app-hub-error-The-NeutralResou.-2003_12270/image.png" alt="image" width="315" height="304" border="0" /></p>
<p>It seems that the new App hub Checks up on more things than the old App hub did. The neutral language is probably something a lot of people will forget so hopefully this helps others who are receiving this error.</p>
<p>The Assembly information can also be changed manually the following way:</p>
<ul>
<li>Open the properties directory in your WP7 project</li>
<li>Open the AssemblyInfo.cs file</li>
<li>Add the following line at the end of the file:</li>
</ul>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">[assembly: NeutralResourcesLanguage(<span style="color: #006080;">"en-US"</span>)]</pre>
<p>you’ll also need to add the following line at the top:</p>
</div>
<div id="codeSnippetWrapper">
<pre id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff;">using</span> System.Resources;</pre>
<p>&nbsp;</p>
<p>Happy developing and deploying!</p>
</div>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=WP7+App+hub+error%3A+The+%5BNeutralResourceLanguage%5D+attribute+is+missing+on+the+entry+assembly.+%282003%29&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fwp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=WP7+App+hub+error%3A+The+%5BNeutralResourceLanguage%5D+attribute+is+missing+on+the+entry+assembly.+%282003%29&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fwp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=WP7+App+hub+error%3A+The+%5BNeutralResourceLanguage%5D+attribute+is+missing+on+the+entry+assembly.+%282003%29&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fwp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fwp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/07/wp7-app-hub-error-the-neutralresourcelanguage-attribute-is-missing-on-the-entry-assembly-2003/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>My Windows Phone 7 Mango Beta review</title>
		<link>http://vdcruijsen.net/2011/07/my-windows-phone-7-mango-beta-review/</link>
		<comments>http://vdcruijsen.net/2011/07/my-windows-phone-7-mango-beta-review/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 19:57:11 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Mango]]></category>
		<category><![CDATA[WP7]]></category>
		<category><![CDATA[WP7 Mango]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/index.php/2011/07/05/my-windows-phone-7-mango-beta-review/</guid>
		<description><![CDATA[The beta of Windows Phone 7.1 codename “Mango” was released last week and in this post I’ll write down my experiences with Mango that I had using it since the launch of the beta. I’ll try to update this post &#8230; <a href="http://vdcruijsen.net/2011/07/my-windows-phone-7-mango-beta-review/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The beta of Windows Phone 7.1 codename “Mango” was released last week and in this post I’ll write down my experiences with Mango that I had using it since the launch of the beta.</p>
<p>I’ll try to update this post when I bump into stuff I didn’t write about yet.This post isn’t about describing all new stuff since there are already dozens of <a href="http://www.engadget.com/2011/06/27/windows-phone-7-5-mango-in-depth-preview-video/">other great blog posts about</a> that but I’ll try to write my opinions about how these features are working out or what I am still really missing in Mango.</p>
<p><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="WP7-Mango" border="0" alt="WP7-Mango" src="http://vdcruijsen.net/images/My-Windows-Phone-7-Mango-Beta-review_1219A/WP7-Mango.jpg" width="240" height="181" /></p>
<p>&#160;</p>
<p><strong>Lots of small features that make your life easier:</strong></p>
<p>One of the things I enjoy the most about Mango are the small things that really annoyed me with the 7.0 release of Windows Phone 7, for example the shutdown button that automatically turned of your phone even when the phone is locked. Now in Mango you have to slide down after pressing the power button so no more turning off your phone by accident. Also there is an option to set the pin timeout a bit longer so you don’t have to type in your pin every time you want to use your phone (15 minutes is max when you have policies applied). </p>
<p>One small feature I didn’t read about but seems missing is setting up the mail sync times. On my old phone I used to sync mail automatically with push mail between 7:00 and 23:00 so my phone wouldn’t make so much noise when it’s next to my bed when I’m sleeping. I haven’t found this feature so I think this is a big miss for the Mango release.</p>
<p>&#160;</p>
<p><strong>More Social:</strong></p>
<p>Facebook integration was already great in 7.0 but it just got even better. The threading functionality sounds great but for some reason with US/English and Dutch live accounts something doesn’t seem to work. I really can’t wait for this to start working because seeing this in the movies is so nice!</p>
<p>The “Me” live tile became a lot more useful in Mango because you can get messages in the tile about new updates you have on Facebook. also when clicking on the tile you can use Facebook check in with only a few finger presses. </p>
<p>The use of groups is also added in Mango but I haven’t used this yet. I can keep up with my social updates but maybe this will change when twitter will start working in the retail version of Windows Phone 7.1 (In the Mango Beta twitter integration is not yet available).</p>
<p>Other integration will also be available like LinkedIn but this doesn’t seem to work for me in the Beta either.</p>
<p>&#160;</p>
<p><strong>Dutch Language:</strong></p>
<p>Up until now I only had the English language available which is ok if you only type in English. Since 50% of my communication is in Dutch I really enjoy the added Dutch dictionary added in Mango!</p>
<p>&#160;</p>
<p><strong>Bing!</strong></p>
<p>Before Mango I can’t say I actually used the Bing button other then pressing it by accident. but now 4 new cool features are added that seem to work really good. One of the features that I was really looking forward to is “Bing Vision”. With Bing Vision you can scan barcodes, qr codes, text but also books, cd’s and dvd’s. When you can a book you can automatically open apps like amazon to order this book or get more info about the book. Really great!</p>
<p>&#160;</p>
<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:250485b3-05b2-4c3b-a74b-fe52528289c2" class="wlWriterEditableSmartContent">
<div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/Qq0yVxoVY1w?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/Qq0yVxoVY1w?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div>
</div>
<p>Besides Bing Vision there is also a button to listen to music like Shazam did in 7.0. Now this feature is build in and is working pretty good. There is also a “Nearby” feature added to Bing to get nearby restaurants, things to see, hotspots etc but there is no Dutch content yet so I only get the nearest locations in Germany…. </p>
<p>The last option that is added to Bing is the voice to text search. but I don’t really see the big use of this. when I tested it it made a lot of mistakes and in the same time I could write it.</p>
<p>&#160;</p>
<p><strong>IE9:</strong></p>
<p>What can I say… the old browser in wp7 was a disaster. All other mobile browsers were far superior but now IE9 mobile uses the exact same rendering engine as the desktop version so it is a great improvement. It can render HTML5. has more screen space because the address bar is moved to the bottom (Would hope there would be an option to hide it though to get even more space when reading for example). also when browsing in landscape mode you can now use the address bar which wasn’t possible in 7.0.&#160; You can now also pin websites to your homescreen for fast access to certain websites you use often.</p>
<p>&#160;</p>
<p><strong>7.1 apps:</strong></p>
<p>I have seen a lot of movies and demo’s about cool apps using Mango features but there is no possibility to test those myself except for writing your own apps of course (which I will do!) I do have really high expectations about these apps and all the new features</p>
<p>&#160;</p>
<p><strong>To do:</strong></p>
<p>One major issue a lot of people were missing are tasks but now this is added to your calendar hub and can be synced with exchange.</p>
<p>&#160;</p>
<p><strong>Games hub:</strong></p>
<p>I’ve read a lot about new features in the games hub and the integration with Xbox live but since my Xbox Gamer tag live id is Dutch it’s not possible to use this yet. The list of games is cleaned up though and is looking a lot better than it did in 7.0</p>
<p>&#160;</p>
<p><strong>What is not in but needs to be in?</strong></p>
<p>The one super major thing I really need is Tethering. I can understand not all providers can appreciate this feature but I used it on windows mobile 6.5 and now with the same provider I can’t use it anymore. that’s a bit shame!</p>
<p>the other thing I already mentioned and that is setting up times to sync your stuff and times it shouldn’t but it seems I’m the only one wanting this feature <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>Loads more is in!</strong></p>
<p>Steve Balmer promised us 500 new features so I only touched on this a little but but I hope you enjoyed reading my first opinions about Mango and the Beta. I see a bright feature for WP7 </p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=My+Windows+Phone+7+Mango+Beta+review&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fmy-windows-phone-7-mango-beta-review%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=My+Windows+Phone+7+Mango+Beta+review&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fmy-windows-phone-7-mango-beta-review%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=My+Windows+Phone+7+Mango+Beta+review&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fmy-windows-phone-7-mango-beta-review%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F07%2Fmy-windows-phone-7-mango-beta-review%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/07/my-windows-phone-7-mango-beta-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating your own customizable tabs / carousel plugin for jQuery</title>
		<link>http://vdcruijsen.net/2011/03/creating-your-own-customizable-tabs-carousel-plugin-with-jquery/</link>
		<comments>http://vdcruijsen.net/2011/03/creating-your-own-customizable-tabs-carousel-plugin-with-jquery/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 21:23:18 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/index.php/2011/03/02/creating-your-own-customizable-tabs-carousel-plugin-with-jquery/</guid>
		<description><![CDATA[Yesterday I was browsing the web for a tabs or carousel plugin for jQuery that fitted my needs. I wanted a simple but highly customizable control for displaying tabs which could also automatically page like a carousel. I found a &#8230; <a href="http://vdcruijsen.net/2011/03/creating-your-own-customizable-tabs-carousel-plugin-with-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was browsing the web for a tabs or carousel plugin for jQuery that fitted my needs. I wanted a simple but highly customizable control for displaying tabs which could also automatically page like a carousel. I found a lot of different plugins for JQuery but none fitted my exact needs. So I created my own in only 17 lines of javascript. this blog post describes how I did it and how you can use it on your website.</p>
<p>&#160;</p>
<p>first of all of course is a demo. You can can check it here: <a title="http://www.vdcruijsen.net/demo/jquerycarousel/carouseldemo.html" href="http://www.vdcruijsen.net/demo/jquerycarousel/carouseldemo.html">http://www.vdcruijsen.net/demo/jquerycarousel/carouseldemo.html</a></p>
<p>so how does this work? We’ll start with the HTML used for the carousel:
<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: 96.96%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 326px; 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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">=&quot;carousel&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;carouselbody&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ul</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;carouselcontainer&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;page&quot;</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:400px; height:300px; background-color:Green&quot;</span><span style="color: #0000ff">&gt;</span>test tab 1<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span>                           </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;page&quot;</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:400px; height:300px; background-color:Red&quot;</span><span style="color: #0000ff">&gt;</span>test tab 2<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span>                           </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;page&quot;</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:400px; height:300px; background-color:Orange&quot;</span><span style="color: #0000ff">&gt;</span>test tab 3<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span>                           </pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;page&quot;</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">style</span><span style="color: #0000ff">=&quot;width:400px; height:300px; background-color:Blue&quot;</span><span style="color: #0000ff">&gt;</span>test tab 4<span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ul</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">ul</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;pager&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">a</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;pagerpage&quot;</span> <span style="color: #ff0000">href</span><span style="color: #0000ff">=&quot;#&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #ff0000">&amp;nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">a</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">a</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;pagerpage&quot;</span> <span style="color: #ff0000">href</span><span style="color: #0000ff">=&quot;#&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #ff0000">&amp;nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">a</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">a</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;pagerpage&quot;</span> <span style="color: #ff0000">href</span><span style="color: #0000ff">=&quot;#&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #ff0000">&amp;nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">a</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">&lt;</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;&lt;</span><span style="color: #800000">a</span> <span style="color: #ff0000">class</span><span style="color: #0000ff">=&quot;pagerpage&quot;</span> <span style="color: #ff0000">href</span><span style="color: #0000ff">=&quot;#&quot;</span><span style="color: #0000ff">&gt;</span><span style="color: #ff0000">&amp;nbsp;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">a</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">li</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ul</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span></pre>
<p><!--CRLF--></div>
</p></div>
</p>
<p>The HTML is actually pretty easy, The first div is a container with an id called carousel so the script knows what belongs to the carousel and what not. you can set a height and width on this div to size your carousel. The carousel div contains 2 main parts. the carouselbody a container for all the carousel pages and the pager where you can define your pager links. this pager can also be put before the carouselbody if you want the pager or tabs above your pages. </p>
<p>The carouselbody has a unordered list containing all the actual pages. all the list items are shown have a css class called page so the script knows that inside is the content for a page. in the list item I’ve put some div with inline styling to show that you can put whatever you want inside this page list item.</p>
<p>the pager has links which have a pagerpage class. the script will automatically match the first available pagerpage link to the first page etc. </p>
<p>Below is the css I used in the demo. you can customize this to set pictures for the paging mechanism or set heights, colors etc. this current css is just an example. (some display elements are needed though, its best to start of with the supplied css and change it to your likings.)</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel { <span style="color: #0000ff">height</span>: <span style="color: #006080">400px;</span> <span style="color: #0000ff">overflow</span>:<span style="color: #006080">hidden;</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.carouselbody</span> { <span style="color: #0000ff">float</span>: <span style="color: #006080">left;</span> <span style="color: #0000ff">width</span>: <span style="color: #006080">400px;</span> <span style="color: #0000ff">height</span>: <span style="color: #006080">360px;</span> <span style="color: #0000ff">overflow</span>: <span style="color: #006080">hidden;</span> <span style="color: #0000ff">position</span>: <span style="color: #006080">relative;</span> <span style="color: #0000ff">background-color</span>:<span style="color: #006080">#212020;</span>}</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.carouselcontainer</span> { <span style="color: #0000ff">list-style</span>: <span style="color: #006080">none;</span> <span style="color: #0000ff">padding</span>: <span style="color: #006080">0px;</span> <span style="color: #0000ff">margin</span>: <span style="color: #006080">0px;</span>  <span style="color: #0000ff">position</span>: <span style="color: #006080">absolute;</span> <span style="color: #0000ff">left</span>: 0; <span style="color: #0000ff">top</span>: 0; }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.carouselcontainer</span> <span style="color: #0000ff">li</span>{ <span style="color: #0000ff">float</span>: <span style="color: #006080">left;</span> <span style="color: #0000ff">margin</span>: <span style="color: #006080">0px ;</span> <span style="color: #0000ff">border-width</span>: <span style="color: #006080">0px;</span>}</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.pager</span> { <span style="color: #0000ff">overflow</span>:<span style="color: #006080">hidden;</span> <span style="color: #0000ff">list-style</span>: <span style="color: #006080">none;</span> <span style="color: #0000ff">clear</span>: <span style="color: #006080">both;</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.pager</span> <span style="color: #0000ff">li</span> { <span style="color: #0000ff">float</span>: <span style="color: #006080">left;</span> }</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.page</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">display</span>:<span style="color: #006080">none;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.currentpage</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">display</span>:<span style="color: #006080">block;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.pagerpage</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">margin</span>-<span style="color: #0000ff">left</span>:<span style="color: #006080">2px;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">background-image</span>:url('/Content/images/pager2<span style="color: #cc6633">.png</span>');</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">width</span>: <span style="color: #006080">20px;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">height</span>: <span style="color: #006080">20px;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">display</span>:<span style="color: #006080">block;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">text-decoration</span>:<span style="color: #006080">none;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">#carousel <span style="color: #cc6633">.currentpagerpage</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">background-image</span>:url('/Content/images/pager<span style="color: #cc6633">.png</span>');</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">text-decoration</span>:<span style="color: #006080">none;</span></pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<p>So now the HTML and CSS is explained its on to the actual jQuery script which makes all this magic happen. You only need 1 line to change a div to a working carousel if you also include the other script pieces somewhere on the page. the line to add in your script that is executed on document.ready is the following:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">$(<span style="color: #006080">&quot;#carousel&quot;</span>).carousel();</pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<p>this method will of course only work if the carousel method is available. This is added through the following code:</p>
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#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">
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">$.fn.carousel = <span style="color: #0000ff">function</span> (options) {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">var</span> defaults = {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        start: 0</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    };</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">var</span> options = $.extend(defaults, options);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">&quot;.page:eq(&quot;</span> + (options.start) + <span style="color: #006080">&quot;)&quot;</span>).addClass(<span style="color: #006080">&quot;currentpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">&quot;.pagerpage:eq(&quot;</span> + (options.start) + <span style="color: #006080">&quot;)&quot;</span>).addClass(<span style="color: #006080">&quot;currentpagerpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">&quot;.pagerpage&quot;</span>).bind(<span style="color: #006080">&quot;click&quot;</span>, <span style="color: #0000ff">function</span> () {</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        $(<span style="color: #0000ff">this</span>).parents(<span style="color: #006080">&quot;.pager&quot;</span>).find(<span style="color: #006080">&quot;.currentpagerpage&quot;</span>).removeClass(<span style="color: #006080">&quot;currentpagerpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        $(<span style="color: #0000ff">this</span>).parents(<span style="color: #006080">&quot;#carousel&quot;</span>).find(<span style="color: #006080">&quot;.currentpage&quot;</span>).removeClass(<span style="color: #006080">&quot;currentpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        $(<span style="color: #0000ff">this</span>).addClass(<span style="color: #006080">&quot;currentpagerpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">var</span> index = $(<span style="color: #0000ff">this</span>).parent().index();</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">        $(<span style="color: #0000ff">this</span>).parents(<span style="color: #006080">&quot;#carousel&quot;</span>).find(<span style="color: #006080">&quot;.page:nth-child(&quot;</span> + (index + 1) + <span style="color: #006080">&quot;)&quot;</span>).addClass(<span style="color: #006080">&quot;currentpage&quot;</span>);</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">    });</pre>
<p><!--CRLF--></p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px">};</pre>
<p><!--CRLF--></div>
</div>
<p>&#160;</p>
<p>the $.fn.carousel line makes the carousel method available in the rest of your jQuery code. I’ve added some options as an example to make the carousel start at a different page.</p>
<p>the first thing the script does is searching for the page on which it should start and adds the currentpage css class to this page so the page becomes visible. The script does the same for the active pager item.</p>
<p>after this the script binds click events to the pager links so the pager links can do their work when they are clicked. on each click event the current page is made invisible by removing the currentpage css class and after it puts the current page css class on the newly selected page.. that’s all <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>&#160;</p>
<p>Hopefully this code is something you can use on your own website or otherwise learn from it or use pieces of it.</p>
<p>&#160;</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Creating+your+own+customizable+tabs+%2F+carousel+plugin+for+jQuery&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F03%2Fcreating-your-own-customizable-tabs-carousel-plugin-with-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Creating+your+own+customizable+tabs+%2F+carousel+plugin+for+jQuery&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F03%2Fcreating-your-own-customizable-tabs-carousel-plugin-with-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Creating+your+own+customizable+tabs+%2F+carousel+plugin+for+jQuery&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F03%2Fcreating-your-own-customizable-tabs-carousel-plugin-with-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F03%2Fcreating-your-own-customizable-tabs-carousel-plugin-with-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/03/creating-your-own-customizable-tabs-carousel-plugin-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virtual conference MVCConf 2011</title>
		<link>http://vdcruijsen.net/2011/02/virtual-conference-mvcconf-2011/</link>
		<comments>http://vdcruijsen.net/2011/02/virtual-conference-mvcconf-2011/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 18:50:14 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Asp.net MVC]]></category>
		<category><![CDATA[conference]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/index.php/2011/02/09/virtual-conference-mvcconf-2011/</guid>
		<description><![CDATA[Yesterday MVCConf 2011 was held. MVCConf is a virtual conference about ASP.NET MVC and since ASP.NET MVC 3 has shipped a few weeks ago there was a lot to talk about. The conference is organized by the community and there &#8230; <a href="http://vdcruijsen.net/2011/02/virtual-conference-mvcconf-2011/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><html xmlns=""></p>
<p$1$2$3$4$5$6>
<p>Yesterday MVCConf 2011 was held. MVCConf is a virtual conference about ASP.NET MVC and since ASP.NET MVC 3 has shipped a few weeks ago there was a lot to talk about. The conference is organized by the community and there are a lot of speakers from the Community as well as from Microsoft.</p>
<p>Some videos are online already at <a href="http://www.mvcconf.com/live">www.mvcconf.com/live</a> but all videos are coming online later at the <a href="http://www.mvcconf.com">www.mvcconf.com</a> site.</p>
<p>Since I’m an ASP.NET MVC fanatic I’ve used my free evening to watch the sessions and will view more tomorrow.</p>
<p><img title="mvcconf" width="457" style="background-image: none; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" src="http://vdcruijsen.net/images/MVCConf_13A52/mvcconf.png" border="0" alt="mvcconf" height="97" /></p>
<p>Sessions I watched:</p>
<p><strong>Keynote by Scott Guthrie</strong> <a href="http://www.twitter.com/scottgu">@scottgu</a></p>
<p>Scott talked about the history of ASP.NET MVC 3 and the older versions (ofcourse everyone knows he wrote version 1 during a single flight from his home to some conference a few years ago) and held an interactive session where people could ask questions using twitter. He talked about the difference of webforms and mvc ofcourse since this is a question that is always asked when talking about mvc on a high level. He noted again that webforms, webmatrix and MVC will all exist next to each other in the future and serve different purposes. to make this more clear he gave 3 keywords for all methods of building ASP.NET applications</p>
<p>WebMatrix</p>
<ul>
<li>Simple</li>
<li>Light</li>
<li>Fast</li>
</ul>
<p>Web Forms</p>
<ul>
<li>Familiar</li>
<li>Reusable</li>
<li>Productive</li>
</ul>
<p>MVC</p>
<ul>
<li>Powerfull</li>
<li>Extensible</li>
<li>Agile</li>
</ul>
<p>Other things he talked about is the focus of Microsoft on JQuery. Microsoft added JQuery to the MVC 1.0 and in 3.0 they even switched completely to JQuery when you look at all examples etc. Microsoft is also actively helping in creating a new JQuery plugin for the JQuery Datatable. this is something I would really like to see!!</p>
<p>Scott also told us about project Orchard which is a new open source CMS project by Microsoft. this is also looking really promising. Another thing Scott talked about really quick was an Asset management system for CSS and JS functions / snippets. more to come about this in the future. (he wasn’t supposed to say anything about this.)</p>
<p>Finally he talked about large sites running ASP.NET MVC. He couldn’t tell a lot about this since he didn’t know which company liked him saying their technology choices. but some examples he did tell were bing.com and other microsoft sites. other examples people on twitter added are the channel 9 site, stackoverflow.com and cheezburger.com <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p$1$2$3$4$5$6>
<p><strong>Phil Haack on nuget</strong> <a href="http://www.twitter.com/haacked">@haacked</a></p>
<p>Phil talked on Microsoft opensource project nuget by showing how you use it in visual studio using the extension manager and the console. I think most people have already seen and used nuget but this session went deeper. phil showed us how to create packages and how to use advanced functions the console. Something that was new to me he showed us is the local repository you can add in nuget. I’m going to have another look at this later so we can use it within our company.</p>
<p>after this he showed us how nuget is working under the hood. All in all a really nice session for me.</p>
<p$1$2$3$4$5$6>
<p><strong>Brad Wilson on “Advanced MVC 3.0”</strong> <a href="http://www.twitter.com/bradwilson">@bradwilson</a></p>
<p>Brad talked on some advanced topics of MVC 3.0. It’s hard to do a recap on this one since it’s a lot of stuff. some things were really interesting. he started off with statefull filters to show how to use filters per request, per session or per applications. after this he talked about validation with unobstructive Ajax with Jquery. very interesting!!</p>
<p>He also talked about how to use different kinds of objects as classes for your model and about routing constraints.</p>
<p>If you are a more advanced MVC developer this is a session you shouldn’t miss.</p>
<p$1$2$3$4$5$6>
<p><strong>Steve Sanderson on MVC Scaffolding</strong> <a href="http://twitter.com/stevesanderson">@stevesanderson</a></p>
<p>Steve talked about the opensource project MVC Scaffolding. The original idea for this came from the Ruby community where people wanted to generate simple crud forms and the database itself from the model classes. Steve has created a package which you can get with nuget to have this in ASP.NET MVC 3.0.</p>
<p>Phil showed a quick sample of this on his nuget presentation and Steve also showed an example where he automatically generated everything using the repository pattern so you get a nice decoupled scenario without typing any code. after this he showed more complex situations. for more info check this blogpost:</p>
<p><a title="http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/" href="http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/">http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/</a></p>
<p$1$2$3$4$5$6>
<p>Other sessions I haven’t watched yet but will do later are:</p>
<p><strong>BDD in ASP.NET MVC using SpecFlow, WatiN and WatiN Test Helpers </strong>by Brandon Satrom</p>
<p><strong>Quality Driven Web Acceptance Testing </strong>by amir Barylko</p>
<p><strong>WebMatrix</strong> by Rob Conery</p>
<p><strong>Entity Framework &#8220;Code First&#8221;: Domain Driven CRUD</strong> by Chris Zavaleta</p>
<p$1$2$3$4$5$6>
<p>I really enjoyed the sessions. MVCConf and all speakers thanks and hopefully I’ll be able to join MVCConf 2012 again next year.</p>
<p>When all video’s are up I’ll edit the post with the links to the videos</p>
<p$1$2$3$4$5$6>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Virtual+conference+MVCConf+2011&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F02%2Fvirtual-conference-mvcconf-2011%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Virtual+conference+MVCConf+2011&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F02%2Fvirtual-conference-mvcconf-2011%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Virtual+conference+MVCConf+2011&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F02%2Fvirtual-conference-mvcconf-2011%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F02%2Fvirtual-conference-mvcconf-2011%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/02/virtual-conference-mvcconf-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the WP7 system color in live tiles and application icon</title>
		<link>http://vdcruijsen.net/2011/01/using-the-wp7-system-color-in-live-tiles-and-application-icon/</link>
		<comments>http://vdcruijsen.net/2011/01/using-the-wp7-system-color-in-live-tiles-and-application-icon/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 19:28:49 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://www.vdcruijsen.net/index.php/2011/01/11/using-the-wp7-system-color-in-live-tiles-and-application-icon/</guid>
		<description><![CDATA[I’m currently building my first WP7 application for a contest that is held by Avanade Netherlands for all its employees. Who can create the best app in a small amount of time. My app is almost finished and I was &#8230; <a href="http://vdcruijsen.net/2011/01/using-the-wp7-system-color-in-live-tiles-and-application-icon/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I’m currently building my first WP7 application for a contest that is held by Avanade Netherlands for all its employees. Who can create the best app in a small amount of time.</p>
<p>My app is almost finished and I was trying to set up the live tile and application icon. Of course I wanted to use the system color which the user has selected to display on the background of my live tile. How to do this? here is how, it is actually quite simple.</p>
<p>when you open your solution you’ll automatically get your background.png and applicationicon.png. both icons have a black/greyish background. like shown in the example below.</p>
<p><a href="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile1.png"><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="livetile1" border="0" alt="livetile1" src="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile1_thumb.png" width="136" height="244" /></a></p>
<p>to switch the background to use the system color follow the following steps:</p>
<ul>
<li>Open up your background.png in any decent image editing tool like Paint.net. </li>
<li>Use the magic marker to select the background </li>
</ul>
<p><a href="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/live-tile-selected.png"><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="live tile selected" border="0" alt="live tile selected" src="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/live-tile-selected_thumb.png" width="244" height="233" /></a></p>
<ul>
<li>press delete so you get a transparent background </li>
</ul>
<p>&#160;</p>
<p><a href="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/live-tile-deleted.png"><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="live tile deleted" border="0" alt="live tile deleted" src="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/live-tile-deleted_thumb.png" width="244" height="233" /></a></p>
<ul>
<li>save the icon back to your visual studio solution. </li>
<li>compile </li>
<li>enjoy! </li>
</ul>
<p>&#160;</p>
<p><a href="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile2.png"><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="livetile2" border="0" alt="livetile2" src="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile2_thumb.png" width="136" height="244" /></a><a href="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile3.png"><img style="background-image: none; border-right-width: 0px; margin: 4px 10px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="livetile3" border="0" alt="livetile3" src="http://vdcruijsen.net/images/Using-the-WP7-system-color-in-live-tiles_CBAA/livetile3_thumb.png" width="136" height="244" /></a></p>
<p>&#160;</p>
<p><u><font color="#ff0000">Ofcourse the next step would be to do the same for your application icon (the icon in the application list). </font></u></p>
<p><u><font color="#ff0000">I tried it and it didn’t work… after some research I found out that this is for Microsoft and official partners only.. Bummer!! </font></u></p>
<p>&#160;</p>
<p>Guess we are going to be stuck by using greyish application icons after all.. hopefully Microsoft will fix this in the future.</p>
<p>&#160;</p>
<p>Hopefully this post was helpful to you. In my opinion there are to few good resources to be found on WP7 development so every small thing helps.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Using+the+WP7+system+color+in+live+tiles+and+application+icon&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2011%2F01%2Fusing-the-wp7-system-color-in-live-tiles-and-application-icon%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Using+the+WP7+system+color+in+live+tiles+and+application+icon&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F01%2Fusing-the-wp7-system-color-in-live-tiles-and-application-icon%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Using+the+WP7+system+color+in+live+tiles+and+application+icon&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2011%2F01%2Fusing-the-wp7-system-color-in-live-tiles-and-application-icon%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2011%2F01%2Fusing-the-wp7-system-color-in-live-tiles-and-application-icon%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2011/01/using-the-wp7-system-color-in-live-tiles-and-application-icon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First impression of the HTC Trophy and Windows Phone 7</title>
		<link>http://vdcruijsen.net/2010/11/first-impression-of-the-htc-trophy-and-windows-phone-7/</link>
		<comments>http://vdcruijsen.net/2010/11/first-impression-of-the-htc-trophy-and-windows-phone-7/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 22:18:57 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Windows Phone 7]]></category>
		<category><![CDATA[Avanade]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[WP7]]></category>

		<guid isPermaLink="false">http://vdcruijsen.net/?p=55</guid>
		<description><![CDATA[A few weeks after the official release of windows phone 7 our entire company (Avanade Netherlands) moved to Windows phone 7. Every Employee (225) received a HTC Trophy today and tonight i&#8217;ve put my new phone to the test. Here &#8230; <a href="http://vdcruijsen.net/2010/11/first-impression-of-the-htc-trophy-and-windows-phone-7/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A few weeks after the official release of windows phone 7 our entire company (Avanade Netherlands) moved to Windows phone 7. Every Employee (225) received a HTC Trophy today and tonight i&#8217;ve put my new phone to the test. Here are my first impressions:</p>
<p><a href="http://vdcruijsen.net/wp-content/uploads/2010/11/image5.jpg"><img src="http://vdcruijsen.net/wp-content/uploads/2010/11/image5-300x168.jpg" alt="" title="HTC Trophy" width="300" height="168" class="alignnone size-medium wp-image-56" /></a></p>
<p>the hardware:</p>
<p>The phone is feeling really robust and the screen is looking really well. the captative screen works very good aswell. all menus and buttons are reacting really fast and Microsoft really did their best in getting the UI right.. And they did! After testing the Camera i have to say that this is probably the worst part of this phone. when it&#8217;s a bit dark the pictures get really bad. i also don&#8217;t like the &#8220;hardware&#8221;/tip buttons under the screen. ofcourse you dont need them that much but when i compare this to my girlfriends HTC Desire i have to say i prefer real hardware buttons.</p>
<p>booting it for the first time:</p>
<p>after booting it you get a small tutorial to set stuff up. i choose to skip the windows live id and to just get started. within 1 minute my phone was ready to go. I&#8217;ve started setting up my exchange mail since all my contacts/mail/agenda stuff is in there. the setup was also done really easy, just add an exchange account, add your username/password and press ok. everything just worked. after this i&#8217;ve added my facebook account. after i did that all contacts were synced and merged perfectly. my exchange contacts have facebook pictures etc. looking pretty slick.</p>
<p>After this i tried setting up my live id.. stubborn as i am i ofcourse added my dutch liveid to see what would happen.. first it would ofcourse sync my mail/contacts etc.. that was the positive part. then i tried to open the marketplace but that wasn&#8217;t working. i tried to deinstall the live id but that isn&#8217;t possible. so a hard reset was a fact <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  (within 5 minutes after i first touched it).</p>
<p>after playing with facebook/mail/apps etc i tried the most important thing a phone has to do: call someone. to make this extra hard i called someone while i was on my way home through my parrot carkit. some windows phone 6.5&#8242;s wouldnt even make this test but sound quality was really good with my new phone. also the ui of the call screen and contact screen  is really well thought off.</p>
<p>next try: setting up a US based live id and adding my dutch live id after. Perfect. i get all the contacts/agenda/mail from my dutch live id and i can get to the marketplace through my US live id.</p>
<p>ofcourse i had to set my facebook/exchange stuff again but that was done in a few minutes.</p>
<p>after playing around with it for a few hours this evening i have a pretty good feeling about this. my conclusions for now:</p>
<p>pro&#8217;s:</p>
<ul>
<li>WP7 is really responsive and intuitive</li>
<li>overall hardware is robust and looking nice</li>
<li>everything just works (except dutch live id&#8217;s )</li>
<li>most important thing calling works really good (nice contact screen, nice call screen)</li>
</ul>
<p>cons:</p>
<ul>
<li>camera is a bit flaky</li>
<li>power charge is on the side of the phone (i am left handed and can&#8217;t even hold it normally when the power cable is in&#8230;.)</li>
<li>Support for dutch marketplace / xbox live missing (will be there in april 2011)</li>
<li>no tethering (will come someday)</li>
</ul>
<p>i&#8217;ll update some more about the new phone after i&#8217;ve played with it a bit more after a few days (battery use for example)</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=First+impression+of+the+HTC+Trophy+and+Windows+Phone+7&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F11%2Ffirst-impression-of-the-htc-trophy-and-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=First+impression+of+the+HTC+Trophy+and+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F11%2Ffirst-impression-of-the-htc-trophy-and-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=First+impression+of+the+HTC+Trophy+and+Windows+Phone+7&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F11%2Ffirst-impression-of-the-htc-trophy-and-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F11%2Ffirst-impression-of-the-htc-trophy-and-windows-phone-7%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/11/first-impression-of-the-htc-trophy-and-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SharePoint Automatic prefilling of lookup fields in insert forms using JQuery</title>
		<link>http://vdcruijsen.net/2010/08/sharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery/</link>
		<comments>http://vdcruijsen.net/2010/08/sharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 18:37:36 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">/post/SharePoint-Automatic-prefilling-of-lookup-fields-in-insert-forms-using-JQuery.aspx</guid>
		<description><![CDATA[At my last project I was working on a SharePoint online solution and one of the requirements is to prefill some values at one of the insert forms for a list. Since this is SharePoint online and the only tool &#8230; <a href="http://vdcruijsen.net/2010/08/sharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>At my last project I was working on a SharePoint online solution and one of the requirements is to prefill some values at one of the insert forms for a list. Since this is SharePoint online and the only tool you can use to customize is SharePoint Designer I had to do this with JavaScript.</p>
<p>I’ll explain how to build it by an example. for example you have a list of customers and a list of customer actions. What I wanted to build was a way to make it easier to add a customer action for a specific customer. To do this I added a custom column to the customer list containing a link to the edit form with the customer id as an url variable. Of course the out of the box you can’t create links or any other html with calculated fields so I added more javascript there.</p>
<p>to enable html as output of a calculated field just copy this piece of javascript and put it in a content editor webpart or paste it on your master page.</p>
<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: &#39;Courier New&#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">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">var</span> theTDs = document.getElementsByTagName(<span style="color: #006080">&quot;TD&quot;</span>); </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">var</span> i=0; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">var</span> TDContent = <span style="color: #006080">&quot; &quot;</span>; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">while</span> (i &lt; theTDs.length)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{ </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  <span style="color: #0000ff">try</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  { </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    TDContent = theTDs[i].innerText || theTDs[i].textContent; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> ((TDContent.indexOf(<span style="color: #006080">&quot;&lt;DIV&quot;</span>) == 0) &amp;&amp; (TDContent.indexOf(<span style="color: #006080">&quot;&lt;/DIV&gt;&quot;</span>) &gt;= 0))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    { </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">      theTDs[i].innerHTML = TDContent; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    } </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  } </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  <span style="color: #0000ff">catch</span>(err){} </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  i=i+1; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">} </pre>
<p><!--CRLF--></div>
</div>
<p></p>
<p>Thanks Marijn Somers for this piece of code. original source: <a title="http://marijnsomers.blogspot.com/2010/01/write-html-code-in-sharepoint-via.html" href="http://marijnsomers.blogspot.com/2010/01/write-html-code-in-sharepoint-via.html">http://marijnsomers.blogspot.com/2010/01/write-html-code-in-sharepoint-via.html</a></p>
<p>so now my calculated field was a link in html. what did my calculated field look like?</p>
<p>=&quot;&lt;DIV&gt;&lt;a href=&#8217;../../Lists/CustomerActions/NewForm.aspx?Customer=&quot;&amp;[Customer ID]&amp;&quot;’&gt;Add Customer Action&lt;/a&gt;&lt;/DIV&gt;&quot;</p>
<p>First a DIV element since the javascript above only replaces elements starting with a &lt;DIV&gt; to html, then just a plain html link to the NewForm.aspx sending the customer id as an url parameter.</p>
<p>&#160;</p>
<p>So now the changes in the customer list are done and we only need to add some more javascript at the NewForm.aspx or again just at your masterpage to get the parameter from the url and selecting the right lookup field value at the form.</p>
<p>I’ve created the following code&#160; using Jquery:</p>
<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: &#39;Courier New&#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">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">var</span> customer = $.getUrlVar(<span style="color: #006080">&quot;Customer&quot;</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">if</span>(customer != <span style="color: #006080">&quot;&quot;</span>)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  $(<span style="color: #006080">&quot;input[title='Customer']&quot;</span>).val(customer);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  $(<span style="color: #006080">&quot;select[title='Customer']&quot;</span>).children(<span style="color: #006080">&quot;option&quot;</span>).each(<span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span>($(<span style="color: #0000ff">this</span>).text() == customer)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">      $(<span style="color: #0000ff">this</span>).attr(<span style="color: #006080">'selected'</span>, <span style="color: #006080">'selected'</span>); </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">  });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p></p>
<p>My customer actions list contained a Customer field which is a lookup to the Customer list by Customer ID. The script above gets the Customer ID from the url parameters first and then tries to set the lookup item. SharePoint renders lookup items in 2 different ways. as a select box when there are less then +/- 25 items and as a auto complete textbox when there are more then 25 items in the lookup list. Because of that I firs try to set the textbox to the right value and after that the select. I’m using the title attribute to locate the right input field because it gets the same name as the field from SharePoint by itself.</p>
<p>Now when I open the newform.aspx?customer=1234 my customer lookup field is automatically prefilled with 1234</p>
<p>&#160;</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=SharePoint+Automatic+prefilling+of+lookup+fields+in+insert+forms+using+JQuery&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F08%2Fsharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=SharePoint+Automatic+prefilling+of+lookup+fields+in+insert+forms+using+JQuery&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F08%2Fsharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=SharePoint+Automatic+prefilling+of+lookup+fields+in+insert+forms+using+JQuery&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F08%2Fsharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F08%2Fsharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/08/sharepoint-automatic-prefilling-of-lookup-fields-in-insert-forms-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using the SPContext in HttpModules in SharePoint</title>
		<link>http://vdcruijsen.net/2010/05/using-the-spcontext-in-httpmodules-in-sharepoint/</link>
		<comments>http://vdcruijsen.net/2010/05/using-the-spcontext-in-httpmodules-in-sharepoint/#comments</comments>
		<pubDate>Sun, 23 May 2010 17:20:06 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/post/Using-the-SPContext-in-HttpModules-in-SharePoint.aspx</guid>
		<description><![CDATA[When you are building custom HttpModules in SharePoint a common thing to do is to use the SPContext object to get acces to your SPSite, SPWeb, SPList or SPListItem. When doing this you have to be careful because the SPContext &#8230; <a href="http://vdcruijsen.net/2010/05/using-the-spcontext-in-httpmodules-in-sharepoint/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you are building custom HttpModules in SharePoint a common thing to do is to use the SPContext object to get acces to your SPSite, SPWeb, SPList or SPListItem. When doing this you have to be careful because the SPContext isn’t available everywhere because HttpModules can run early in the ASP.Net request pipeline so the SPContext object isn&#8217;t available yet.</p>
<p>if you try to acces the SPContext to early in the pipeline you’ll get a <strong>System.InvalidOperationException</strong> error.</p>
<p>The earliest you can use the SPContext is in the “PreRequestHandlerExecute” so don’t use it at the BeginRequest event what most people try to use when they want to add code as early in the pipeline as possible</p>
<p>code:</p>
<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: &#39;Courier New&#39;, courier, monospace; direction: ltr; height: 246px; 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">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> RequestHandlingHttpModule : IHttpModule, IRequiresSessionState</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> Dispose() {}</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> Init(HttpApplication application)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         application.BeginRequest += application_BeginRequest;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         application.PreRequestHandlerExecute += <span style="color: #0000ff">new</span> EventHandler(application_PreRequestHandlerExecute);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span>     <span style="color: #0000ff">void</span> application_PreRequestHandlerExecute(<span style="color: #0000ff">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum13">  13:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum14">  14:</span>         <span style="color: #0000ff">string</span> webUrl = SPContext.Current.Web.Url;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum15">  15:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum16">  16:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum17">  17:</span>     <span style="color: #0000ff">void</span> application_BeginRequest(<span style="color: #0000ff">object</span> sender, EventArgs e)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum18">  18:</span>     {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum19">  19:</span>         <span style="color: #008000">// do not use SPContext here it will throw a System.InvalidOperationException </span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum20">  20:</span>         <span style="color: #008000">// this event is fired before PreRequestHandlerExecute so code that doesn't uses SPContext goes here</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum21">  21:</span>     }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum22">  22:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum23">  23:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Using+the+SPContext+in+HttpModules+in+SharePoint&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fusing-the-spcontext-in-httpmodules-in-sharepoint%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Using+the+SPContext+in+HttpModules+in+SharePoint&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fusing-the-spcontext-in-httpmodules-in-sharepoint%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Using+the+SPContext+in+HttpModules+in+SharePoint&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fusing-the-spcontext-in-httpmodules-in-sharepoint%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fusing-the-spcontext-in-httpmodules-in-sharepoint%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/05/using-the-spcontext-in-httpmodules-in-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combined power of SharePoint and JQuery part 2: Changing the SharePoint webpart edit menu position</title>
		<link>http://vdcruijsen.net/2010/05/combined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position/</link>
		<comments>http://vdcruijsen.net/2010/05/combined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position/#comments</comments>
		<pubDate>Thu, 20 May 2010 20:55:35 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/post/Combined-power-of-SharePoint-and-JQuery-part-2-Changing-the-SharePoint-webpart-edit-menu-position.aspx</guid>
		<description><![CDATA[Have you ever had the problem using SharePoint 2007 that when you create small webpart zones that the edit button disappeared because the title of the webpart was to long? I ran into this problem at my current project and &#8230; <a href="http://vdcruijsen.net/2010/05/combined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Have you ever had the problem using SharePoint 2007 that when you create small webpart zones that the edit button disappeared because the title of the webpart was to long? I ran into this problem at my current project and instead of shortening down the titles i came up with the idea of changing the position of the edit button to be on the left of the title. when the button is on the left and the title is on the right the title will be trimmed automatically since the webpart zones have a fixed length.</p>
<p>In your server side code it’s really hard to change these kinds of things because this is standard SharePoint functionality and you can’t change it server side. So the solution is to fix it using javascript and to make that easier I’m using JQuery.</p>
<p>first I’ll show you the results below and then how I did it using a small JQuery script.</p>
<p>before:</p>
<p><a href="http://vdcruijsen.net/images/CombinedpowerofSharePointandJQuerypart2C_98D7/sharepointjquery1.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="sharepointjquery1" border="0" alt="sharepointjquery1" src="http://vdcruijsen.net/images/CombinedpowerofSharePointandJQuerypart2C_98D7/sharepointjquery1_thumb.png" width="234" height="97" /></a> </p>
<p>after:</p>
<p><a href="http://vdcruijsen.net/images/CombinedpowerofSharePointandJQuerypart2C_98D7/sharepointjquery2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="sharepointjquery2" border="0" alt="sharepointjquery2" src="http://vdcruijsen.net/images/CombinedpowerofSharePointandJQuerypart2C_98D7/sharepointjquery2_thumb.png" width="234" height="97" /></a> </p>
<p>Below is the JQuery script to change the position of the edit menu to the left. the only thing you have to do is save this code to a js file, include the reference to the js file and a reference to the JQuery library js file on your masterpage and you’re done.</p>
<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: &#39;Courier New&#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">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum1">   1:</span> $(document).ready(<span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum2">   2:</span>     SPEditMenuFix();</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum3">   3:</span> });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum4">   4:</span>&#160; </pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum5">   5:</span> <span style="color: #0000ff">function</span> SPEditMenuFix() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum6">   6:</span>     $(<span style="color: #006080">&quot;.ms-WPHeader&quot;</span>).each(<span style="color: #0000ff">function</span>() {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum7">   7:</span>         <span style="color: #0000ff">var</span> first = $(<span style="color: #0000ff">this</span>).children(<span style="color: #006080">&quot;td:first&quot;</span>).clone(<span style="color: #0000ff">true</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum8">   8:</span>         <span style="color: #0000ff">var</span> last = $(<span style="color: #0000ff">this</span>).children(<span style="color: #006080">&quot;td:last&quot;</span>).clone(<span style="color: #0000ff">true</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum9">   9:</span>         $(<span style="color: #0000ff">this</span>).children(<span style="color: #006080">&quot;td:first&quot;</span>).replaceWith(last);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum10">  10:</span>         $(<span style="color: #0000ff">this</span>).children(<span style="color: #006080">&quot;td:last&quot;</span>).replaceWith(first);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum11">  11:</span>     });</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #606060" id="lnum12">  12:</span> }</pre>
<p><!--CRLF--></div>
</div>
<p>Enjoy!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Combined+power+of+SharePoint+and+JQuery+part+2%3A+Changing+the+SharePoint+webpart+edit+menu+position&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fcombined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Combined+power+of+SharePoint+and+JQuery+part+2%3A+Changing+the+SharePoint+webpart+edit+menu+position&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fcombined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Combined+power+of+SharePoint+and+JQuery+part+2%3A+Changing+the+SharePoint+webpart+edit+menu+position&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fcombined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fcombined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/05/combined-power-of-sharepoint-and-jquery-part-2-changing-the-sharepoint-webpart-edit-menu-position/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated my weblog to DotNetBlogengine 1.6.1</title>
		<link>http://vdcruijsen.net/2010/05/updated-my-weblog-to-dotnetblogengine-1-6-1/</link>
		<comments>http://vdcruijsen.net/2010/05/updated-my-weblog-to-dotnetblogengine-1-6-1/#comments</comments>
		<pubDate>Wed, 19 May 2010 21:12:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">/post/Updated-my-weblog-to-DotNetBlogengine-161.aspx</guid>
		<description><![CDATA[Just before my vacation to Peru i noticed that i received a lot of spam in my comments on my blog. i was running DotNetBlogEngine 1.4.5 and the spamfilter seemed to be broken. I didn&#8217;t have time to fix it &#8230; <a href="http://vdcruijsen.net/2010/05/updated-my-weblog-to-dotnetblogengine-1-6-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Just before my vacation to Peru i noticed that i received a lot of spam in my comments on my blog. i was running DotNetBlogEngine 1.4.5 and the spamfilter seemed to be broken. I didn&#8217;t have time to fix it before my vacation so i disabled comments for a while. now that I&#8217;m back I upgraded to 1.6.1 which has build in functionality for Askismet and Recaptcha.</p>
<p>because&nbsp;I had so many spam comments I had to remove all of them so sorry for everyone who posted real comments because they are also gone now.</p>
<p>BlogEngine.Net 1.6.1 (<a href="http://blogengine.codeplex.com/releases/view/39387" target="_blank">download from codeplex</a>) feels like its a lot more mature then the 1.4.5 version I had before. Lets see how well it will go in the future.</p>
<p><a href="http://dotnetblogengine.net/" target="_blank"><img src="http://dotnetblogengine.net/themes/arthemia/images/benlogo80.gif" alt="" /></a></p>
<p>Because of the switch I had to change the theme because the old one didn&#8217;t work that well with this new version so i downloaded a new theme from <a href="http://www.blogenginetheme.com/">http://www.blogenginetheme.com/</a>&nbsp;and changed a bit to my liking. When i have time i&#8217;ll change it a bit more.</p>
<p>If you are still using an old version of BlogEngine.Net I would advise you to upgrade to 1.6.1 because it&#8217;s looking pretty good and upgrading was easy. (costed me 2 hours including deleting of spam <img title="Smile" src="http://vdcruijsen.net/editors/tiny_mce3/plugins/emotions/img/smiley-smile.gif" border="0" alt="Smile" />&nbsp;)</p>
<p>Enjoy my new weblog</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Updated+my+weblog+to+DotNetBlogengine+1.6.1&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fupdated-my-weblog-to-dotnetblogengine-1-6-1%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Updated+my+weblog+to+DotNetBlogengine+1.6.1&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fupdated-my-weblog-to-dotnetblogengine-1-6-1%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Updated+my+weblog+to+DotNetBlogengine+1.6.1&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fupdated-my-weblog-to-dotnetblogengine-1-6-1%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F05%2Fupdated-my-weblog-to-dotnetblogengine-1-6-1%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/05/updated-my-weblog-to-dotnetblogengine-1-6-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Going to DevDays 2010</title>
		<link>http://vdcruijsen.net/2010/02/going-to-devdays-2010/</link>
		<comments>http://vdcruijsen.net/2010/02/going-to-devdays-2010/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 01:32:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[DevDays]]></category>
		<category><![CDATA[Events]]></category>

		<guid isPermaLink="false">/post/Going-to-DevDays-2010.aspx</guid>
		<description><![CDATA[Wow first 7 months of no blogging then 2&#160;in 1 week I&#8217;ve been looking through al the sessions on the first day of the DevDays 2010 at the world-forum The Hague, The Netherlands and I&#8217;ve picked the ones I&#8217;m going &#8230; <a href="http://vdcruijsen.net/2010/02/going-to-devdays-2010/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow first 7 months of no blogging then 2&nbsp;in 1 week <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&rsquo;ve been looking through al the sessions on the first day of the DevDays 2010 at the world-forum The Hague, The Netherlands and I&rsquo;ve picked the ones I&rsquo;m going to.</p>
<p><a href="http://vdcruijsen.net/images/GoingtoDevDays2010_FA69/devdayslogo.png"><img style="display: inline; border-width: 0px" title="devdays-logo" src="/images/GoingtoDevDays2010_FA69/devdayslogo_thumb.png" border="0" alt="devdays-logo" width="240" height="102" /></a>&nbsp;</p>
<p>First off starting with the Keynote of course by Anders Hejlsberg and the keynotes title is: &ldquo;Trends and Future Directions in Programming Languages&rdquo;.</p>
<p>After the keynote at 11:05 I&rsquo;m going to see the session by Scott Hanselman called &ldquo;ASP.NET MVC 2: Basics, Introduction&rdquo;. Hopefully there are some new things for me to see although I know quite a bit about the MVC framework already <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  If not&hellip; Scott is always a cool guy to listen to so i see no problems.</p>
<p>At 13:30 I&rsquo;ll be going to the session by Alex Thissen called &ldquo;Secure Coding&rdquo;. It never hurts to know something about security <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The next session at 15:05 is by Anders Hejlsberg again. The session is called &ldquo;C# 4.0 and beyond&rdquo;. I would really like to know what is beyond.</p>
<p>The last session of the DevDays at 16:40 I&rsquo;m going to see is by Scott Hanselman. It&rsquo;s called &ldquo;ASP.NET MVC 2: Ninja Black Belt Tips&rdquo;. Since I&rsquo;m already a ASP.NET MVC ninja i would like to learn from the master how to get my black belt.</p>
<p>In the evening there are a couple of sessions at the &ldquo;Geeknight&rdquo;. The Geeknight sessions are sessions for the real geeks and are about programming for fun, home automation, etc.</p>
<p>Sessions at the Geeknight I&rsquo;m going to are:</p>
<p>Ofcourse starting with the geeknight keynote by Tony Krijnen and Daniel van Soest at 18:30.</p>
<p>after the keynote &ldquo;I&rsquo;m going to learn how to make my blog suck less&rdquo; by Scott Hanselman (wow 3 sessions on 1 day <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>the last session at 21:00 is the hardest choice. i have to choose between &ldquo;If the &lsquo;Free Lunch&rsquo; is Over, Can we Still Afford to Eat? How to Power Boost your Applications &ldquo; or &ldquo;Microcontrollers for .Net programmers&rdquo; or &ldquo;Using .NET to Program your Hobby Web-services&rdquo;. I really don&rsquo;t know what to expect from the first session, my interests aren&rsquo;t with microcontrollers and the last session is about webservices which i do like but it&rsquo;s a level 100 session and I think there isn&rsquo;t going to be that much new stuff to be heard there.</p>
<p>so for now my choice is with &ldquo;If the &lsquo;Free Lunch&rsquo; is Over, Can we Still Afford to Eat? How to Power Boost your Applications &ldquo; by Rutger van Beusekom.</p>
<p>I really can&rsquo;t wait for DevDays 2010 to start.</p>
<p>Maybe I&#8217;ll see you there!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Going+to+DevDays+2010&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fgoing-to-devdays-2010%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Going+to+DevDays+2010&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fgoing-to-devdays-2010%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Going+to+DevDays+2010&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fgoing-to-devdays-2010%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fgoing-to-devdays-2010%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/02/going-to-devdays-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Combined power of SharePoint and JQuery part1: Changing the SharePoint Image Picker</title>
		<link>http://vdcruijsen.net/2010/02/combined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker/</link>
		<comments>http://vdcruijsen.net/2010/02/combined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 10:12:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[JQuery]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/post/Combined-power-of-SharePoint-and-JQuery-part1-Changing-the-SharePoint-Image-Picker.aspx</guid>
		<description><![CDATA[Wow&#8230; long time since i blogged. Thank god I&#8217;m going to the Dutch DevDays to see Scott Hanselman&#8217;s session called &#8220;How to make your blog suck less&#8221; So here is an update of mine about how to use JQuery in &#8230; <a href="http://vdcruijsen.net/2010/02/combined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Wow&hellip; long time since i blogged. Thank god I&#8217;m going to the Dutch <a href="http://www.devdays.nl">DevDays</a> to see <a href="http://www.hanselman.com/blog/">Scott Hanselman&rsquo;s</a> session called &ldquo;How to make your blog suck less&rdquo; <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So here is an update of mine about how to use JQuery in SharePoint to do some fancy tricks. I&rsquo;ll post some more of these tricks later on and I&rsquo;ll try to be more active as a blogger again. (In which I&rsquo;ll probably fail)</p>
<p>Have you ever tried to change some of SharePoint&#8217;s default controls like the image picker?</p>
<p>Well I have. My customer wanted a image picker that worked exactly like the normal one except for 1 change. It shouldn&rsquo;t show the selected image as an image but it should only show the URL of the selected image. I tried to change this at server side first by inheriting from the default SharePoint image picker control. This was a rather annoying job as i didn&rsquo;t seem to get the right result this way. you cannot extend the rich image picker from sharepoint but only the default image picker that doesn&rsquo;t have the image library function behind it.</p>
<p>When i was looking at the html that was rendered by SharePoint i thought it would be easier to change the html with jquery as with serverside code and this is the result. just save this source to a .js file and include it into your masterpage or aspx page and all selected images in the image picker will be changed to only show the url of the image.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #008000">///&lt;reference path="jquery-1.3.2.min-vsdoc.js" /&gt;</span>
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">$(document).ready(<span style="color: #0000ff">function</span>() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">    HideImages();
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">});
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">function</span> HideImages() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">    $(<span style="color: #006080">"span[id $= '_RichImageField_ImageFieldDisplay']"</span>).each(<span style="color: #0000ff">function</span>() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">        <span style="color: #0000ff">var</span> url = $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">"img"</span>).attr(<span style="color: #006080">"src"</span>);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">        $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">"a"</span>).hide();
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">        $(<span style="color: #0000ff">this</span>).append(<span style="color: #006080">"&lt;span class='imgurl'&gt;"</span> + url + <span style="color: #006080">"&lt;/span&gt;"</span>);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">        $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">"a"</span>).each(<span style="color: #0000ff">function</span>() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">            $(<span style="color: #0000ff">this</span>).find(<span style="color: #006080">"img"</span>).each(<span style="color: #0000ff">function</span>() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">                $(<span style="color: #0000ff">this</span>).load(<span style="color: #0000ff">function</span>() {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">                    $(<span style="color: #0000ff">this</span>).parent().hide();
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">                    <span style="color: #0000ff">var</span> imgurl = $(<span style="color: #0000ff">this</span>).attr(<span style="color: #006080">"src"</span>);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">                    $(<span style="color: #0000ff">this</span>).parent().parent().find(<span style="color: #006080">".imgurl"</span>).text(imgurl);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">                });
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">            });
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">        });
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">    });
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">}
</pre>
<p><!--CRLF--></div>
</div>
<p>It&rsquo;s as easy as that.</p>
<p>More JQuery fun to post in the future.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Combined+power+of+SharePoint+and+JQuery+part1%3A+Changing+the+SharePoint+Image+Picker&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fcombined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Combined+power+of+SharePoint+and+JQuery+part1%3A+Changing+the+SharePoint+Image+Picker&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fcombined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Combined+power+of+SharePoint+and+JQuery+part1%3A+Changing+the+SharePoint+Image+Picker&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fcombined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2010%2F02%2Fcombined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2010/02/combined-power-of-sharepoint-and-jquery-part1-changing-the-sharepoint-image-picker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an MVC based website with reusable widgets</title>
		<link>http://vdcruijsen.net/2009/07/creating-an-mvc-based-website-with-reusable-widgets/</link>
		<comments>http://vdcruijsen.net/2009/07/creating-an-mvc-based-website-with-reusable-widgets/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 08:46:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[Geert's Projects]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Asp.net MVC]]></category>

		<guid isPermaLink="false">/post/Creating-an-MVC-based-website-with-reusable-widgets.aspx</guid>
		<description><![CDATA[After the Asp.net MVC Framework was released i was pretty impressed of how it worked but one of my main problems was how to handle the data on the page that is not the main goal of the specific page. &#8230; <a href="http://vdcruijsen.net/2009/07/creating-an-mvc-based-website-with-reusable-widgets/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After the Asp.net MVC Framework was released i was pretty impressed of how it worked but one of my main problems was how to handle the data on the page that is not the main goal of the specific page.</p>
<p>In ASP.NET MVC every page has its specific controller and views that can handle the data for the page that is requested. for example when you&rsquo;re building a web shop you&rsquo;ll probably have a ProductController that handles everything that has to do with the Products in your shop. But when you are browsing a web shop product page you would also like to see other data that has nothing to do with products, for example your shopping basket, current login state etc. Should you add this logic to the ProductController? imo you shouldn&rsquo;t since the Products controller only responsibility should be the products. So how should we handle this in the MVC framework?</p>
<p>My first idea that came to mind to solve this problem was doing an Ajax request to for example, the shopping basket controller on your view when you would like a shopping basket added to your page. This can be in some situations the best way to do it but in some cases you might not want to use Ajax since then this content can&rsquo;t be indexed by search engines for example.</p>
<p>An example how to use Ajax widgets is found here: <a title="http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=310" href="http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=310">http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=310</a></p>
<p>My main goal was to be able to add widgets to a page without the controller of that page knowing about these widgets. I found some solutions to this called partial requests found here: <a title="http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/" href="http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/">http://blog.codeville.net/2008/10/14/partial-requests-in-aspnet-mvc/</a></p>
<p>These partial requests weren&rsquo;t my favorites also since i didn&rsquo;t want to put this logic in the view so i developed my own CMS like solution for this problem.</p>
<p>My idea was that a page can have several page zones and page zones contain widgets. widgets and complete page zones should be reusable by other pages so i stored these in my CMS database. how my database is build up you can see in the image below</p>
<p><a href="http://vdcruijsen.net/images/CreatinganMVCbasedwebsitewithreusablewid_EB50/image.png"><img style="display: inline; border: 0px" title="image" src="http://vdcruijsen.net/images/CreatinganMVCbasedwebsitewithreusablewid_EB50/image_thumb.png" border="0" alt="image" width="539" height="289" /></a></p>
<p>A widget should be able to render itself so i made an abstract BaseWidget class that has a Render Method. A widget can also be a call to a different controller so i made a SubController class that inherits from BaseWidget. The SubController Widget has an Controller, Action and ID so it can call the controller it belongs to.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">abstract</span> <span style="color: #0000ff">class</span> SubControllerWidget : BaseWidget
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   2:</span> {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Controller { get;  set; }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   4:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> Action { get;  set; }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   5:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">object</span> ID { get; set; }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   6:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">public</span> SubControllerWidget(<span style="color: #0000ff">string</span> Controller, <span style="color: #0000ff">string</span> Action) : <span style="color: #0000ff">base</span>()
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   8:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   9:</span>         <span style="color: #0000ff">this</span>.Controller = Controller;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  10:</span>         <span style="color: #0000ff">this</span>.Action = Action;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  11:</span>         <span style="color: #0000ff">this</span>.ID = <span style="color: #0000ff">null</span>;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  12:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  13:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  14:</span>     <span style="color: #0000ff">public</span> SubControllerWidget(<span style="color: #0000ff">string</span> Controller, <span style="color: #0000ff">string</span> Action, <span style="color: #0000ff">object</span> ID)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  15:</span>         : <span style="color: #0000ff">base</span>()
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  16:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  17:</span>         <span style="color: #0000ff">this</span>.Controller = Controller;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  18:</span>         <span style="color: #0000ff">this</span>.Action = Action;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  19:</span>         <span style="color: #0000ff">this</span>.ID = ID;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  20:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  21:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  22:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> Render(System.Web.Mvc.ViewContext vc)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  23:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  24:</span>         vc.RouteData.Values[<span style="color: #006080">"controller"</span>] = Controller;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  25:</span>         vc.RouteData.Values[<span style="color: #006080">"action"</span>] = Action;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  26:</span>         vc.RouteData.Values[<span style="color: #006080">"id"</span>] = ID;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  27:</span>         IHttpHandler handler = <span style="color: #0000ff">new</span> MvcHandler(vc.RequestContext);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  28:</span>         handler.ProcessRequest(System.Web.HttpContext.Current);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  29:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  30:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  31:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">abstract</span> <span style="color: #0000ff">void</span> SetSettings(WidgetSettings settings);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  32:</span> }
</pre>
<p><!--CRLF--></div>
</div>
<p>To build a specific widget just inherit a widget from SubControllerWidget and you are ready to go. Set the Controller, Action and ID to call and that specific controller will be called.</p>
<p>To add these page zones and widgets to the pages dynamically i&rsquo;ve created a CMSController that overrides the OnActionExecuted method so it can insert the page zones and widgets to the model that&rsquo;s been send to the View.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   1:</span> <span style="color: #0000ff">protected</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> OnActionExecuted(ActionExecutedContext filterContext)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   2:</span> {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">if</span> (ViewData.Model == <span style="color: #0000ff">null</span>)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   4:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   5:</span>         ViewData.Model = <span style="color: #0000ff">new</span> CMSViewModel();
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   6:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   7:</span>     <span style="color: #0000ff">string</span> controller = filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"controller"</span>] != <span style="color: #0000ff">null</span> ? filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"controller"</span>].ToString() : <span style="color: #006080">""</span>;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   8:</span>     <span style="color: #0000ff">string</span> controllerAction = filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"action"</span>] != <span style="color: #0000ff">null</span> ? filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"action"</span>].ToString() : <span style="color: #006080">""</span>;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   9:</span>     <span style="color: #0000ff">string</span> controllerActionid = filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"id"</span>] != <span style="color: #0000ff">null</span> ? filterContext.RequestContext.RouteData.Values[<span style="color: #006080">"id"</span>].ToString() : <span style="color: #006080">""</span>;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  10:</span>     IList&lt;PageZone&gt; zones = _cmsRep.GetPageZonesForPage(controller, controllerAction, controllerActionid);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  11:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  12:</span>     CMSViewModel page = (CMSViewModel)ViewData.Model;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  13:</span>     <span style="color: #0000ff">if</span> (page.PageZones == <span style="color: #0000ff">null</span>)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  14:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  15:</span>         page.PageZones = zones;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  16:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  17:</span>     <span style="color: #0000ff">else</span>
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  18:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  19:</span>         <span style="color: #0000ff">foreach</span> (PageZone zone <span style="color: #0000ff">in</span> zones)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  20:</span>         {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  21:</span>             page.PageZones.Add(zone);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  22:</span>         }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  23:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  24:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  25:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  26:</span>     <span style="color: #0000ff">base</span>.OnActionExecuted(filterContext);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  27:</span> }
</pre>
<p><!--CRLF--></div>
</div>
<p>&nbsp;</p>
<p>So now all widgets beloning to a page will be retrieved from the CMSRepository and are added to the CMSViewModel so now it&rsquo;s the View&rsquo;s turn to render all widgets.</p>
<p>In my master page I&rsquo;ve added the following line that is responsible for rendering all widgets:</p>
<p>&lt;% Html.RenderPageZones(Model); %&gt;</p>
<p>For that to work I&rsquo;ve created a few html extension methods to render the page zones.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   1:</span> <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">class</span> HtmlCMSExtensions
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   2:</span> {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   3:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> RenderPageZones(<span style="color: #0000ff">this</span> HtmlHelper html, CMSViewModel page)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   4:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   5:</span>         <span style="color: #0000ff">if</span> (page != <span style="color: #0000ff">null</span> &amp;&amp; page.PageZones != <span style="color: #0000ff">null</span>)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   6:</span>         {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   7:</span>             <span style="color: #0000ff">foreach</span> (PageZone zone <span style="color: #0000ff">in</span> page.PageZones)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   8:</span>             {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   9:</span>                 html.RenderPartial(<span style="color: #006080">"PageZone"</span>, zone);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  10:</span>             }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  11:</span>         }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  12:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  13:</span>&nbsp;
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  14:</span>     <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> RenderWidgetsInZone(<span style="color: #0000ff">this</span> HtmlHelper html, PageZone zone)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  15:</span>     {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  16:</span>         <span style="color: #0000ff">if</span> (zone != <span style="color: #0000ff">null</span> &amp;&amp; zone.Widgets != <span style="color: #0000ff">null</span>)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  17:</span>         {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  18:</span>             <span style="color: #0000ff">foreach</span> (IWidget widget <span style="color: #0000ff">in</span> zone.Widgets)
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  19:</span>             {
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  20:</span>                 widget.Render(html.ViewContext);
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  21:</span>             }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  22:</span>         }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  23:</span>     }
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">  24:</span> }
</pre>
<p><!--CRLF--></div>
</div>
<p>In my PageZone view i&rsquo;ve added the other html extension method called RenderWidgetsInZone so all widgets are rendered by itself.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="background-color: #ffff00">&lt;%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl&lt;VanDerCruijsen.MVC.CMS.Model.PageZone&gt;" %&gt;</span>
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">&lt;</span><span style="color: #800000">div</span> <span style="color: #ff0000">id</span><span style="color: #0000ff">="&lt;%= Html.Encode(Model.Name) %&gt;"</span><span style="color: #0000ff">&gt;</span>
</pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">name:<span style="background-color: #ffff00">&lt;%</span>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   1:</span> = Html.Encode(Model.Name)
</pre>
<p><!--CRLF--><span style="background-color: #ffff00">%&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="background-color: #ffff00">&lt;%</span>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #606060">   1:</span>  Html.RenderWidgetsInZone(Model);
</pre>
<p><!--CRLF--><span style="background-color: #ffff00">%&gt;</span></pre>
<p><!--CRLF--></p>
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">div</span><span style="color: #0000ff">&gt;</span>
</pre>
<p><!--CRLF--></div>
</div>
<p>This is the way I use to create widgets on my ASP.NET MVC pages. If you have any recommendations or better ways how to do it please let me know.</p>
<p>When I have the time I&rsquo;m going to build an admin controller to be able to add widgets and pagezones via the webinterface since now the only option is to add them in the database by hand.</p>
<p>My sources aren&rsquo;t really cleaned up so if you want a working source/solution please send me mail or leave a comment.</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=Creating+an+MVC+based+website+with+reusable+widgets&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2009%2F07%2Fcreating-an-mvc-based-website-with-reusable-widgets%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=Creating+an+MVC+based+website+with+reusable+widgets&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2009%2F07%2Fcreating-an-mvc-based-website-with-reusable-widgets%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=Creating+an+MVC+based+website+with+reusable+widgets&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2009%2F07%2Fcreating-an-mvc-based-website-with-reusable-widgets%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2009%2F07%2Fcreating-an-mvc-based-website-with-reusable-widgets%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2009/07/creating-an-mvc-based-website-with-reusable-widgets/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My article about the ASP.NET MVC Framework published in the Dutch .Net Magazine</title>
		<link>http://vdcruijsen.net/2009/06/my-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine/</link>
		<comments>http://vdcruijsen.net/2009/06/my-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 11:47:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Asp.net MVC]]></category>

		<guid isPermaLink="false">/post/My-article-about-the-ASPNET-MVC-Framework-published-in-the-Dutch-Net-Magazine.aspx</guid>
		<description><![CDATA[Hello everyone, It&#8217;s been a while since my last post (again ) but I&#8217;ve been quite busy testing out the new ASP.NET MVC Framework. I have to say i really like it. Currently I&#8217;m building my own little CMS framework &#8230; <a href="http://vdcruijsen.net/2009/06/my-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hello everyone,</p>
<p>It&rsquo;s been a while since my last post (again <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  ) but I&#8217;ve been quite busy testing out the new ASP.NET MVC Framework. I have to say i really like it. Currently I&#8217;m building my own little CMS framework on top of the MVC framework so it becomes easier to use widgets or other non main data items on your pages. As soon as it&rsquo;s in a show able form I&#8217;ll&nbsp; post it on my blog.</p>
<p>I&rsquo;ve also written an article about the ASP.NET MVC framework for the Dutch .Net Magazine (in Dutch) so if you are a reader of the magazine check out page 22 of the June 2009 release (#25) <img src='http://vdcruijsen.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The Title of my article is: &ldquo;Volledige controle over je webapplicatie met het ASP.NET MVC Framework&rdquo; (&ldquo;Total control over your web app using the ASP.NET MVC Framework&rdquo;)</p>
<p><a href="http://dotnetmagazine.array.nl/site/Hetblad/Nieuwste_nummer"><img src="http://dotnetmagazine.array.nl/site/system/galleries/pics/Covers/Cover-Dotnet0209.jpg" alt="" width="192" height="266" /></a></p>
<p>The article will also come online sometime but the official site (also used to sign up for the free magazine) <a href="http://www.dotnetmag.nl">www.dotnetmag.nl</a> is still showing #23 as the newest one.</p>
<p>When the pdf is put online I&rsquo;ll add the link to this post.</p>
<p>I&rsquo;ve focused on writing about how to build an ASP.NET MVC application using TDD because I think this is one of the major advantages over the &ldquo;old&rdquo; way of building web applications in ASP.NET.</p>
<p>If you have any feedback or comments about the article please let me know!</p>
<p>Geert van der Cruijsen</p>
<div class="lightsocial_container"><a class="lightsocial_a" href="http://www.facebook.com/sharer.php?t=My+article+about+the+ASP.NET+MVC+Framework+published+in+the+Dutch+.Net+Magazine&amp;u=http%3A%2F%2Fvdcruijsen.net%2F2009%2F06%2Fmy-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/facebook.png" alt="Share on Facebook" title="Share on Facebook" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://www.dotnetkicks.com/kick/?title=My+article+about+the+ASP.NET+MVC+Framework+published+in+the+Dutch+.Net+Magazine&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2009%2F06%2Fmy-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetkicks.png" alt="Kick It on DotNetKicks.com" title="Kick It on DotNetKicks.com" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://dotnetshoutout.com/Submit?title=My+article+about+the+ASP.NET+MVC+Framework+published+in+the+Dutch+.Net+Magazine&amp;url=http%3A%2F%2Fvdcruijsen.net%2F2009%2F06%2Fmy-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/dotnetshoutout.png" alt="Shout it" title="Shout it" /></a>&nbsp;&nbsp;<a class="lightsocial_a" href="http://twitter.com/home?status=Reading+http%3A%2F%2Fvdcruijsen.net%2F2009%2F06%2Fmy-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine%2F" ><img class="lightsocial_img" src="http://vdcruijsen.net/wp-content/plugins/light-social/twitter.png" alt="Post on Twitter" title="Post on Twitter" /></a>&nbsp;&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://vdcruijsen.net/2009/06/my-article-about-the-asp-net-mvc-framework-published-in-the-dutch-net-magazine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET MVC framework 1.0 released</title>
		<link>http://vdcruijsen.net/2009/03/asp-net-mvc-framework-1-0-released/</link>
		<comments>http://vdcruijsen.net/2009/03/asp-net-mvc-framework-1-0-released/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 14:23:00 +0000</pubDate>
		<dc:creator>Geert van der Cruijsen</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Asp.net MVC]]></category>

		<guid isPermaLink="false">/post/ASPNET-MVC-framework-10-released.aspx</guid>
		<description><![CDATA[After the announcement of silverlight 3.0 i was chatting with a colleague about how cool it would be if asp.net MVC framework would also be released at mix. My colleague started searching and came up with this link: http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&#38;displaylang=en Pretty &#8230; <a href="http://vdcruijsen.net/2009/03/asp-net-mvc-framework-1-0-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">After the announcement of silverlight 3.0 i was chatting with a colleague about how cool it would be if asp.net MVC framework would also be released at mix.</span> </p>
<p style="margin: 0cm 0cm 10pt" class="MsoNormal">
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">My colleague started searching and came up with this link:</span>
</p>
<p style="margin: 0cm 0cm 10pt" class="MsoNormal">
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt"><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;displaylang=en">http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&amp;displaylang=en</a></span>
</p>
<p style="margin: 0cm 0cm 10pt" class="MsoNormal">
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">Pretty cool huh? I haven&rsquo;t seen any official press releases from Microsoft but since you can download it it seems that it has been released!</span><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">&nbsp;</span>
</p>
<p>
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt"></span><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">My guess is that it will be announced on MIX today or tomorrow but I couldn&rsquo;t wait to share it with you already </span><span style="line-height: 115%; font-family: Wingdings; font-size: 8.5pt"><span>J</span></span><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt"></span><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt">&nbsp;</span>
</p>
<p>
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt"></span>
</p>
<p>
<span style="line-height: 115%; font-family: 'Verdana','sans-serif'; font-size: 8.5pt"></span><span style="line-height: 115%; font-family: 'Verdana','sans-serif'; f