<?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; .Net</title>
	<atom:link href="http://www.japf.fr/category/net/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>Attributes-based validation in a WPF MVVM application</title>
		<link>http://www.japf.fr/2010/07/attributes-based-validation-in-a-wpf-mvvm-application/</link>
		<comments>http://www.japf.fr/2010/07/attributes-based-validation-in-a-wpf-mvvm-application/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 07:29:32 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[codeproject]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=630</guid>
		<description><![CDATA[Today, I&#8217;m proud to share with you my very first article available on CodeProject. This article presents a technique which can be used in order to add validation in a WPF MVVM application based on attribute. Basically, it means that you can write validation logic like that (notice the attribute associated to this property): ?View [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I&#8217;m proud to share with you my very first article available on <a href="http://www.codeproject.com/KB/smart/WPF_Validation_Attribute.aspx">CodeProject</a>. This article presents a technique which can be used in order to add validation in a WPF MVVM application based on attribute. Basically, it means that you can write validation logic like that (notice the attribute associated to this property):</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('p630code2'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6302"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p630code2"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&#91;</span>Required<span style="color: #008000;">&#40;</span>ErrorMessage <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;Field 'FirstName' is required.&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#93;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> FirstName
<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;">firstName</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;">firstName</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;FirstName&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></pre></td></tr></table></div>

<p>Of course the article comes with a nice demo application:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2010/07/02.png" rel="lightbox[630]"><img class="alignnone size-full wp-image-631" title="02" src="http://www.japf.fr/wp-content/uploads/2010/07/02.png" alt="" width="411" height="160" /></a></p>
<p>You can read the full article here: <a href="http://www.codeproject.com/KB/smart/WPF_Validation_Attribute.aspx">Attributes-based validation in a WPF MVVM application</a></p>
<p><em><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/07/attributes-based-validation-in-a-wpf-mvvm-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where does the default TwoWay binding comes from ?</title>
		<link>http://www.japf.fr/2010/07/where-does-the-default-twoway-binding-comes-from/</link>
		<comments>http://www.japf.fr/2010/07/where-does-the-default-twoway-binding-comes-from/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 11:50:43 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[dependency properties]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=620</guid>
		<description><![CDATA[I got a comment on my post about a very simple MVVM application about the fact that removing the TwoWay mode on a binding did not change the behavior of the application. This is a quick occasion for me to share a quick explanation about this. Actually and as you already know if you can [...]]]></description>
			<content:encoded><![CDATA[<p>I got a comment on my post about <a href="http://www.japf.fr/2009/02/very-simple-mvvm-demo-application/">a very simple MVVM application</a> about the fact that removing the TwoWay mode on a binding did not change the behavior of the application. This is a quick occasion for me to share a quick explanation about this.</p>
<p>Actually and as you already know if you can write <em>XAML </em>like <em>Text={Binding &#8230;}</em> it is only because <em>Text </em>is a<em> Dependency Property</em>. Also, dependency properties are defined in a static way (so that if you have 50 textboxes you don&#8217;t have to instantiate 50 times the Text property). The default behavior for the mode of the binding (TwoWay, OneWay, etc.) can be found in the static declaration of the dependency property. For example, in the case of the Text property of the TextBox we have:</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('p620code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p6204"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p620code4"><pre class="csharp" style="font-family:monospace;">TextProperty <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;Text&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>TextBox<span style="color: #008000;">&#41;</span>, 
	<span style="color: #008000;">new</span> FrameworkPropertyMetadata<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>, 
		FrameworkPropertyMetadataOptions<span style="color: #008000;">.</span><span style="color: #0000FF;">Journal</span> 
		<span style="color: #008000;">|</span> FrameworkPropertyMetadataOptions<span style="color: #008000;">.</span><span style="color: #0000FF;">BindsTwoWayByDefault</span>,
	<span style="color: #008000;">new</span> PropertyChangedCallback<span style="color: #008000;">&#40;</span>TextBox<span style="color: #008000;">.</span><span style="color: #0000FF;">OnTextPropertyChanged</span><span style="color: #008000;">&#41;</span>, 
	<span style="color: #008000;">new</span> CoerceValueCallback<span style="color: #008000;">&#40;</span>TextBox<span style="color: #008000;">.</span><span style="color: #0000FF;">CoerceText</span><span style="color: #008000;">&#41;</span>,
	<span style="color: #0600FF; font-weight: bold;">true</span>, 
	UpdateSourceTrigger<span style="color: #008000;">.</span><span style="color: #0000FF;">LostFocus</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>The interesting part here if of course the <em>BindsTwoWayByDefault</em> option. Note that this is the only default option available (we can&#8217;t have a OneWayToSource binding by default).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/07/where-does-the-default-twoway-binding-comes-from/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>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('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
30
31
32
33
</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: #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('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
</pre></td><td class="code" id="p483code13"><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('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
12
</pre></td><td class="code" id="p483code14"><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('p483code15'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48315"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p483code15"><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('p483code16'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48316"><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="p483code16"><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('p483code17'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48317"><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="p483code17"><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('p483code18'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p48318"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p483code18"><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 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>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>
		<item>
		<title>PDC09 : How VS2010 was built with WPF ?</title>
		<link>http://www.japf.fr/2009/11/pdc09-how-vs2010-was-built-with-wpf/</link>
		<comments>http://www.japf.fr/2009/11/pdc09-how-vs2010-was-built-with-wpf/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 11:24:01 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[pdc]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=362</guid>
		<description><![CDATA[In my last blog post, I did a review of a PDC09 Session &#8220;Advanced performance tuning with WPF&#8221;. Today, I&#8217;m doing a review for another very interesting session &#8220;How VS2010 was built with WPF ?&#8221;. The video is available here. Why did Microsoft choose WPF for VS2010 ? Technological: prove the capabilities of WPF4 Architectural [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2009/08/PDC09.jpg" rel="lightbox[362]"><img class="alignnone size-full wp-image-245" title="PDC09" src="http://www.japf.fr/wp-content/uploads/2009/08/PDC09.jpg" alt="PDC09" width="79" height="109" /></a></p>
<p>In my <a href="http://www.japf.fr/2009/11/pdc09-wpf-application-performance-tuning/">last blog post</a>, I did a review of a PDC09 Session &#8220;Advanced performance tuning with WPF&#8221;. Today, I&#8217;m doing a review for another very interesting session &#8220;<strong>How VS2010 was built with WPF</strong> ?&#8221;. The video is available <a href="http://microsoftpdc.com/Sessions/CL09">here</a>.</p>
<p style="text-align: center;"><a href="http://www.japf.fr/wp-content/uploads/2009/11/vs2008tovs2010.png" rel="lightbox[362]"><img class="size-large wp-image-365 aligncenter" title="vs2008tovs2010" src="http://www.japf.fr/wp-content/uploads/2009/11/vs2008tovs2010-1024x361.png" alt="vs2008tovs2010" width="543" height="191" /></a></p>
<p>Why did Microsoft choose WPF for VS2010 ?</p>
<ul>
<li>Technological: prove the capabilities of WPF4</li>
<li>Architectural
<ul>
<li>Separated presentation</li>
<li>Support for long range road map (+10 years)</li>
</ul>
</li>
<li>Key VS2010 features need it: Editor, Architecture Editor, Parallel tools debugging</li>
<li>Take an opportunity to give feedback for WPF4: when VS2010 development started, .Net 3.5 SP1 was just shipped and it was the right time to give feedback for the new features and fixes for WPF4.</li>
</ul>
<p>It is worth noting that VS2010 is a project that is being watched carefully inside Microsoft. We can expect that more Microsoft applications will move to WPF in the next coming years.</p>
<p>What WPF features are used ?</p>
<ul>
<li>Declarative UI using XAML</li>
<li>Databinding</li>
<li>Styles and templates</li>
<li>Application Resources</li>
<li>Interop Win32 (because they did not have the time to rewrite everything using WPF or because features doest not need to use WPF for example de WinForms designer&#8230;)</li>
<li>Integration with the message loop (to deal with particular focus issues)</li>
<li>New text stack (part of WPF4) based on DirectWrite</li>
</ul>
<p>Staged approach</p>
<ul>
<li>Define data models: a huge diagramming and architectural exercice</li>
<li>Replace the main window with WPF (only the window not its content !) to start the mix approach (managed/unmanaged, WPF/Hwnds)</li>
<li>Write new managed components: Window manager, command bar presentation</li>
<li>Scout with other VS teams</li>
<li>Test, Test, Test&#8230;</li>
</ul>
<p>What were the challenges ?</p>
<ul>
<li>Mixed mode application: native and managed code; WPF and HWNDs (Win32 or WinForms)</li>
<li>Keep existing extensions working and allow new extensions to take advantage of WPF</li>
<li>Don&#8217;t &#8220;stop the train&#8221; other teams were working at the same time on the product to add new functionalities</li>
<li>Text clarity</li>
<li>Performance</li>
<li>Focus management</li>
</ul>
<p>You can watch the session <a href="http://microsoftpdc.com/Sessions/CL09">here</a> if you want more detail and demos of what I mention in this post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/11/pdc09-how-vs2010-was-built-with-wpf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Snoop to take a look at VS2010 !</title>
		<link>http://www.japf.fr/2009/11/using-snoop-with-vs2010/</link>
		<comments>http://www.japf.fr/2009/11/using-snoop-with-vs2010/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 15:34:28 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[snoop]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=332</guid>
		<description><![CDATA[If like me you&#8217;re curious about how big WPF applications are made, you probably tried to use Snoop to inspect the visual tree of Visual Studio 2010 Beta2. And you probably had a problem because Snoop wasn&#8217;t able to detect the devenv process of VS2010: I wasn&#8217;t sure about the cause of this problem, but [...]]]></description>
			<content:encoded><![CDATA[<p>If like me you&#8217;re curious about how big WPF applications are made, you probably tried to use <a href="http://blois.us/Snoop/">Snoop</a> to inspect the visual tree of Visual Studio 2010 Beta2. And you probably had a problem because Snoop wasn&#8217;t able to detect the devenv process of VS2010:</p>
<p>I wasn&#8217;t sure about the cause of this problem, but I grab the source of Snoop and took a look at the code that list the available window:</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('p332code21'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33221"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p332code21"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Refresh<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;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><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;">foreach</span> <span style="color: #008000;">&#40;</span>IntPtr windowHandle <span style="color: #0600FF; font-weight: bold;">in</span> NativeMethods<span style="color: #008000;">.</span><span style="color: #0000FF;">ToplevelWindows</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
		WindowInfo window <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WindowInfo<span style="color: #008000;">&#40;</span>windowHandle, <span style="color: #0600FF; font-weight: bold;">this</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>window<span style="color: #008000;">.</span><span style="color: #0000FF;">IsValidProcess</span> <span style="color: #008000;">&amp;&amp;</span> <span style="color: #008000;">!</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">HasProcess</span><span style="color: #008000;">&#40;</span>window<span style="color: #008000;">.</span><span style="color: #0000FF;">OwningProcess</span><span style="color: #008000;">&#41;</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;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>window<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;">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;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</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;">windowsView</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MoveCurrentTo</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;">windows</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</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 setup a breakpoint to find out what was wrong and discover that the window.IsValidProcess failed with the VS2010 process. Because I just wanted to check if it was the only reason why Snoop wasn&#8217;t able to inspect it, I hack the code to remove this 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('p332code22'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33222"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p332code22"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">void</span> Refresh<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;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><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;">foreach</span> <span style="color: #008000;">&#40;</span>IntPtr windowHandle <span style="color: #0600FF; font-weight: bold;">in</span> NativeMethods<span style="color: #008000;">.</span><span style="color: #0000FF;">ToplevelWindows</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
		WindowInfo window <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> WindowInfo<span style="color: #008000;">&#40;</span>windowHandle, <span style="color: #0600FF; font-weight: bold;">this</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><span style="color: #008080; font-style: italic;">/*window.IsValidProcess &amp;&amp;*/</span> <span style="color: #008000;">!</span><span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">HasProcess</span><span style="color: #008000;">&#40;</span>window<span style="color: #008000;">.</span><span style="color: #0000FF;">OwningProcess</span><span style="color: #008000;">&#41;</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;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>window<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;">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;">windows</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span> <span style="color: #008000;">&gt;</span> <span style="color: #FF0000;">0</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;">windowsView</span><span style="color: #008000;">.</span><span style="color: #0000FF;">MoveCurrentTo</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;">windows</span><span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>And it&#8217;s working:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/11/vs2010-snoop.png" rel="lightbox[332]"><img class="alignnone size-full wp-image-333" title="vs2010-snoop" src="http://www.japf.fr/wp-content/uploads/2009/11/vs2010-snoop.png" alt="vs2010-snoop" width="312" height="257" /></a></p>
<p>Happy exploration with Snoop <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/using-snoop-with-vs2010/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>VS2010 Beta 2 coming today !</title>
		<link>http://www.japf.fr/2009/10/vs2010-beta-2-coming-today/</link>
		<comments>http://www.japf.fr/2009/10/vs2010-beta-2-coming-today/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 07:12:19 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[news]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=321</guid>
		<description><![CDATA[In case you don&#8217;t have the info yet, VS2010 Beta2 is coming today October 19th for MSDN subscribers. It will be released to public on Wednesday (source). Also, Visual Studio 2010 RTM will officially launch on March 22, 2010 I&#8217;ll try to give some feedback as soon as I&#8217;ll be able to grab my copy [...]]]></description>
			<content:encoded><![CDATA[<p>In case you don&#8217;t have the info yet, <strong>VS2010 Beta2 is coming today October 19th</strong> for MSDN subscribers. It will be released to public on Wednesday (<a href="http://www.theregister.co.uk/2009/10/19/visual_studio_2010_second_beta_packaging/">source</a>).</p>
<p>Also, Visual Studio 2010 RTM will officially launch on March 22, 2010</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/10/vs2010.png" rel="lightbox[321]"><img class="alignnone size-medium wp-image-322" title="vs2010" src="http://www.japf.fr/wp-content/uploads/2009/10/vs2010-262x300.png" alt="vs2010" width="262" height="300" /></a></p>
<p>I&#8217;ll try to give some feedback as soon as I&#8217;ll be able to grab my copy and install it on ma workstation !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/10/vs2010-beta-2-coming-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
