<?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; Silverlight</title>
	<atom:link href="http://www.japf.fr/category/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.japf.fr</link>
	<description>Jeremy Alles Presentation Foundation: WPF, .Net and modern software development</description>
	<lastBuildDate>Thu, 29 Jul 2010 07:29:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>MVVM Frameworks Explorer updated</title>
		<link>http://www.japf.fr/2010/07/mvvm-frameworks-explorer-updated/</link>
		<comments>http://www.japf.fr/2010/07/mvvm-frameworks-explorer-updated/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 18:44:25 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[mvvm]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=625</guid>
		<description><![CDATA[Today I&#8217;m releasing a new version of my MVVM Frameworks Explorer application. You can find the updated version here: http://www.japf.fr/silverlight/mvvm/index.html Here is a list of the changes in this new version: application updated to Silverlight 4 support is now detailed for WPF, Silverlight and Windows Phone new frameworks added (MEFedMVVM&#8230;) framework&#8217;s logo added download count [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m releasing a new version of my MVVM Frameworks Explorer application. You can find the updated version here: <a href="http://www.japf.fr/silverlight/mvvm/index.html">http://www.japf.fr/silverlight/mvvm/index.html</a></p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/11/silverlight-mvvm-app.png" rel="lightbox[625]"><img class="alignnone size-full wp-image-370" title="silverlight-mvvm-app" src="http://www.japf.fr/wp-content/uploads/2009/11/silverlight-mvvm-app.png" alt="" width="341" height="177" /></a></p>
<p>Here is a list of the changes in this new version:</p>
<ul>
<li>application updated to Silverlight 4</li>
<li>support is now detailed for WPF, Silverlight and Windows Phone</li>
<li>new frameworks added (MEFedMVVM&#8230;)</li>
<li>framework&#8217;s logo added</li>
<li>download count added (based on the information I found on CodePlex website)</li>
<li>about window</li>
</ul>
<p>As always, feel free to give feedback <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/07/mvvm-frameworks-explorer-updated/feed/</wfw:commentRss>
		<slash:comments>7</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>Leveraging expression trees to unit test ViewModel classes</title>
		<link>http://www.japf.fr/2010/03/leveraging-expression-trees-to-unit-test-viewmodel-classes/</link>
		<comments>http://www.japf.fr/2010/03/leveraging-expression-trees-to-unit-test-viewmodel-classes/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 13:36:53 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[moq]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=483</guid>
		<description><![CDATA[Introduction: In this article, I&#8217;m describing a technique which leverage the expression trees of C# 3.0 in order to facilitate the unit testing of ViewModel&#8217;s properties. My final goal is to be able to unit test a ViewModel property in 1 line. Without any doubt MVVM is now the most used framework to leverage WPF [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction:</strong> In this article, I&#8217;m describing a technique which leverage the expression trees of C# 3.0 in order to facilitate the unit testing of ViewModel&#8217;s properties. My final goal is to be able to unit test a ViewModel property in 1 line.</p>
<p>Without any doubt MVVM is now the most used framework to leverage WPF and Silverlight functionalities in the best way ! During the last <a href="http://live.visitmix.com">Mix</a>, 3 sessions were dedicated to this methodology (you can watch the videos online <a href="http://live.visitmix.com/Videos">here</a>).</p>
<p>As you already know one of the key advantage of the MVVM methodology is to <strong>improve the testability</strong> of the overall application by reducing the amount of code in the code-behind and producing ViewModel classes which are testable. We use to say that ViewModel classes are testable because:</p>
<ul>
<li>they are not coupled to UI concepts (controls, focus, keyboard input&#8230;)</li>
<li>they can wrap model objects using interfaces (for instance a PersonViewModel wraps a IPerson object)</li>
<li>they are not subclassing a UI control (such as Button or Window)</li>
</ul>
<p>Today I&#8217;d like to share a technique I&#8217;m using to facilitate the unit tests of some properties of my ViewModel classes.</p>
<p>Let&#8217;s use a very simple ViewModel class as example:</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('p483code8'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4838"><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
</pre></td><td class="code" id="p483code8"><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> PersonViewModel <span style="color: #008000;">:</span> ViewModelBase
<span style="color: #008000;">&#123;</span>
  <span style="color: #0600FF; font-weight: bold;">private</span> IPerson person<span style="color: #008000;">;</span>
  <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">bool</span> isSelected<span style="color: #008000;">;</span>
&nbsp;
  <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> Name 
  <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;">person</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</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;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">person</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</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;">OnPropertyChanged</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Name&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>
&nbsp;
  <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsSelected
  <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;">isSelected</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;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">isSelected</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;">OnPropertyChanged</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;IsSelected&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>
&nbsp;
  <span style="color: #008080; font-style: italic;">// rest of the code omitted for simplicity</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>The Name property, as usually with the MVVM pattern gets its value from the wrapped model object. The easiest way to unit test this property is to use a mocking library. Here is a example using <a href="http://code.google.com/p/moq/">MOQ</a> (my favourite mocking library):</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('p483code9'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4839"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p483code9"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> TestName<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  var mockPerson <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Mock<span style="color: #008000;">&lt;</span>IPerson<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
  var vm <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> PersonViewModel<span style="color: #008000;">&#40;</span>mockPerson<span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
  vm<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Jeremy&quot;</span><span style="color: #008000;">;</span>
&nbsp;
  <span style="color: #008080; font-style: italic;">// verify that the Name property of the IPerson interface has been set</span>
  mockPerson<span style="color: #008000;">.</span><span style="color: #0000FF;">VerifySet</span><span style="color: #008000;">&#40;</span>p <span style="color: #008000;">=&gt;</span> p<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Jeremy&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>The Selected property is different because it doesn&#8217;t wrap a model property. It&#8217;s an information that is added to the ViewModel layer in order to control a UI-related property (for example the IsSelected property of a ListBoxItem). This technique is heavily used to have ViewModel classes interact with the WPF or Silverlight TreeView or ListBox control (you can check out this <a href="http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx">excellent article</a> of Josh Smith for more detail).</p>
<p>In order to unit test this property, we must:<br />
1/ ensure the PropertyChanged event of the INotifyPropertyChanged is  raised properly<br />
2/ ensure we can write a value and read back the  correct value</p>
<p>Here is a sample code which does this unit test:</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('p483code10'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48310"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p483code10"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> TestName<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
var vm <span style="color: #008000;">=</span> <span style="color: #008000;">new</span>  PersonViewModel<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #6666cc; font-weight: bold;">bool</span> propertyChanged <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
&nbsp;
vm<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">&#40;</span>s, e<span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> propertyChanged <span style="color: #008000;">=</span> e<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyName</span> <span style="color: #008000;">==</span>  <span style="color: #666666;">&quot;Name&quot;</span><span style="color: #008000;">;</span>
vm<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;newName&quot;</span><span style="color: #008000;">;</span>
&nbsp;
Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">IsTrue</span><span style="color: #008000;">&#40;</span>propertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">AreEqual</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;newName&quot;</span>, vm<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>It quickly become cumbersome to copy/paste this unit test for all the ViewModel properties we have. That&#8217;s the reason I started thinking about another way to do it&#8230;</p>
<p>Here is the feature I&#8217;m proposing:</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('p483code11'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48311"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p483code11"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Test<span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> TestName<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
var vm <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> PersonViewModel<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
TestHelper<span style="color: #008000;">.</span><span style="color: #0000FF;">TestProperty</span><span style="color: #008000;">&#40;</span>vm, v <span style="color: #008000;">=&gt;</span> v<span style="color: #008000;">.</span><span style="color: #0000FF;">IsSelected</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>In this sample, I&#8217;m telling I want to test the IsSelected property of the PersonViewModel type. The advantages are:<br />
1/ less code involved : 1 line to test 1 property<br />
2/ intellisense support in order to prevent typing error and no more &#8220;magic&#8221; string to give the name of the property<br />
3/ refactoring the name of the property will refactor this sample code too<br />
4/ automatic generation of default test values behind the scene</p>
<p><strong>How does it works ?</strong></p>
<ul>
<li>TestProperty treats the second parameter as an Expression&lt;Func&gt; and not as a Func directly</li>
<li>Using expression tree (the &#8220;v =&gt; v.IsSelected&#8221; part),  I&#8217;m able to retrieve the name of the property and its type</li>
<li>Using reflection, I&#8217;m able to get and set the value</li>
<li>Depending on the type of the property (string, bool, int, double), I have default values write and read back (with a test to ensure that the PropertyChanged event has been raised properly).</li>
</ul>
<p>Here is the code of the TestPropertyMethod:</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('p483code12'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48312"><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
</pre></td><td class="code" id="p483code12"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> TestProperty<span style="color: #008000;">&lt;</span>T, U<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>T viewmodel, Expression<span style="color: #008000;">&lt;</span>Func<span style="color: #008000;">&lt;</span>T, U<span style="color: #008000;">&gt;&gt;</span> expression<span style="color: #008000;">&#41;</span>
    <span style="color: #0600FF; font-weight: bold;">where</span> T <span style="color: #008000;">:</span> INotifyPropertyChanged
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">if</span><span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span> <span style="color: #008000;">is</span> MemberExpression<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        MemberExpression memberExpression <span style="color: #008000;">=</span> <span style="color: #008000;">&#40;</span>MemberExpression<span style="color: #008000;">&#41;</span> expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span> <span style="color: #008000;">==</span> <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">bool</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            TestViewModelProperty<span style="color: #008000;">&#40;</span>viewmodel, memberExpression<span style="color: #008000;">.</span><span style="color: #0000FF;">Member</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span>, <span style="color: #0600FF; font-weight: bold;">true</span>, <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span> <span style="color: #008000;">==</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;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            TestViewModelProperty<span style="color: #008000;">&#40;</span>viewmodel, memberExpression<span style="color: #008000;">.</span><span style="color: #0000FF;">Member</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span>, <span style="color: #666666;">&quot;value1&quot;</span>, <span style="color: #666666;">&quot;value2&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span> 
        <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span> <span style="color: #008000;">==</span> <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            TestViewModelProperty<span style="color: #008000;">&#40;</span>viewmodel, memberExpression<span style="color: #008000;">.</span><span style="color: #0000FF;">Member</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span>, <span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">99</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">else</span> <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>expression<span style="color: #008000;">.</span><span style="color: #0000FF;">Body</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span> <span style="color: #008000;">==</span> <span style="color: #008000;">typeof</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">double</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
        <span style="color: #008000;">&#123;</span>
            TestViewModelProperty<span style="color: #008000;">&#40;</span>viewmodel, memberExpression<span style="color: #008000;">.</span><span style="color: #0000FF;">Member</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span>, <span style="color: #FF0000;">1.0</span>, <span style="color: #FF0000;">99.0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #008000;">&#125;</span>
        <span style="color: #0600FF; font-weight: bold;">else</span>
        <span style="color: #008000;">&#123;</span>
            <span style="color: #0600FF; font-weight: bold;">throw</span> <span style="color: #008000;">new</span> NotSupportedException<span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Type is not supported&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>And the TestViewModelProperty:</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('p483code13'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48313"><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="p483code13"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> TestViewModelProperty<span style="color: #008000;">&lt;</span>T, U<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>T viewModel, <span style="color: #6666cc; font-weight: bold;">string</span> propertyName, U value1, U value2<span style="color: #008000;">&#41;</span>
    <span style="color: #0600FF; font-weight: bold;">where</span> T <span style="color: #008000;">:</span> INotifyPropertyChanged
<span style="color: #008000;">&#123;</span>
    <span style="color: #6666cc; font-weight: bold;">bool</span> propertyChanged<span style="color: #008000;">;</span>
    viewModel<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyChanged</span> <span style="color: #008000;">+=</span> <span style="color: #008000;">&#40;</span>s, e<span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span> propertyChanged <span style="color: #008000;">=</span> e<span style="color: #008000;">.</span><span style="color: #0000FF;">PropertyName</span> <span style="color: #008000;">==</span> propertyName<span style="color: #008000;">;</span>
&nbsp;
    propertyChanged <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
    viewModel<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span>propertyName, value1<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">IsTrue</span><span style="color: #008000;">&#40;</span>propertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">IsTrue</span><span style="color: #008000;">&#40;</span>viewModel<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&lt;</span>U<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span>value1<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
    propertyChanged <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">false</span><span style="color: #008000;">;</span>
    viewModel<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span>propertyName, value2<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">IsTrue</span><span style="color: #008000;">&#40;</span>propertyChanged<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    Assert<span style="color: #008000;">.</span><span style="color: #0000FF;">IsTrue</span><span style="color: #008000;">&#40;</span>viewModel<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&lt;</span>U<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Equals</span><span style="color: #008000;">&#40;</span>value2<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>

<p>I&#8217;m using 2 extensions methods in order to get and set value from the ViewModel object using reflection. Here they are:</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('p483code14'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48314"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p483code14"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> T GetValue<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> <span style="color: #6666cc; font-weight: bold;">object</span> obj, <span style="color: #6666cc; font-weight: bold;">string</span> propertyName<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var propertyInfo <span style="color: #008000;">=</span> obj<span style="color: #008000;">.</span><span style="color: #0000FF;">GetType</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetProperty</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #008000;">&#40;</span>T<span style="color: #008000;">&#41;</span>propertyInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">GetValue</span><span style="color: #008000;">&#40;</span>obj, <span style="color: #0600FF; font-weight: bold;">null</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: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> SetValue<span style="color: #008000;">&lt;</span>T<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #0600FF; font-weight: bold;">this</span> <span style="color: #6666cc; font-weight: bold;">object</span> obj, <span style="color: #6666cc; font-weight: bold;">string</span> propertyName, T value<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    var propertyInfo <span style="color: #008000;">=</span> obj<span style="color: #008000;">.</span><span style="color: #0000FF;">GetType</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetProperty</span><span style="color: #008000;">&#40;</span>propertyName<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    propertyInfo<span style="color: #008000;">.</span><span style="color: #0000FF;">SetValue</span><span style="color: #008000;">&#40;</span>obj, value, <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Please feel free to <a href="http://www.japf.fr/wp-content/uploads/2010/03/TestViewModelHelper.txt">download the source code</a> of the ViewModelTestHelper class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/03/leveraging-expression-trees-to-unit-test-viewmodel-classes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Mix10 :  first Windows Phone application using Blend4</title>
		<link>http://www.japf.fr/2010/03/mix10-first-windows-phone-application-using-blend4/</link>
		<comments>http://www.japf.fr/2010/03/mix10-first-windows-phone-application-using-blend4/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 20:35:33 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[blend]]></category>
		<category><![CDATA[mix10]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=473</guid>
		<description><![CDATA[You&#8217;ll need not more than a couple of minutes to download and install all the tools needed to create your first Windows Phone application using Blend. Here is a tour in images: Welcome in Blend 4 Discovering new projects templates in the Welcome dialog: It must be quite familiar to you if you&#8217;re working with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" rel="lightbox[473]"><img class="alignnone size-full wp-image-456" title="Mix10" src="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" alt="" width="157" height="96" /></a></p>
<p>You&#8217;ll need not more than a couple of minutes to download and install <a href="http://www.japf.fr/2010/03/mix10-windows-phone-7-series-development-tools-available/">all the tools</a> needed to create your first Windows Phone application using Blend.</p>
<p><a href="../wp-content/uploads/2010/03/WindowsPhone7Series2.jpg" rel="lightbox[473]"><img title="WindowsPhone7Series2" src="../wp-content/uploads/2010/03/WindowsPhone7Series2.jpg" alt="" width="521" height="307" /></a></p>
<p>Here is a tour in images:</p>
<p>Welcome in Blend 4</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend1.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-474" title="Blend1" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend1.png" alt="" width="173" height="262" /></a></p>
<p>Discovering new projects templates in the Welcome dialog:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend2.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-475" title="Blend2" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend2.png" alt="" width="350" height="296" /></a></p>
<p>It must be quite familiar to you if you&#8217;re working with WPF or Silverlight</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend3.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-476" title="Blend3" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend3.png" alt="" width="697" height="522" /></a></p>
<p>Choosing a target</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend4.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-477" title="Blend4" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend4.png" alt="" width="268" height="153" /></a></p>
<p>Launching the app in the emulator</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend5.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-478" title="Blend5" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend5.png" alt="" width="272" height="479" /></a></p>
<p>App.xaml file has all the resources for the Windows Phone theme</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Blend6.png" rel="lightbox[473]"><img class="alignnone size-full wp-image-479" title="Blend6" src="http://www.japf.fr/wp-content/uploads/2010/03/Blend6.png" alt="" width="385" height="204" /></a></p>
<p>Let&#8217;s go now and play with the tools <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/03/mix10-first-windows-phone-application-using-blend4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mix10: Windows Phone 7 series development tools available</title>
		<link>http://www.japf.fr/2010/03/mix10-windows-phone-7-series-development-tools-available/</link>
		<comments>http://www.japf.fr/2010/03/mix10-windows-phone-7-series-development-tools-available/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 19:40:27 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[mix10]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=469</guid>
		<description><![CDATA[The first keynote of Mix10 is just over and the biggest announcement I was waiting for occured: Windows Phone 7 series development tools are NOW available for FREE. Grab the tools right now ! You&#8217;ll need: Expression Blend 4 Beta Windows Phone Developer Tools Expression Blend Add-in for Windows Phone Expression Blend SDK for Windows [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" rel="lightbox[469]"><img class="alignnone size-full wp-image-456" title="Mix10" src="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" alt="" width="157" height="96" /></a></p>
<p>The first keynote of Mix10 is just over and the biggest announcement I was waiting for occured: Windows Phone 7 series development tools are NOW available for FREE.</p>
<p>Grab the tools right now ! You&#8217;ll need:</p>
<ul>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=6f014e07-0053-4aca-84a7-cd82f9aa989f&amp;displaylang=en">Expression Blend 4 Beta</a></li>
<li><a href="http://developer.windowsphone.com/windows-phone-7-series">Windows Phone Developer Tools</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=47f5c718-9dec-4557-9687-619c0fdd3d4f&amp;displaylang=en">Expression Blend Add-in for Windows Phone</a></li>
<li><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=86370108-4c14-42ee-8855-226e5dd9b85b">Expression Blend SDK for Windows Phone</a></li>
</ul>
<p>If you want more details about Blend4, you can check out Christian Schormann&#8217;s <a href="http://electricbeach.org/?p=438">overview</a>.<a href="http://electricbeach.org/?p=438" target="_blank"><strong> </strong></a> A new website is now live for all Windows Phone 7 series related development information at <a href="http://developer.windowsphone.com/">http://developer.windowsphone.com/</a></p>
<p>Another announcements is the availability of Silverlight 4 RC and support for VS2010 RC:</p>
<ul>
<li><a href="http://go.microsoft.com/fwlink/?LinkID=141284">Silverlight  4 Tools for Visual Studio 2010</a> (this installs Silverlight developer  runtime, SDK, tools, and <a href="http://silverlight.net/riaservices">WCF  RIA Services</a>).</li>
<li><a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> March 2010 Release</li>
<li><a href="http://go.microsoft.com/fwlink/?LinkId=185121">WCF RIA  Services Toolkit</a></li>
<li><a href="http://go.microsoft.com/fwlink/?LinkId=169446">Expression  Blend 4 beta</a></li>
<li><a href="http://go.microsoft.com/fwlink/?LinkId=167831">BREAKING  CHANGES DOCUMENTATION</a></li>
<li><a href="http://silverlight.net/getstarted/devices/windows-phone">Windows  Phone Developer tools</a></li>
</ul>
<p>For more information about Silverlight 4 RC, you can check out the blog post of <a href="http://timheuer.com/blog/archive/2010/03/15/whats-new-in-silverlight-4-rc-mix10.aspx?utm_source=Twitter-timheuer">Tim Heuer</a>.</p>
<p>I can&#8217;t wait to play with all this new stuff. It&#8217;s very impressive to see the work done around Windows Phone 7 series. WPF and Silverlight developers just became Windows Phone developer today, and I think this is great !</p>
<p>I&#8217;ll give more feedback as soon as the tools will be installed <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/03/mix10-windows-phone-7-series-development-tools-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mix10 starting today !</title>
		<link>http://www.japf.fr/2010/03/mix10-starting-today/</link>
		<comments>http://www.japf.fr/2010/03/mix10-starting-today/#comments</comments>
		<pubDate>Mon, 15 Mar 2010 07:51:21 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[mix10]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=466</guid>
		<description><![CDATA[Mix10 is starting today and we can expect many cool announcements during the keynote. You can watch the keynote online at live.visitmix.com. I&#8217;ll try to give feedback as soon as possible. Because I&#8217;m not lucky enough to be in Vegas, I&#8217;ll watch the keynote tonight (French time !) at home with some coworkers. Last information [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" rel="lightbox[466]"><img class="alignnone size-full wp-image-456" title="Mix10" src="http://www.japf.fr/wp-content/uploads/2010/03/Mix101.jpg" alt="" width="157" height="96" /></a></p>
<p>Mix10 is starting today and we can expect many cool announcements during the keynote. You can watch the keynote online at <a href="http://live.visitmix.com/">live.visitmix.com</a>. I&#8217;ll try to give feedback as soon as possible. Because I&#8217;m not lucky enough to be in Vegas, I&#8217;ll watch the keynote tonight (French time !) at home with some coworkers.</p>
<p>Last information before the keynote, it looks like we&#8217;ll have some announcements about <a href="http://blogs.zdnet.com/microsoft/?p=5550&amp;utm_source=feedburner&amp;utm_medium=feed&amp;utm_campaign=Feed%3A+zdnet%2Fmicrosoft+%28ZDNet+All+About+Microsoft%29&amp;utm_content=Google+Reader">Silverlight running on Symbian</a> devices&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/03/mix10-starting-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mix10 is coming : Windows Phone 7 series sessions announced !</title>
		<link>http://www.japf.fr/2010/03/mix10-is-coming-windows-phone-7-series-sessions-announced/</link>
		<comments>http://www.japf.fr/2010/03/mix10-is-coming-windows-phone-7-series-sessions-announced/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 21:34:21 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[mix10]]></category>
		<category><![CDATA[wp7]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=449</guid>
		<description><![CDATA[Next monday, Mix10 will start in Las Vegas. Even though it&#8217;s a little bit far from my place here in France I&#8217;ll try to give feedback after the keynotes and as soon as first videos will be available. I&#8217;m sure you&#8217;re aware that major announcements this years at Mix will be about the Windows Phone [...]]]></description>
			<content:encoded><![CDATA[<p>Next monday, Mix10 will start in Las Vegas. Even though it&#8217;s a little bit far from my place here in France I&#8217;ll try to give feedback after the keynotes and as soon as first videos will be available. I&#8217;m sure you&#8217;re aware that major announcements this years at Mix will be about the Windows Phone 7 series.</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/03/3-windows-mobile.jpg" rel="lightbox[449]"><img class="alignnone size-full  wp-image-451" title="3-windows-mobile" src="http://www.japf.fr/wp-content/uploads/2010/03/3-windows-mobile.jpg" alt="" width="371" height="244" /></a></p>
<p>To make the long story short :</p>
<ul>
<li>Windows Mobile 7 was <a href="http://www.microsoft.com/presspass/presskits/windowsphone/VideoGallery.aspx">presented during last WMC</a> (Word Mobile Congress) under the name &#8220;Windows Phone 7 series&#8221;</li>
<li>Microsoft demonstrated the new UI experience coming with this new version</li>
<li>Microsoft <a href="http://blogs.msdn.com/ckindel/archive/2010/03/04/different-means-better-with-the-new-windows-phone-developer-experience.aspx">confirmed</a> that Silverlight and XNA will be the technologies available to develop on the Windows Phone</li>
<li>Microsoft <a href="http://www.engadget.com/2010/03/06/microsoft-shows-off-single-game-running-on-windows-windows-phon/">shows off single game running on Windows, Windows Phone and  Xbox</a></li>
</ul>
<p>I&#8217;m sure you realize that we are going to a very capable and powerful mobile platform here:</p>
<ul>
<li>all existing .Net and Silverlight developers are going to be able to write apps for the Windows Phone (this is HUGE)</li>
<li>we are going to finally have the 3 screens version of Microsoft: develop once and then run on your mobile, your PC and your TV (XBox)</li>
</ul>
<p>Mix10 website now contains the name and the description of the sessions which are dedicated to the Windows Phone 7 series:</p>
<ul>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL23">Designing and Developing for the Rich Mobile Web</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL22">Building a High Performance 3D Game for Windows Phone</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL21">Building Windows Phone Games</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL01">Changing our Game – an Introduction to Windows Phone 7 Series</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL15">An Introduction to Developing Applications for Microsoft Silverlight</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL14">Windows Phone UI and Design Language</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL13">Overview of the Windows Phone 7 Series Application Platform</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL16">Building Windows Phone Applications with Silverlight, Part 1</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL17">Building Windows Phone Applications with Silverlight, Part 2</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL59">Unit Testing Silverlight and Windows Phone 7 Applications</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL60">Silverlight Performance on Windows Phone</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL20">Distributing and Monetizing Windows Phone Applications and Games</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL19">Development and Debugging Tools for Building XNA Games for Windows Phone</a></li>
<li><a href="http://live.visitmix.com/MIX10/Sessions/CL18">Windows Phone Application Platform Architecture</a></li>
</ul>
<p>If you&#8217;re using Twitter, make sure to watch the <a href="http://twitter.com/#search?q=%23wp7">#wp7</a> hashtag. It make not any doubt the next week is going to be very informative about Windows Phone 7 series.So stay tuned !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/03/mix10-is-coming-windows-phone-7-series-sessions-announced/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minor update to the Silverlight MVVM frameworks explorer</title>
		<link>http://www.japf.fr/2010/01/minor-update-to-the-silverlight-mvvm-frameworks-explorer/</link>
		<comments>http://www.japf.fr/2010/01/minor-update-to-the-silverlight-mvvm-frameworks-explorer/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 12:48:19 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[toolkit]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=428</guid>
		<description><![CDATA[Thanks to the readers who gave me feedback on my Silverlight MVVM frameworks explorer I updated the application this morning in order to fix some problems. Here is the change set: fix incorrect URLs fix incorrect &#8220;Silverlight Support&#8221; options. As Laurent Bugnion said in the comments, his MVVM Light framework was the only one supporting [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to the readers who gave me feedback on my <a href="http://www.japf.fr/silverlight/mvvm/index.html">Silverlight MVVM frameworks explorer</a> I updated the application this morning in order to fix some problems.</p>
<p>Here is the change set:</p>
<ul>
<li>fix incorrect URLs</li>
<li>fix incorrect &#8220;Silverlight Support&#8221; options. As Laurent Bugnion said in the comments, his MVVM Light framework was the only one supporting Silverlight which was strange&#8230;</li>
<li>links now open in a new window</li>
</ul>
<p>Click on the following image to launch the Silverlight application.</p>
<p><a href="http://www.japf.fr/silverlight/mvvm/index.html"><img class="alignnone size-medium wp-image-370" title="silverlight-mvvm-app" src="http://www.japf.fr/wp-content/uploads/2009/11/silverlight-mvvm-app-300x156.png" alt="" width="314" height="163" /></a></p>
<p>About adding new frameworks, I&#8217;m not sure to add those which targets a much larger domain than MVVM itself. CompositeApplication guidance for example is a lot more than MVVM&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/01/minor-update-to-the-silverlight-mvvm-frameworks-explorer/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WPF internals part 2 : how the WPF controls are organized ?</title>
		<link>http://www.japf.fr/2010/01/wpf-internals-how-the-wpf-controls-are-organised/</link>
		<comments>http://www.japf.fr/2010/01/wpf-internals-how-the-wpf-controls-are-organised/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:35:32 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[architecture]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=394</guid>
		<description><![CDATA[A couple of weeks ago, I started a series of articles about WPF internals organization. In the first article I did a tour of the core WPF classes. In this second part, I&#8217;m reviewing the organization of the various controls that exist in the framework. Because the image of the diagram is pretty big, I [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago, I started a series of articles about <a href="http://www.japf.fr/wpf-internals/">WPF internals</a> organization. In <a href="http://www.japf.fr/2009/10/wpf-internals-part-1-what-are-the-core-wpf-classes/">the first article</a> I did a tour of the core WPF classes. In this second part, I&#8217;m reviewing the organization of the various controls that exist in the framework.</p>
<p>Because the image of the diagram is pretty big, I decided to use Silverlight DeepZoom and the result is just below this text <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  You can download the <a href="http://www.japf.fr/wp-content/uploads/2010/01/WpfControlsFull.png" target="_blank" rel="lightbox[394]">full image resolution here</a>. Please use the full screen button in the upper right corner of the viewer for the best browsing experience.</p>
<p><script type="text/javascript">
        function onSilverlightError(sender, args) 
        {
            var appSource = "";
            if (sender != null &#038;&#038; sender != 0)
            {
                appSource = sender.getHost().Source;
            }
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;</p>
<p>            var errMsg = "Unhandled Error in Silverlight 2 Application " + appSource + "\n";</p>
<p>            errMsg += "Code: " + iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";</p>
<p>            if (errorType == "ParserError") 
            {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") 
            {
                if (args.lineNumber != 0) 
                {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " + args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }</p>
<p>            throw new Error(errMsg);
        }
</script></p>
<div id="slPluginHost">
		<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="540" height="500"><param name="minRuntimeVersion" value="3.0.40307.0" /><param name="autoUpgrade" value="false" /><param name="source" value="http://www.japf.fr/silverlight/wpfcontrolsexplorer/WpfControlsExplorer.xap"/><param name="onerror" value="onSilverlightError" /><param name="background" value="white" /><param name="initParams" value="adFile=http://www.japf.fr/silverlight/wpfcontrolsexplorer/GeneratedImages" /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"><br />
                <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/><br />
            </a><br />
        </object><br />
	<iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe>
</div>
<ul></ul>
<p>Here are general remarks that might help you get information from those diagrams.</p>
<p>The top level <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.control.aspx">Control</a> class:</p>
<ul>
<li>Defines general UI properties such as Background, Foreground, BorderBrush and BorderThickness</li>
<li>Defines a set of properties to control font rendering: FontFamily, FontSize, FontStyle&#8230;</li>
<li>Has a DoubleClick event (other mouse events such as MouseUp/MouseDown comes from the UIElement class)</li>
</ul>
<p>Below the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.control.aspx">Control</a> class, we have (this list is not complete):</p>
<ul>
<li>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx">ContentControl</a> class: those controls have&#8230; a single Content</li>
<li>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx">ItemsControls</a> class which handles a collection of child controls</li>
<li>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.textboxbase.aspx">TextBoxBase</a> class which is the parent of <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.textbox.aspx">TextBox</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox.aspx">RichTextBox</a></li>
<li>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.rangebase.aspx">RangerBase</a> class which handles a range (minimum, maximum) and which is the parent of the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.scrollbar.aspx">ScrollBar</a>, <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.slider.aspx">Slider</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.progressbar.aspx">ProgressBar</a> classes</li>
<li>The <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.thumb.aspx">Thumb</a> class which has the ability to be dragged over a surface</li>
</ul>
<p>Below the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx">ContentControl</a> class we can find many existing WPF controls:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.buttonbase.aspx">ButtonBase</a> and its child: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.button.aspx">Button</a>, <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.togglebutton.aspx">ToggleButton</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.repeatbutton.aspx">RepeatButton</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.label.aspx">Label</a> (see <a href="http://joshsmithonwpf.wordpress.com/2007/07/04/differences-between-label-and-textblock/">this post</a> for an explanation of the differences between a Label and a TextBlock)</li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listboxitem.aspx">ListBoxItem</a> and its children: <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listviewitem.aspx">ListViewItem</a>, <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.comboboxitem.aspx">ComboBoxItem</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.aspx">ScrollViewer</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.headeredcontentcontrol.aspx">HeaderedContentControl</a>, a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx">ContentControl</a> that has both a Content and a Header. This is the case of the <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.expander.aspx">Expander</a>, <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.groupbox.aspx">GroupBox</a> and <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.tabitem.aspx">TabItem</a> controls</li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.tooltip.aspx">Tooltip</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.window.aspx">Window</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx">UserControl</a></li>
</ul>
<p>General other remarks:</p>
<ul>
<li>It&#8217;s funny to see that both Window and UserControl inherits from ContentControl. Before doing the diagram I though that Window came from somewhere else <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>Having those diagrams in mind (or on a screen !) is very useful when you need to create your own custom control</li>
<li>We can see the differences between creating a custom control (inherit from Control or derived class) and a UserControl (inherit from UserControl)</li>
<li>.Net4 will introduce new controls (not in this diagram) in the WPF framework such: DataGrid, Calendar, TimePicker</li>
</ul>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.japf.fr%2f2010%2f01%2fwpf-internals-how-the-wpf-controls-are-organised%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.japf.fr%2f2010%2f01%2fwpf-internals-how-the-wpf-controls-are-organised%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/01/wpf-internals-how-the-wpf-controls-are-organised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Discover and compare existing MVVM frameworks !</title>
		<link>http://www.japf.fr/2009/11/discover-compare-existing-mvvm-frameworks/</link>
		<comments>http://www.japf.fr/2009/11/discover-compare-existing-mvvm-frameworks/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 21:31:50 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[silverlifgt]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=369</guid>
		<description><![CDATA[A couple of weeks ago, I wrote a blog post where I compared the existing MVVM frameworks. This post became a bit famous in the WPF/Silverlight blog world and I received a lot of feedback to update the list, fix information, etc. I also got a request from Erik suggesting me to put all the [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of weeks ago, I wrote <a href="http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/">a blog post</a> where I compared the existing MVVM frameworks. This post became a bit famous in the WPF/Silverlight blog world and I received a lot of feedback to update the list, fix information, etc. I also got a request from Erik suggesting me to put all the datas in a matrix.</p>
<p>Today I&#8217;m proud to announce the <a href="http://www.japf.fr/silverlight/mvvm/index.html">MVVM frameworks Silverlight application</a> (click the image to open the Silverlight3 page).</p>
<p><a href="http://www.japf.fr/silverlight/mvvm/index.html"><img class="alignnone size-full wp-image-370" title="silverlight-mvvm-app" src="http://www.japf.fr/wp-content/uploads/2009/11/silverlight-mvvm-app.png" alt="silverlight-mvvm-app" width="562" height="293" /></a></p>
<p>A couple of observation:</p>
<ul>
<li>please contact me via <a href="http://japf.fr/contact">this blog</a> or <a href="http://www.twitter.com/jalpf">twitter</a> if you find incorrect information</li>
<li>I&#8217;m not judging anybody&#8217;s work by giving rating, it&#8217;s just my personal feeling to have an easiest way to sort the data</li>
</ul>
<p>Hope you&#8217;ll like it <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/2009/11/discover-compare-existing-mvvm-frameworks/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
	</channel>
</rss>
