<?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>JAPF &#187; wp7</title>
	<atom:link href="http://www.japf.fr/tag/wp7/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.japf.fr</link>
	<description>Jeremy Alles Presentation Foundation: WPF, Silverlight, Windows Phone 7, Windows 8</description>
	<lastBuildDate>Fri, 27 Jan 2012 07:57:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Windows Phone performance analysis &amp; optimization during TechDays</title>
		<link>http://www.japf.fr/2012/01/windows-phone-performance-analysis-optimization-during-techdays/</link>
		<comments>http://www.japf.fr/2012/01/windows-phone-performance-analysis-optimization-during-techdays/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 07:57:31 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[techdays]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=1065</guid>
		<description><![CDATA[In about 2 weeks now, I&#8217;ll have the chance to be part of the French TechDays in Paris as a speaker. This year, I&#8217;ll own a session called &#8220;Windows Phone performance analysis &#38; optimisation&#8221; with my colleague Charlotte. The agenda looks like the following: why performance analysis ? device vs emulator leveraging WP7 threads using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2012/01/LogoTechDays.png" rel="lightbox[1065]"><img class="alignnone size-full wp-image-1067" title="LogoTechDays" src="http://www.japf.fr/wp-content/uploads/2012/01/LogoTechDays.png" alt="" width="223" height="79" /></a></p>
<p>In about 2 weeks now, I&#8217;ll have the chance to be part of the French TechDays in Paris as a speaker. This year, I&#8217;ll own a session called &#8220;Windows Phone performance analysis &amp; optimisation&#8221; with my colleague Charlotte.</p>
<p>The agenda looks like the following:</p>
<ul>
<li>why performance analysis ?</li>
<li>device vs emulator</li>
<li>leveraging WP7 threads</li>
<li>using the VS profiler for WP7</li>
<li>tips and tricks</li>
</ul>
<p>During the session we will use a &#8220;real&#8221; app we&#8217;re working on for a few months now (I&#8217;ll share more details after the session). We have some cool tips that haven&#8217;t been shared anywhere before, so if performance is a topic of interest for you, stat tuned !</p>
<p>Click on the following image for a link to the TechDays website:</p>
<p><a href="http://www.microsoft.com/france/mstechdays/programmes/parcours.aspx#DomID=9e0aee6e-9896-4c59-ad3f-d4cd48109eaa&amp;SessionID=db46a2a8-566e-4954-8903-e133f2217857"><img class="alignnone  wp-image-1066" title="SessionTechDays" src="http://www.japf.fr/wp-content/uploads/2012/01/SessionTechDays.png" alt="" width="553" height="281" /></a></p>
<p>I&#8217;m planning to share the most of the content of this session on my blog soon after the event.</p>
<p>Don&#8217;t hesitate to stop by and say hi&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2012/01/windows-phone-performance-analysis-optimization-during-techdays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Property change notifications when using SQL CE on Windows Phone 7.1</title>
		<link>http://www.japf.fr/2011/10/property-change-notifications-when-using-sql-ce-on-windows-phone-7-1/</link>
		<comments>http://www.japf.fr/2011/10/property-change-notifications-when-using-sql-ce-on-windows-phone-7-1/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 09:52:31 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[sqlce]]></category>
		<category><![CDATA[wp7]]></category>
		<category><![CDATA[wp7dev]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=989</guid>
		<description><![CDATA[I wanted to share a quick syntax trick I&#8217;m using to send property change notifications in a Windows Phone 7.1 application. As you already know, the Mango release of Windows Phone introduce local database storage using SQL Compact Edition and Linq-To-SQL. In the MSDN documentation Local Database Best Practices for Windows Phone, you can find [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to share a quick syntax trick I&#8217;m using to send property change notifications in a Windows Phone 7.1 application. As you already know, the Mango release of Windows Phone introduce local database storage using SQL Compact Edition and Linq-To-SQL.</p>
<p>In the MSDN documentation <a href="http://msdn.microsoft.com/en-us/library/hh286406%28v=VS.92%29.aspx"><em>Local Database Best Practices for Windows Phone</em></a>, you can find the following recommendation:</p>
<p><em>&#8220;<strong>Minimizing Memory Usage</strong></em></p>
<p><em>LINQ to SQL change tracking works by maintaining two copies of each object (&#8230;)</em></p>
<p><em>By default, LINQ to SQL will create the two copies of the object when the objects are materialized. Frequently, however, only a handful of objects in the materialized collection will actually get modified within a specific transaction. In this case, there is no reason to keep a second copy of the object.</em></p>
<p><em>The INotifyPropertyChanging interface allows the application to notify the DataContext when it is modifying a property that will ultimately be submitted as an update to the database. The DataContext can use that notification as a trigger to create the copy. This way, only the items that are actually changing need to be duplicated.&#8221;</em></p>
<p>It means that to optimize memory usage, your model class should implement both the INotifyPropertyChanged and INotifyPropertyChanging interface. Memory usage is an important aspect, especially on mobile device ! On the Windows Phone platform the certification requires your app to use less than 90MB of memory.</p>
<p>So you&#8217;ll probably end up creating a base class for all your model, maybe something like this <em>EntityBase</em>:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p989code5'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9895"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code" id="p989code5"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> EntityBase <span style="color: #008000;">:</span> INotifyPropertyChanged, INotifyPropertyChanging
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">event</span> PropertyChangedEventHandler PropertyChanged<span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">event</span> PropertyChangingEventHandler PropertyChanging<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> RaisePropertyChanged<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> propertyName<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>propertyName <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> ArgumentNullException<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;propertyName&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <span style="color: #008000;">new</span> PropertyChangedEventArgs<span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> RaisePropertyChanging<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> propertyName<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>propertyName <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> ArgumentNullException<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;propertyName&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanging</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanging</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, <span style="color: #008000;">new</span> PropertyChangingEventArgs<span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And you&#8217;ll define a property like the following</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p989code6'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9896"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p989code6"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Title
<span style="color: #008000;">&#123;</span>
    get
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
    set 
    <span style="color: #008000;">&#123;</span> 
        <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span> <span style="color: #008000;">!=</span> value<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RaisePropertyChanging</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Title&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RaisePropertyChanged</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Title&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Because I&#8217;m not a big fan of this syntax (property name is duplicated, and it&#8217;s easy to use either the first call or the second one&#8230;), I tried to find another solution. Here is my proposal</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p989code7'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9897"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code" id="p989code7"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Title
<span style="color: #008000;">&#123;</span>
    get
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
    set 
    <span style="color: #008000;">&#123;</span> 
        <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span> <span style="color: #008000;">!=</span> value<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">NotifyChange</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Title&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">title</span> <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>This syntax is based on the <em>using</em> operator and the <a href="http://msdn.microsoft.com/en-us/library/system.idisposable.aspx">IDisposable</a> interface. The IDisposable interface used to be implemented by objects which must explicitly release resources when they are no longer needed. But you can use it for any other reason and benefit the <em>using</em> operator !</p>
<p>Here is the additional code in my <em>EntityBase</em> class:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p989code8'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p9898"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code" id="p989code8"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">protected</span> IDisposable NotifyChange<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">params</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> propertyNames<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">new</span> PropertyChange<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span>, propertyNames<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">class</span> PropertyChange <span style="color: #008000;">:</span> IDisposable
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> ModelEntityBase entity<span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> propertyNames<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> PropertyChange<span style="color: #008000;">&#40;</span>ModelEntityBase entity, <span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> propertyNames<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">entity</span> <span style="color: #008000;">=</span> entity<span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">propertyNames</span> <span style="color: #008000;">=</span> propertyNames<span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var propertyName <span style="color: #0600FF; font-weight: bold;">in</span> propertyNames<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">entity</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RaisePropertyChanging</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>                    
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Dispose<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var propertyName <span style="color: #0600FF; font-weight: bold;">in</span> propertyNames<span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">entity</span><span style="color: #008000;">.</span><span style="color: #0000FF;">RaisePropertyChanged</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>                    
        <span style="color: #008000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">entity</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Not that if setting your property might invalidate other properties as well, you can give more than one parameter to the NotifyChange method. </p>
<p>Hope this helps !</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2011/10/property-change-notifications-when-using-sql-ce-on-windows-phone-7-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MVVM Framework explorer updated</title>
		<link>http://www.japf.fr/2011/09/mvvm-framework-explorer-updated/</link>
		<comments>http://www.japf.fr/2011/09/mvvm-framework-explorer-updated/#comments</comments>
		<pubDate>Mon, 05 Sep 2011 11:57:50 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=954</guid>
		<description><![CDATA[I just updated my MVVM frameworks explorer Silverlight application. You can find the updated application here. Here is the top 5 of MVVM frameworks supporting WPF, Silverlight and Windows Phone 7: MVVM Light (61k downloads) nRoute (19k downloads) Caliburn Micro (18k downloads) Simple MVVM toolkit (5k downloads) Catel (5k downloads)]]></description>
			<content:encoded><![CDATA[<p>I just updated my MVVM frameworks explorer Silverlight application. You can find the updated application <a href="http://www.japf.fr/silverlight/mvvm/index.html">here</a>.</p>
<p>Here is the top 5 of MVVM frameworks supporting WPF, Silverlight and Windows Phone 7:</p>
<ol>
<li><a href="http://mvvmlight.codeplex.com/">MVVM Light</a> (61k downloads)</li>
<li><a href="http://nroute.codeplex.com/">nRoute</a> (19k downloads)</li>
<li><a href="http://caliburnmicro.codeplex.com/">Caliburn Micro</a> (18k downloads)</li>
<li><a href="http://simplemvvmtoolkit.codeplex.com/">Simple MVVM toolkit</a> (5k downloads)</li>
<li><a href="http://catel.codeplex.com/">Catel</a> (5k downloads)</li>
</ol>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/09/mvvm-frameworks.png" rel="lightbox[954]"><img class="alignnone size-full wp-image-955" title="mvvm-frameworks" src="http://www.japf.fr/wp-content/uploads/2011/09/mvvm-frameworks.png" alt="" width="464" height="80" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2011/09/mvvm-framework-explorer-updated/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When enough ViewModel is enough</title>
		<link>http://www.japf.fr/2011/04/when-enough-viewmodel-is-enough/</link>
		<comments>http://www.japf.fr/2011/04/when-enough-viewmodel-is-enough/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 12:26:59 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=906</guid>
		<description><![CDATA[In the last few years, we&#8217;ve seen the WPF and Silverlight community embracing the MVVM methodology. As one of the early adopters of MVVM (one of my first post about the subject was late 2008), I&#8217;ve seen the pattern evolving both in the web community and with developers I&#8217;ve met in my daily life. Today, [...]]]></description>
			<content:encoded><![CDATA[<p>In the last few years, we&#8217;ve seen the WPF and Silverlight community embracing the MVVM methodology. As one of the early adopters of MVVM (one of <a href="http://www.japf.fr/2008/12/why-should-i-use-model-view-viewmodel-pattern/">my first post</a> about the subject was late 2008), I&#8217;ve seen the pattern evolving both in the web community and with developers I&#8217;ve met in my daily life.</p>
<p>Today, I&#8217;d like to share with you a simple concept I try to stick to when I&#8217;m doing WPF, Silverlight or Windows Phone 7 development. It can be summarized as &#8220;Enough ViewModel is enough&#8221;.</p>
<p>The simple idea behind this slogan is that there ARE stuff which are view-related and SHOULD NOT be embedded in the ViewModel layer. I&#8217;ve seen too many developers going the &#8220;100% viewmodel way&#8221; which means for them absolutely no code-behind without any dispensation.</p>
<p>For example, I came across this code. It&#8217;s the ViewModel layer associated to a simple view where the user fills various input and has immediate feedback about the progress (like &#8220;75% of the fields are completed&#8221;). If by the way you&#8217;re interested in implementing this behavior you can check out <a href="http://www.codeproject.com/KB/smart/WPF_Validation_Attribute.aspx">this article</a> I wrote on CodeProject)</p>
<p>The following code is simplified to the sake of the article:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p906code11'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p90611"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre></td><td class="code" id="p906code11"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> ViewModel
<span style="color: #008000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// data field acts as the model object behind the VM layer</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> Data data<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #008080; font-style: italic;">// missing code...</span>
    <span style="color: #008080; font-style: italic;">// public properties used by the view using databinding</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> ViewModel<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">// very simplified for this article...</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">data</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Data<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">data</span><span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedValuesChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #008000;">&#40;</span>data_SelectedValuesChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> UpdateProgress<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #008080; font-style: italic;">// some code...</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #6666cc; font-weight: bold;">void</span> data_SelectedValuesChanged<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateProgress</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Initialize</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Initialize<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        var item <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">data</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetItem</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;id1&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>item <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            item<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> PropertyChangedEventHandler<span style="color: #008000;">&#40;</span>item_PropertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            item<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedValuesChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #008000;">&#40;</span>item_SelectedValuesChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var value <span style="color: #0600FF; font-weight: bold;">in</span> item<span style="color: #008000;">.</span><span style="color: #0000FF;">Values</span><span style="color: #008000;">&#41;</span>
                value<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> PropertyChangedEventHandler<span style="color: #008000;">&#40;</span>item_PropertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
        item <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">data</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetItem</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;id2&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>item <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            item<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> PropertyChangedEventHandler<span style="color: #008000;">&#40;</span>item_PropertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            item<span style="color: #008000;">.</span><span style="color: #0000FF;">SelectedValuesChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> EventHandler<span style="color: #008000;">&#40;</span>item_SelectedValuesChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>var value <span style="color: #0600FF; font-weight: bold;">in</span> item<span style="color: #008000;">.</span><span style="color: #0000FF;">Values</span><span style="color: #008000;">&#41;</span>
                value<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">new</span> PropertyChangedEventHandler<span style="color: #008000;">&#40;</span>item_PropertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #6666cc; font-weight: bold;">void</span> item_PropertyChanged<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, <span style="color: #000000;">System.<span style="color: #0000FF;">ComponentModel</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChangedEventArgs</span> e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateProgress</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #6666cc; font-weight: bold;">void</span> item_SelectedValuesChanged<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateProgress</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>The idea is simple, as soon as the user changes a value in the View, we must compute the current progress. Because the ViewModel have several levels, we end-up having to register to every single PropertyChanged event which leads to cumbersome code. By the way, this code can also creates memory leaks since we register a lot of event handlers without removing them, but that&#8217;s another discussion&#8230;</p>
<p>Here is my way to solve this problem:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p906code12'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p90612"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p906code12"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> View <span style="color: #008000;">:</span> UserControl
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> ViewModel viewmodel<span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> View<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        InitializeComponent<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">viewmodel</span> <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> ViewModel<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">AddHandler</span><span style="color: #008000;">&#40;</span>
            FocusManager<span style="color: #008000;">.</span><span style="color: #0000FF;">LostFocusEvent</span>,
            <span style="color: #008000;">new</span> RoutedEventHandler<span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">OnLostFocus</span><span style="color: #008000;">&#41;</span>,
            <span style="color: #0600FF; font-weight: bold;">true</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> OnLostFocus<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, RoutedEventArgs e<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">viewmodel</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UpdateProgress</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>      
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>What is wrong with this way ? The View has code-behind ? That&#8217;s not a big deal: the code is more readable, maintainable. It makes also more sense: when a view-related operation occurs (in this case, focus has changed), update the progress.</p>
<p>The simple message I&#8217;d like to spread is the fact that there is nothing wrong with the fact to have <strong>sometime</strong>, a <strong>little bit of code-behind</strong> in your view<strong> if</strong> that facilitates your architecture. There is no need to create a complicated infrastructure with behaviors, commands or bindings just to keep the view empty if that does not make sense.</p>
<p>Another great example in a real application is available in the <a href="http://stores.lulu.com/joshsmithonwpf">Advanced MVVM</a> book by <a href="http://joshsmithonwpf.wordpress.com/">Josh Smith</a>.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2011/04/when-enough-viewmodel-is-enough/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Mix11: Windows Phone 7 news</title>
		<link>http://www.japf.fr/2011/04/mix11-windows-phone-7-news/</link>
		<comments>http://www.japf.fr/2011/04/mix11-windows-phone-7-news/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 17:27:20 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=884</guid>
		<description><![CDATA[Today is Mix day ! After yesterday keynote about HTML5, IE10 preview and other web stuff, it&#8217;s time for serious Silverlight and Windows Phone announcements ! Today&#8217;s keynote starts with Joe Belfiore talking about the update process for the NoDo update of WP7. As you know this update was not delivered &#8220;properly&#8221;, but at least [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/logoMix111.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-885" title="logoMix11" src="http://www.japf.fr/wp-content/uploads/2011/04/logoMix111.png" alt="" width="182" height="151" /></a></p>
<p>Today is <a href="http://live.visitmix.com">Mix</a> day ! After yesterday keynote about HTML5, IE10 preview and other web stuff, it&#8217;s time for serious Silverlight and Windows Phone announcements !</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/wp7-mix.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-895" title="wp7-mix" src="http://www.japf.fr/wp-content/uploads/2011/04/wp7-mix.png" alt="" width="280" height="160" /></a></p>
<p>Today&#8217;s keynote starts with Joe Belfiore talking about the update process for the NoDo update of WP7. As you know this update was not delivered &#8220;properly&#8221;, but at least we know have a good communication from Microsoft about that (you can for exemple check-out the <a href="http://www.microsoft.com/windowsphone/en-us/features/update-schedules.aspx">Where&#8217;s my phone update</a> website)</p>
<p><strong>Nokia partnership</strong></p>
<ul>
<li>Marco Argenti, Head of Dev Experience comes on stage</li>
<li>Nokia is &#8220;working very hard&#8221; to deliver the very first WP7 device</li>
</ul>
<p><strong>General</strong></p>
<ul>
<li>update is schedule for the fall</li>
<li>all existing phones and new phones will get the update</li>
<li>16 additional languages will be supported</li>
<li>more countries where we can create apps (from 30 to 38)</li>
<li>more countries where we can buy apps (from 16 to 35)</li>
</ul>
<p><strong>Marketplace / Search</strong></p>
<ul>
<li>better apps list: filter by letters (like with the contacts)</li>
<li>new search button to search for a particular app</li>
<li>better marketplace
<ul>
<li>more information with less confusion (music and apps are no longer mixed)</li>
<li>search for podcasts</li>
<li>new &#8220;related&#8221; pivot item when seeing an app for related app</li>
</ul>
</li>
<li>we can integrate an app with the search feature of the phone</li>
</ul>
<p><strong>Web Experience</strong></p>
<ul>
<li>the update include IE9</li>
<li>the core engine is the same code base that the one we found desktop : including HW acceleration</li>
<li>address bar is moved to the bottom</li>
<li>support background audio for HTML5: you can leave IE and keep listening to the music !</li>
<li>tabbed UI for navigating between tabs</li>
<li>support for H264 video</li>
</ul>
<p><strong>Platform</strong></p>
<ul>
<li>improved panorama and pivot control</li>
<li>improvements for live tiles</li>
<li>access to the ring tones settings (set a music files as ring tone programmatically)</li>
<li>TCP/IP sockets</li>
<li>SQL database</li>
<li>more launchers and choosers</li>
<li>data access to the contacts and calendars on the phone</li>
<li>better integration with the sensors on the phone (like RAW camera access)</li>
<li>Skype coming to the platform this fall (leveraging many of those new features)</li>
<li>pin live tiles with deep link to our apps (which would launch the app and give the link as parameter)</li>
<li>Silverlight 4 features support</li>
<li>applications can now contains both Silverlight and XNA content</li>
</ul>
<p><strong>Multitasking</strong></p>
<ul>
<li>Spotify coming to WP7 using new multitasking capabilities</li>
<li>fast-app switching</li>
<li>use &#8220;live agents&#8221; to prevent battery life</li>
</ul>
<p><strong>Tooling</strong></p>
<ul>
<li>new version of tools will be available next month !</li>
<li>new capabilities in the emulator: simulate accelerometer and location sensors right from the emulator</li>
</ul>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/emulator-acc.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-890" title="emulator-acc" src="http://www.japf.fr/wp-content/uploads/2011/04/emulator-acc.png" alt="" width="418" height="220" /></a></p>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/emulator-loc.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-891" title="emulator-loc" src="http://www.japf.fr/wp-content/uploads/2011/04/emulator-loc.png" alt="" width="418" height="220" /></a></p>
<ul>
<li>new profiling support</li>
</ul>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/tool-perf.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-892" title="tool-perf" src="http://www.japf.fr/wp-content/uploads/2011/04/tool-perf.png" alt="" width="418" height="220" /></a></p>
<p><strong>Performance</strong></p>
<ul>
<li>scrolling: totally smooth scrolling without any changes in our applications !</li>
<li>image decoding</li>
<li>garbage collection</li>
<li>memory usage</li>
</ul>
<p><strong>Conclusion</strong></p>
<ul>
<li>A lot of new features available to developers + Silverlight 4 features coming to the phone</li>
<li>An development experience which is definitively the best out on the market for mobile development</li>
<li>Microsoft is listening to our feedback</li>
<li>Update is schedule for this fall !</li>
<li>New version of the tools next month</li>
</ul>
<p><a href="http://www.japf.fr/wp-content/uploads/2011/04/wp7-new-stuff.png" rel="lightbox[884]"><img class="alignnone size-full wp-image-893" title="wp7-new-stuff" src="http://www.japf.fr/wp-content/uploads/2011/04/wp7-new-stuff.png" alt="" width="418" height="228" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2011/04/mix11-windows-phone-7-news/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Tap N Match a cool WP7 game ! Vote on Facebook !</title>
		<link>http://www.japf.fr/2010/09/tap-n-match-a-cool-wp7-game-vote-for-us-on-facebook/</link>
		<comments>http://www.japf.fr/2010/09/tap-n-match-a-cool-wp7-game-vote-for-us-on-facebook/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 12:04:05 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[contest]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=652</guid>
		<description><![CDATA[Today I need help from all my readers across the globe ! Please vote for our TapNMatch WP7 game here Microsoft France is organizing since a couple of months a Windows Phone 7 contest in order to create cool applications. Applications are demonstrated using a short video which is posted on Facebook. The goal is [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Today I need help from all my readers across the globe ! Please vote for our TapNMatch WP7 game <a href="http://www.facebook.com/Developpeurs.net#!/video/video.php?v=434150728926">here</a></strong></p>
<p>Microsoft France is organizing since a couple of months a Windows Phone 7 contest in order to create cool applications. Applications are demonstrated using a short video which is posted on Facebook. The goal is to have the maximum number of &#8220;Like&#8221; in order to be selected for the final.10 applications are going to be selected, and on October 7th, each selected developers will have to present very quickly (2min) its application in front of an amazing jury made of Steve Ballmer and CEOs of french companies.</p>
<p>A coworker and I have been working on a Windows Phone 7 game called <strong>Tap N Match</strong> created using Silverlight. The goal of the game is to associate &#8220;targets&#8221; which have a number either by creating pairs (5;5) or sequences (1;2). Here is quick description of the game:</p>
<ul>
<li>best scores are recorded in the cloud using <em>Windows Azure</em></li>
<li>use of the <em>Bing APIs</em> in order to determine the country of the player when posting a new score</li>
<li>use of the <em>Pivot</em> control</li>
</ul>
<p>Here is the presentation of our application on YouTube:<br />
<object width="512" height="308"><param name="movie" value="http://www.youtube.com/v/O5q3BsjaQVU?fs=1&amp;hl=fr_FR"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/O5q3BsjaQVU?fs=1&amp;hl=fr_FR" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="512" height="308"></embed></object></p>
<p>In order to vote for our application:</p>
<ol>
<li>Go to : <a href="http://www.facebook.com/Developpeurs.net">http://www.facebook.com/Developpeurs.net</a></li>
<li>&#8220;Like&#8221; this page</li>
<li>Go to the video of my game : <a href="http://www.facebook.com/Developpeurs.net#!/video/video.php?v=434150728926">http://www.facebook.com/Developpeurs.net#!/video/video.php?v=434150728926</a></li>
<li>&#8220;Like&#8221; my video <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
<p>Thank you very much for your help !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/09/tap-n-match-a-cool-wp7-game-vote-for-us-on-facebook/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>[WP7] Sound effect in a Silverlight Windows Phone 7 application</title>
		<link>http://www.japf.fr/2010/08/sound-effect-in-wp7-sl-application/</link>
		<comments>http://www.japf.fr/2010/08/sound-effect-in-wp7-sl-application/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 08:18:03 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=637</guid>
		<description><![CDATA[A coworker and I are currently working on a simple Silverlight game for the Windows Phone 7 platform. In order to give some feedback to our end-user, we decided to add sound effects. Here is a very short post about how we did that. The first thing is to reference the Microsoft.Xna.Framework assembly in your [...]]]></description>
			<content:encoded><![CDATA[<p>A coworker and I are currently working on a simple Silverlight game for the Windows Phone 7 platform. In order to give some feedback to our end-user, we decided to add sound effects. Here is a very short post about how we did that.</p>
<p>The first thing is to reference the <strong>Microsoft.Xna.Framework</strong> assembly in your project. This assembly is needed to access the low-level sound component of XNA right from your Silverlight application. You also need to have your sound effect in a WAVE format file.</p>
<p>Then we created a simple action (from the Blend Behavior toolkit) which is a <em>TargetedTriggerAction</em>:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p637code15'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63715"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code" id="p637code15"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> SoundEffectAction <span style="color: #008000;">:</span> TargetedTriggerAction<span style="color: #008000;">&lt;</span>FrameworkElement<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Source
    <span style="color: #008000;">&#123;</span>
        get <span style="color: #008000;">&#123;</span> <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>GetValue<span style="color: #008000;">&#40;</span>SourceProperty<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
        set <span style="color: #008000;">&#123;</span> SetValue<span style="color: #008000;">&#40;</span>SourceProperty, value<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span> <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #0600FF; font-weight: bold;">readonly</span> DependencyProperty SourceProperty <span style="color: #008000;">=</span> DependencyProperty<span style="color: #008000;">.</span><span style="color: #0000FF;">Register</span><span style="color: #008000;">&#40;</span>
        <span style="color: #666666;">&quot;Source&quot;</span>, 
        <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#41;</span>, 
        <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span>SoundEffectAction<span style="color: #008000;">&#41;</span>, 
        <span style="color: #008000;">new</span> PropertyMetadata<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Empty</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #0600FF; font-weight: bold;">override</span> <span style="color: #6666cc; font-weight: bold;">void</span> Invoke<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> parameter<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">.</span><span style="color: #0000FF;">IsNullOrEmpty</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            var stream <span style="color: #008000;">=</span> TitleContainer<span style="color: #008000;">.</span><span style="color: #0000FF;">OpenStream</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Source</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>stream <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
            <span style="color: #008000;">&#123;</span>
                var effect <span style="color: #008000;">=</span> SoundEffect<span style="color: #008000;">.</span><span style="color: #0000FF;">FromStream</span><span style="color: #008000;">&#40;</span>stream<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                FrameworkDispatcher<span style="color: #008000;">.</span><span style="color: #0000FF;">Update</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                effect<span style="color: #008000;">.</span><span style="color: #0000FF;">Play</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Using this action, we&#8217;re able to wire sound effect right in Blend which produces the following XAML code:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p637code16'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p63716"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p637code16"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Grid</span> <span style="color: #000066;">Margin</span>=<span style="color: #ff0000;">&quot;2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;i:Interaction.Triggers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;i:EventTrigger</span> <span style="color: #000066;">EventName</span>=<span style="color: #ff0000;">&quot;MouseLeftButtonUp&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Actions:SoundEffectAction</span> <span style="color: #000066;">Source</span>=<span style="color: #ff0000;">&quot;Resources/Sounds/Click.wav&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/i:EventTrigger<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/i:Interaction.Triggers<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #808080; font-style: italic;">&lt;!-- rest of the xaml... --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/Grid<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Simple, isn&#8217;t it ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/08/sound-effect-in-wp7-sl-application/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>[WP7] Beta build of the Windows Phone 7 tools is available</title>
		<link>http://www.japf.fr/2010/07/wp7-eta-build-of-the-windows-phone-7-tools-available/</link>
		<comments>http://www.japf.fr/2010/07/wp7-eta-build-of-the-windows-phone-7-tools-available/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 21:40:30 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=610</guid>
		<description><![CDATA[I guess many Windows Phone 7 developers have been waiting for this news since many weeks. It&#8217;s finally official: the Beta build of the Windows Phone 7 tools is out. If you want to download the new version here is the link. This new version has been released during WPC (Microsoft Worldwide Partner Conference). For [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2010/07/windowsphone.png" rel="lightbox[610]"><img class="alignnone size-full wp-image-612" title="windowsphone" src="http://www.japf.fr/wp-content/uploads/2010/07/windowsphone.png" alt="" width="289" height="50" /></a></p>
<p>I guess many Windows Phone 7 developers have been waiting for this news since many weeks. It&#8217;s finally official: <strong>the Beta build of the Windows Phone 7 tools is out</strong>. If you want to download the new version <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&amp;displaylang=en">here is the link</a>.</p>
<p>This new version has been released during <a href="http://digitalwpc.com/">WPC</a> (Microsoft Worldwide Partner Conference). For more information, please check-out:</p>
<ul>
<li><a href="http://windowsteamblog.com/windows_phone/b/wpdev/archive/2010/07/12/windows-phone-developer-tools-beta-released.aspx">the post</a> on the Windows Phone Developer Tools blog.</li>
<li><a href="http://blogs.msdn.com/b/jaimer/archive/2010/06/28/migrating-apps-from-windows-phone-ctps-to-the-beta-build.aspx">this post</a> by Jaime Rodriguez about all breaking change between the April CTP Refresh and the Beta build</li>
<li><a href="http://blogs.msdn.com/b/expression/archive/2010/07/12/windows-phone-developer-tools-beta-released.aspx">this post</a> by the Blend team about the new features available in Blend</li>
<li><a href="http://go.microsoft.com/fwlink/?LinkId=194469">the release note</a></li>
</ul>
<p>Here are a summary of the changes in this new version:</p>
<ul>
<li>Despite HW acceleration effects have been removed from the platform (DropShadow and Blur effects are now no-op). This feature might come back later.</li>
<li>Compatibility with Blend 4 RTM</li>
<li>API near final</li>
<li>Various fixes</li>
</ul>
<p>Note that panorama and pivot controls are coming in the next weeks&#8230; Grab you copy now and enjoy Windows Phone 7 development <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;">http://www.microsoft.com/downloads/details.aspx?FamilyID=c8496c2a-54d9-4b11-9491-a1bfaf32f2e3&amp;displaylang=en</div>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/07/wp7-eta-build-of-the-windows-phone-7-tools-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WP7] Windows Phone 7 challenge for french readers !</title>
		<link>http://www.japf.fr/2010/06/wp7-windows-phone-7-challenge-for-french-readers/</link>
		<comments>http://www.japf.fr/2010/06/wp7-windows-phone-7-challenge-for-french-readers/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 13:49:48 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=565</guid>
		<description><![CDATA[A couple of months ago, the french programming website www.developpez.com organized an event to discover Windows Azure programming (I wrote a blog post about it here). A similar event has just been launched for Windows Phone 7 development at challenge-windowsphone7.developpez.com (tr: &#8220;Let&#8217;s go !&#8221; &#8220;World cup ?&#8221; &#8220;No&#8230; Windows Phone 7 challenge by developpez.com !&#8221;) [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of months ago, the french programming website <a href="http://www.developpez.com">www.developpez.com</a> organized an event to discover Windows Azure programming (I wrote a blog post about it <a href="http://www.japf.fr/2010/01/windows-azure-challenge/">here</a>).</p>
<p>A similar event has just been launched for Windows Phone 7 development at <a href="http://challenge-windowsphone7.developpez.com">challenge-windowsphone7.developpez.com</a></p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/06/header.png" rel="lightbox[565]"><img class="alignnone size-full wp-image-566" title="header" src="http://www.japf.fr/wp-content/uploads/2010/06/header.png" alt="" width="420" height="115" /></a></p>
<p><em>(tr: &#8220;Let&#8217;s go !&#8221; &#8220;World cup ?&#8221; &#8220;No&#8230; Windows Phone 7 challenge by developpez.com !&#8221;)</em></p>
<p>The challenge is made of 6 steps:</p>
<ol>
<li>Tools : download and install the required tools</li>
<li>Quizz : first basic quizz</li>
<li>Silverlight development</li>
<li>Silverlight and push notifications</li>
<li>XNA</li>
<li>Quizz : advanced quizz</li>
</ol>
<p>Each winner will have the following gifts:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/06/cadeaux-all.png" rel="lightbox[565]"><img class="alignnone size-full wp-image-567" title="cadeaux-all" src="http://www.japf.fr/wp-content/uploads/2010/06/cadeaux-all.png" alt="" width="555" height="111" /></a></p>
<p>This kind of challenge is really helpful to discover a new technology the funny way ! I hope I&#8217;ll get my &#8220;I Love Windows Phone&#8221; tee-shirt to wear it this summer <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/06/wp7-windows-phone-7-challenge-for-french-readers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[WP7] Bug when using NavigationService in Windows Phone 7</title>
		<link>http://www.japf.fr/2010/05/bug-when-using-navigationservice-in-windows-phone-7/</link>
		<comments>http://www.japf.fr/2010/05/bug-when-using-navigationservice-in-windows-phone-7/#comments</comments>
		<pubDate>Mon, 03 May 2010 20:45:20 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=542</guid>
		<description><![CDATA[The last couple of days, I&#8217;m playing with my favourite tools in order to build a simple WP7 demo application. I just encountered a weird problem which I wanted to share here&#8230; I&#8217;ll update this article as soon as I&#8217;ll get some feedback from Microsoft about this issue. Note: this problem did not occur if [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of days, I&#8217;m playing with my favourite tools in order to build a simple WP7 demo application. I just encountered a weird problem which I wanted to share here&#8230; I&#8217;ll update this article as soon as I&#8217;ll get some feedback from Microsoft about this issue.</p>
<p><em>Note: this problem did not occur if you&#8217;re using the first CTP of the WP7 tools</em></p>
<p><strong>To reproduce the bug:</strong></p>
<ul>
<li>Create a new Windows Phone 7 application in VS2010</li>
<li>Add a new page (use the default name: Page1)</li>
<li>In the MainPage, add the following XAML code:</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p542code19'); return false;">View Code</a> XML</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54219"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p542code19"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ListBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;Button</span> <span style="color: #000066;">MouseLeftButtonDown</span>=<span style="color: #ff0000;">&quot;Handler&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ListBox<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<ul>
<li>In the code-behind, add the following handler:</li>
</ul>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p542code20'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p54220"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p542code20"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> Handler<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">object</span> sender, MouseButtonEventArgs mouseButtonEventArgs<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">NavigationService</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Navigate</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Uri<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;/Page1.xaml&quot;</span>, UriKind<span style="color: #008000;">.</span><span style="color: #0000FF;">Relative</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<ul>
<li>Run the application and click on the TextBlock</li>
<li>You&#8217;ll get an ArgumentException with the following StackTrace:</li>
</ul>
<p><em>at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[]  cvData)<br />
at MS.Internal.XcpImports.MethodPack(IntPtr objectPtr,  String methodName, Object[] rawData)<br />
at  MS.Internal.XcpImports.UIElement_TransformToVisual(UIElement element,  UIElement visual)<br />
at  System.Windows.UIElement.TransformToVisual(UIElement visual)<br />
at  System.Windows.Controls.ScrollViewer.OnManipulationStarted(ManipulationStartedEventArgs  e)<br />
at System.Windows.Controls.Control.OnManipulationStarted(Control  ctrl, EventArgs e)<br />
at MS.Internal.JoltHelper.FireEvent(IntPtr  unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String  eventName)</em></p>
<p><strong>Analysis:</strong></p>
<p>It took me some time to reproduce this problem in a very simple application. At the very beginning, I though it has something do to with the EventToCommand behavior I was using (from the famous <a href="http://www.galasoft-lb.ch/mvvm/getstarted/">MVVM-Light</a> framework of Laurent Bugnion) but after talking with Laurent it was clear it wasn&#8217;t the case.</p>
<p>The StackTrace seems to indicate a problem with the ScrollViewer of the ListBox&#8230;</p>
<p><strong>Workaround:</strong></p>
<p>Several possibilities seems to be working:</p>
<ol>
<li>Change the ListBox to an ItemsControl</li>
<li>Or, change the event to ManipulationCompleted</li>
</ol>
<p>I didn&#8217;t find the correct location in order to log this issue on Microsoft Connect. Pleas let me know if you have the URL</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/05/bug-when-using-navigationservice-in-windows-phone-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

