<?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/tag/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>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>Review of 2009 blog posts</title>
		<link>http://www.japf.fr/2010/01/review-of-2009-blog-posts/</link>
		<comments>http://www.japf.fr/2010/01/review-of-2009-blog-posts/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 19:01:42 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[resharper]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[vs2010]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=391</guid>
		<description><![CDATA[In the past year, I&#8217;ve posted more than 30 articles on my blog. Here is a summary of those posts (link in bold are those which got the most traffic during the year). Obviously, MVVM was a very hot topic during 2009 January XAML guidelines: interviews of WPF masters photoSuru: a WPF application with spectacular [...]]]></description>
			<content:encoded><![CDATA[<p>In the past year, I&#8217;ve posted more than 30 articles on my blog. Here is a summary of those posts (link in bold are those which got the most traffic during the year). Obviously, MVVM was a very hot topic during 2009 <img src='http://www.japf.fr/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>January</p>
<ul>
<li><a href="http://www.japf.fr/2009/01/xaml-guidelines-interviews-from-wpf-masters/">XAML guidelines: interviews of WPF masters</a></li>
<li><a href="http://www.japf.fr/2009/01/photosuru-a-wpf-application-with-spectacular-user-experience/">photoSuru: a WPF application with spectacular user experience</a></li>
<li><a href="http://www.japf.fr/2009/01/model-view-viewmodel-commands-and-inputbindings/">Model-View-ViewModel, Commands and InputBindings</a></li>
<li><a href="http://www.japf.fr/2009/01/filtering-with-or-without-icollectionview/">Filtering with or without ICollectionView ?</a></li>
<li><a href="http://www.japf.fr/2009/01/why-i-love-linq/">Why do I love Extension Methods in System.Linq ?</a></li>
<li><a href="http://www.japf.fr/2009/01/using-extension-methods-to-raise-an-event/">Using extension methods to raise an event</a></li>
</ul>
<p>February</p>
<ul>
<li><strong><a href="http://www.japf.fr/2009/02/very-simple-mvvm-demo-application/">Very simple MVVM demo application</a></strong></li>
<li><a href="http://www.japf.fr/2009/02/vs2010-ui/">VS2010 UI</a></li>
</ul>
<p>March</p>
<ul>
<li><a href="http://www.japf.fr/2009/03/french-article-about-mvvm-posted/">French article about MVVM posted !</a></li>
<li><strong><a href="http://www.japf.fr/2009/03/thinking-with-mvvm-data-templates-contentcontrol/">Thinking with MVVM: Data Templates + ContentControl</a></strong></li>
<li><a href="http://www.japf.fr/2009/03/mix09-starts-today/">MIX09 starts today !</a></li>
<li><a href="http://www.japf.fr/2009/03/first-look-at-expression-blend-3/">First look at Expression Blend 3 !</a></li>
<li><a href="http://www.japf.fr/2009/03/the-future-of-wpf-at-mix09/">The future of WPF at Mix09</a></li>
</ul>
<p>April</p>
<ul>
<li><a href="http://www.japf.fr/2009/04/adding-transitions-to-a-mvvm-based-dialog/">Adding transitions to a MVVM based dialog</a></li>
</ul>
<p>May</p>
<ul>
<li><a href="http://www.japf.fr/2009/05/browse-your-codebase-like-a-pro-with-resharper/">Browse your codebase like a pro with ReSharper</a></li>
<li><a href="http://www.japf.fr/2009/05/visual-studio-2010-beta1-available-with-net4-and-wpf4-included/">Visual Studio 2010: Beta1 available with .Net4 and WPF4 included</a></li>
<li><a href="http://www.japf.fr/2009/05/net4-wpf4-and-vs2010-interesting-links/">.Net4, WPF4 and VS2010 interesting links</a></li>
</ul>
<p>July</p>
<ul>
<li><a href="http://www.japf.fr/2009/07/beziersegment-demo-application/">BezierSegment demo application</a></li>
</ul>
<p>August</p>
<ul>
<li><a href="http://www.japf.fr/2009/08/learn-how-net-manages-memory-in-15min/">Learn how .Net manages memory in 15min</a></li>
<li><a href="http://www.japf.fr/2009/08/wpf-memory-leak-with-eventmanager-registerclasshandler/">WPF possible memory leak with EventManager.RegisterClassHandler</a></li>
</ul>
<p>September</p>
<ul>
<li><a href="http://www.japf.fr/2009/09/how-to-close-a-view-from-a-viewmodel/">How to close a View from a ViewModel ?</a></li>
</ul>
<p>October</p>
<ul>
<li><a href="http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/">A quick tour of existing MVVM frameworks</a></li>
<li><a href="http://www.japf.fr/2009/10/the-cost-of-building-visual-trees/">The cost of building Visual Trees</a></li>
<li><a href="http://www.japf.fr/2009/10/announcing-the-wpf-internals-series/">Announcing the “WPF internals” series</a></li>
<li><a href="http://www.japf.fr/2009/10/analyzing-events-usage-using-a-resharper-plugin/">Analyzing events usage using a R# plugin</a></li>
<li><strong><a href="http://www.japf.fr/2009/10/wpf-internals-part-1-what-are-the-core-wpf-classes/">WPF internals part 1 : what are the core WPF classes ?</a></strong></li>
<li><a href="http://www.japf.fr/2009/10/vs2010-beta-2-coming-today/">VS2010 Beta 2 coming today !</a></li>
<li><a href="http://www.japf.fr/2009/10/measure-rendering-time-in-a-wpf-application/">How to measure rendering time in a WPF application ?</a></li>
</ul>
<p>November</p>
<ul>
<li><a href="http://www.japf.fr/2009/11/using-snoop-with-vs2010/">Using Snoop to take a look at VS2010 !</a></li>
<li><a href="http://www.japf.fr/2009/11/pdc09-some-announcements/">PDC09: some announcements</a></li>
<li><a href="http://www.japf.fr/2009/11/pdc09-some-wpf-sessions-are-available/">PDC09: some WPF sessions are available !</a></li>
<li><a href="http://www.japf.fr/2009/11/pdc09-wpf-application-performance-tuning/">PDC09: Advanced WPF Application Performance Tuning</a></li>
<li><a href="http://www.japf.fr/2009/11/pdc09-how-vs2010-was-built-with-wpf/">PDC09 : How VS2010 was built with WPF ?</a></li>
<li><strong><a href="http://www.japf.fr/2009/11/discover-compare-existing-mvvm-frameworks/">Discover and compare existing MVVM frameworks !</a></strong></li>
</ul>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;"><strong><a class="row-title" title="Edit “Discover and compare existing MVVM frameworks !”" href="post.php?action=edit&amp;post=369">Discover and compare existing MVVM frameworks !</a></strong></div>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2010/01/review-of-2009-blog-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to measure rendering time in a WPF application ?</title>
		<link>http://www.japf.fr/2009/10/measure-rendering-time-in-a-wpf-application/</link>
		<comments>http://www.japf.fr/2009/10/measure-rendering-time-in-a-wpf-application/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 10:47:20 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[WPF]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[practises]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=325</guid>
		<description><![CDATA[Last week, a colleague of mine asked me an interesting question: &#8220;I&#8217;m filling a control with content and I&#8217;d like to measure the time needed to render my control. How can I do that ?&#8221; The first approach is to measure the elapsed time needed to instantiate and populate the control from C# code. We [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, a colleague of mine asked me an interesting question: &#8220;<em>I&#8217;m filling a control with content and I&#8217;d like to measure the time needed to render my control. How can I do that ?&#8221;</em></p>
<p>The first approach is to measure the elapsed time needed to instantiate and populate the control from C# code. We can use the <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx">StopWatch</a> class to have a precise and easy to use measuring tool.</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('p325code3'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3253"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p325code3"><pre class="csharp" style="font-family:monospace;">Stopwatch sw <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Stopwatch<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
sw<span style="color: #008000;">.</span><span style="color: #0000FF;">Start</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;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> <span style="color: #FF0000;">5000</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #008080; font-style: italic;">// here is the operation that fills the control</span>
  <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">canvas</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Children</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Rectangle<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
sw<span style="color: #008000;">.</span><span style="color: #0000FF;">Stop</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Took &quot;</span> <span style="color: #008000;">+</span> sw<span style="color: #008000;">.</span><span style="color: #0000FF;">ElapsedMilliseconds</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; ms&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>However this approach will not give good results because we&#8217;re not taking into account the time needed to render elements in the visual tree. This is because elements are not rendered when you call the Add methods (for example in a Canvas) but when the visual tree is fully loaded.</p>
<p>A much better approach is to use the Dispatcher and request it to process an action at a priority right bellow the Render priority which is the Loaded priority:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/10/dispatcherpriority.png" rel="lightbox[325]"><img class="alignnone size-full wp-image-326" title="dispatcherpriority" src="http://www.japf.fr/wp-content/uploads/2009/10/dispatcherpriority.png" alt="dispatcherpriority" width="705" height="188" /></a></p>
<p>Using this trick, we ensure that all rendering actions have been completed. We can use the following code to do that:</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('p325code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3254"><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="p325code4"><pre class="csharp" style="font-family:monospace;">Stopwatch sw <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Stopwatch<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
sw<span style="color: #008000;">.</span><span style="color: #0000FF;">Start</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;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> <span style="color: #FF0000;">5000</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span><span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #008080; font-style: italic;">// here is the operation that fills the control</span>
  <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">canvas</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Children</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">new</span> Rectangle<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Dispatcher</span><span style="color: #008000;">.</span><span style="color: #0000FF;">BeginInvoke</span><span style="color: #008000;">&#40;</span>
  DispatcherPriority<span style="color: #008000;">.</span><span style="color: #0000FF;">Loaded</span>,
  <span style="color: #008000;">new</span> Action<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">=&gt;</span>
  <span style="color: #008000;">&#123;</span>
    sw<span style="color: #008000;">.</span><span style="color: #0000FF;">Stop</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    MessageBox<span style="color: #008000;">.</span><span style="color: #0000FF;">Show</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Took &quot;</span> <span style="color: #008000;">+</span> sw<span style="color: #008000;">.</span><span style="color: #0000FF;">ElapsedMilliseconds</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot; ms&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
  <span style="color: #008000;">&#125;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span></pre></td></tr></table></div>

<p>Hope this helps !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/10/measure-rendering-time-in-a-wpf-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WPF internals part 1 : what are the core WPF classes ?</title>
		<link>http://www.japf.fr/2009/10/wpf-internals-part-1-what-are-the-core-wpf-classes/</link>
		<comments>http://www.japf.fr/2009/10/wpf-internals-part-1-what-are-the-core-wpf-classes/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 11:04:11 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=309</guid>
		<description><![CDATA[In this first article, I&#8217;d like to make a tour of the core WPF classes and how they are related. Knowing the organization of WPF classes is important when we create a new control because we have to determine which base class we&#8217;re going to use. It is also interesting to know how the framework [...]]]></description>
			<content:encoded><![CDATA[<p>In this first article, I&#8217;d like to make a tour of the core WPF classes and how they are related.</p>
<p>Knowing the organization of WPF classes is important when we create a new control because we have to determine which base class we&#8217;re going to use. It is also interesting to know how the framework has been designed. That&#8217;s the goal of this first article.</p>
<p>Here is an image of the core WPF classes and how they are related (click for larger resolution):</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/10/WpfClasses.png" rel="lightbox[309]"><img class="alignnone" src="http://www.japf.fr/wp-content/uploads/2009/10/WpfClasses-Preview.png" alt="" width="570" height="735" /></a></p>
<p>The diagram is voluntary simple above the Control classes because that will be targeted by another article.</p>
<div>The top level class <a id="qm:t" title="DispatcherObject" href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherobject.aspx">DispatcherObject</a>:</p>
<ul>
<li>represents an object that is associated with a <a id="ctl00_MTCS_main_ctl02" href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcher.aspx">Dispatcher</a></li>
<li>can be accessed  from a thread other than the thread the <a id="fa_x" title="DispatcherObject" href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherobject.aspx">DispatcherObject</a> was created on, using <strong>Invoke </strong>or <strong>BeginInvoke </strong>calls</li>
<li>can enforce thread safety  by calling <strong>VerifyAccess</strong></li>
<li><strong>cannot be independently instantiated</strong>; that is, all constructors are protected</li>
</ul>
<p>From the <a id="ccbd" title="DispatcherObject" href="http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherobject.aspx">DispatcherObject</a> class, we have 4 new classes (one more time, this is a partial view of what really is in the framework):</p>
<ul>
<li>the <a id="rxya" title="FrameworkTemplate" href="http://msdn.microsoft.com/fr-fr/library/system.windows.frameworktemplate.aspx">FrameworkTemplate</a> abstract class, the base class for WPF  <a id="tj4m" title="DataTemplate" href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate.aspx">DataTemplate</a>, <a id="susd" title="ControlTemplate" href="http://msdn.microsoft.com/fr-fr/library/system.windows.controls.controltemplate.aspx">ControlTemplate</a> and <a id="h28y" title="ItemsPanelTemplate" href="http://msdn.microsoft.com/fr-fr/library/system.windows.controls.itemspaneltemplate.aspx">ItemsPanelTemplate</a> templates. The <a id="y9uy" title="FrameworkTemplate" href="http://msdn.microsoft.com/fr-fr/library/system.windows.frameworktemplate.aspx">FrameworkTemplate</a> abstract class has a <strong>VisualTree </strong>property (of type <a id="srta" title="FrameworkElementFactory" href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelementfactory.aspx">FrameworkElementFactory</a>) to support the creation of the content of the template.</li>
<li>the <a id="n7bs" title="Style" href="http://msdn.microsoft.com/en-us/library/system.windows.style.aspx">Style</a> class that has a collection of <strong>Setters </strong>and <strong>Triggers </strong>that triggers a given <strong>TargetType </strong>and can be <strong>BasedOn </strong>an existing resource</li>
<li>the <a id="zovh" title="DrawingContext" href="http://msdn.microsoft.com/en-us/library/system.windows.media.drawingcontext.aspx">DrawingContext</a> class that populates a <a id="ctl00_MTCS_main_ctl56_ctl00_ctl00" href="http://msdn.microsoft.com/en-us/library/system.windows.media.visual.aspx">Visual</a> or a <a id="ctl00_MTCS_main_ctl56_ctl00_ctl01" href="http://msdn.microsoft.com/en-us/library/system.windows.media.drawing.aspx">Drawing</a> with visual content. <a id="f72b" title="DrawingContext" href="http://msdn.microsoft.com/en-us/library/system.windows.media.drawingcontext.aspx">DrawingContext</a> used with a retained mode graphics system (more information <a id="eja7" title="here" href="http://blogs.msdn.com/qiweiye/archive/2008/12/23/retained-mode-graphics-in-wpf.aspx">here</a>)</li>
<li>and the <a id="m9-l" title="DependencyObject" href="index.php?page=stats">DependencyObject</a> class,</li>
</ul>
<p>The <a id="n2rs" title="DependencyObject" href="index.php?page=stats">DependencyObject</a> class:</p>
<ul>
<li>contains the mechanism to deal with <strong>Dependency Properties</strong> through a set of methods such as <strong>ClearValue</strong>, <strong>SetValue</strong> and <strong>GetValue</strong></li>
<li>is inherited by 3 new classes
<ul>
<li><a id="tbd9" title="TriggerBase" href="http://msdn.microsoft.com/en-us/library/system.windows.triggerbase.aspx">TriggerBase</a>, for specifying a conditional value within a <a id="p:.2" href="http://msdn.microsoft.com/en-us/library/system.windows.style.aspx">Style</a> object. Inherited by <a id="s9de" title="DataTrigger" href="http://msdn.microsoft.com/en-us/library/system.windows.datatrigger.aspx">DataTrigger</a>, <a id="c.a7" title="EventTrigger" href="http://msdn.microsoft.com/en-us/library/system.windows.eventtrigger.aspx">EventTrigger</a>&#8230;</li>
<li><a id="x.25" title="Freezable" href="http://msdn.microsoft.com/en-us/library/system.windows.freezable.aspx">Freezable</a>, for object that has a modifiable state and a read-only (frozen) state. Classes that derive from <span>Freezable</span> provide detailed change notification, can be made immutable, and can clone themselves</li>
<li>and the <a id="gjnt" title="Visual" href="http://msdn.microsoft.com/en-us/library/system.windows.media.visual.aspx">Visual</a> class,</li>
</ul>
</li>
</ul>
<p>The <a id="x0bz" title="Visual" href="http://msdn.microsoft.com/en-us/library/system.windows.media.visual.aspx">Visual</a> class:</p>
<ul>
<li><strong>provides rendering support</strong> in WPF, which includes <strong>hit testing</strong>, coordinate transformation, and bounding box calculations</li>
<li>is the first class supporting the <strong>VisualParent </strong>property that helps setting up the visual tree</li>
<li>support methods for adding, removing and getting visual child (through the <a id="dpii" title="IAddChild" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">IAddChild</a> interface)</li>
<li>has an <strong>VisualEffect</strong> property of type Effect (from Animatable / Freezable)</li>
<li>is inherited by the <a id="obih" title="UIElement" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">UIElement</a> class,</li>
</ul>
<p>The <a id="tpqv" title="UIElement" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">UIElement</a> class:</p>
<ul>
<li>can render as a child element</li>
<li>contains logic that is used to size and position possible child elements of a <span><a id="egqm" title="UIElement" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">UIElement</a></span> (when interpreted by a layout system)</li>
<li>can respond to user input (including control of where input is getting sent to via their handling of event routing, or routing of commands)</li>
<li>can raise routed events that travel a route through the logical element tree</li>
<li>supports some aspects of the animation system</li>
<li>is enhanced by the <a id="hqop" title="FrameworkElement" href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.aspx">FrameworkElement</a> class,</li>
</ul>
<p>The <a id="zm48" title="FrameworkElement" href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.aspx">FrameworkElement</a> class extends the <a id="xwrf" title="UIElement" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">UIElement</a> class by adding the following functionalities:</p>
<ul>
<li>layout system definition using the <strong>ArrangeOverride </strong>method</li>
<li>logical tree with the <strong>Parent </strong>property</li>
<li>object lifetime events such as <strong>Initialized</strong>, <strong>Loaded</strong>, <strong>Unloaded</strong></li>
<li>support for databinding (<strong>DataContext </strong>property) and resources management (<strong>Resources </strong>property)</li>
<li>support styles (<strong>Style </strong>property)</li>
<li>does <span style="text-decoration: underline;">not</span> handle the Template feature implemented in the Control class</li>
</ul>
<p>Several classes inherit the <a id="z20a" title="FrameworkElement" href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.aspx">FrameworkElement</a> class:</p>
<ul>
<li>the <a id="j9o6" title="Shape" href="http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape.aspx">Shape</a> abstract base class for <a id="ol5e" title="Rectangle" href="http://msdn.microsoft.com/en-us/library/system.windows.shapes.rectangle.aspx">Rectangle</a>, <a id="s5-b" title="Ellipse" href="http://msdn.microsoft.com/en-us/library/system.windows.shapes.ellipse.aspx">Ellipse</a> and <a id="icdp" title="Polygon" href="http://msdn.microsoft.com/en-us/library/system.windows.shapes.polygon.aspx">Polygon</a> classes</li>
<li>the <a id="bhqw" title="ContentPresenter" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.contentpresenter.aspx">ContentPresenter</a> class to mark where the content should be added when writing <a id="zb:g" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.controltemplate.aspx">ControlTemplate</a></li>
<li>the <a id="jy7l" title="Adorner" href="http://msdn.microsoft.com/en-us/library/system.windows.documents.adorner.aspx">Adorner</a> class to decorates <a id="ewrx" title="UIElement" href="http://msdn.microsoft.com/en-us/library/system.windows.markup.iaddchild.aspx">UIElement</a></li>
<li>the <a id="x_au" title="Decorator" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.decorator.aspx">Decorator</a> base class, for elements that apply effects onto or around a single child element (such as <a id="l_53" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.border.aspx">Border</a> or <a id="ctl00_MTCS_main_ctl03" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx">Viewbox</a>)</li>
<li>the <a id="a267" title="Panel" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.panel.aspx">Panel</a> class to position and arrange child objects</li>
<li>and the <a id="ufq2" title="Control" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.control.aspx">Control</a> class</li>
</ul>
<p>The <a id="fc2v" title="Control" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.control.aspx">Control</a> class:</p>
<ul>
<li>is the base class for WPF controls that use a <a id="tc:d" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.controltemplate.aspx">ControlTemplate</a> to define their appearance (through the <strong>Template</strong> property)</li>
<li>defines a set of UI properties (that can be exploited by ControlTemplates): <strong>Background</strong>, <strong>BorderBrush</strong>, <strong>BorderThickness</strong>, <strong>FontFamily</strong>, <strong>FontSize</strong>, <strong>FontStrech</strong>, <strong>FontStyle</strong>, <strong>FontWeight</strong>, <strong>Foreground </strong>and <strong>Padding</strong></li>
<li>support mouse double clicks event using <strong>MouseDoubleClick </strong>and <strong>PreviewMouseDoubleClick</strong></li>
</ul>
<p>In order to show where most of the WPF controls are (but that will be the object of another article), I also added <a id="fo18" title="ContentControl" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.aspx">ContentControl</a>, <a id="vd9r" title="ItemsControl" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx">ItemsControl</a>, <a id="z-y7" title="UserControl" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol.aspx">UserControl</a> and <a id="zd4e" title="Window" href="http://msdn.microsoft.com/en-us/library/system.windows.window.aspx">Window</a> class to the diagram.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/10/wpf-internals-part-1-what-are-the-core-wpf-classes/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Analyzing events usage using a R# plugin</title>
		<link>http://www.japf.fr/2009/10/analyzing-events-usage-using-a-resharper-plugin/</link>
		<comments>http://www.japf.fr/2009/10/analyzing-events-usage-using-a-resharper-plugin/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 12:20:47 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[practises]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[resharper]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=286</guid>
		<description><![CDATA[As you might already know, even if the .Net framework has a garbage collector, you can easily create memory leaks in your application. The most common way to create a leak is to register to an event handler on a object that has a longer lifetime than the object where the handler is defined. The [...]]]></description>
			<content:encoded><![CDATA[<p>As you might already know, even if the .Net framework has a garbage collector, you can easily create memory leaks in your application.</p>
<p>The most common way to create a leak is to register to an event handler on a object that has a longer lifetime than the object where the handler is defined. The problem can also occurs by using static class such as EventManager (for more information see <a href="http://www.japf.fr/2009/08/wpf-memory-leak-with-eventmanager-registerclasshandler/">this blog post</a>). Some .Net developers have been working on a way to go round the problem using Reflection, Weak Reference and other cool stuff. You can check out for example <a href="http://www.codeproject.com/KB/cs/WeakEvents.aspx">this excellent article</a> on Code Project.</p>
<p>However, if you cannot change the way your declare events (because of internal policies in the company or because you don&#8217;t have the source code), you must be very carefull about the way you manage your events.</p>
<p>I&#8217;ve been working lately on a <a href="http://www.jetbrains.com/resharper/index.html">Resharper</a> plugin that helps detecting events that are never unsubscribed. Basically, what is does is the following:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/10/resharper_plugin.png" rel="lightbox[286]"><img class="size-full wp-image-287 alignnone" title="resharper_plugin" src="http://www.japf.fr/wp-content/uploads/2009/10/resharper_plugin.png" alt="resharper_plugin" width="528" height="213" /></a></p>
<p><strong>I&#8217;d like to have feedback from you .Net developpers, about whether you find such a plugin useful or not. </strong></p>
<ul>
<li>How do you deal with the event memory leak problem ?</li>
<li>Would you like to use my plugin ?</li>
<li>Would you like me to release it on a open source platform ?</li>
<li>What other kind of possible leaks are you thinking about to enhance the plugin ?</li>
</ul>
<p>Please write a comment to let my know what you think. Thank you for your feedback !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/10/analyzing-events-usage-using-a-resharper-plugin/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>A quick tour of existing MVVM frameworks</title>
		<link>http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/</link>
		<comments>http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 09:00:27 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[icommand]]></category>
		<category><![CDATA[model-view-viewmodel]]></category>
		<category><![CDATA[mvvm]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=259</guid>
		<description><![CDATA[[Article updated november, 26th: see my latest blog post for a better experience browsing the frameworks] One year ago MVVM wasn’t very famous. I remember the first article I read about it, about using MVVM to simplify the management of treeview controls. In the last six months, MVVM has been quickly promoted to THE methodology [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[Article updated november, 26th: see <a href="http://www.japf.fr/2009/11/discover-compare-existing-mvvm-frameworks/">my latest blog post</a> for a better experience browsing the frameworks]</strong></p>
<p><span id="more-259"></span></p>
<p>One year ago MVVM wasn’t very famous. I remember the first article I read about it, about <a href="http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx">using MVVM to simplify the management of treeview controls</a>. In the last six months, MVVM has been quickly promoted to THE methodology to use when developing WPF applications. During this amount of time, famous WPF developers started to merge their existing MVVM classes into libraries. Those libraries are now known as MVVM frameworks and contain classes designed to help developers to use MVVM in their projects.</p>
<p>In this article, I’m going to make a quick tour of the available MVVM frameworks.</p>
<p><strong>If your own framework is not in this list or if I made a mistake while describing your work, please let me know using the contact form (available at the top of this page).</strong></p>
<p>Common features:</p>
<ul>
<li>ViewModelBase class (for the implementation of the INotifyPropertyChanged interface)</li>
<li>RelayCommand like class to link UI command to ViewModel’s handlers</li>
<li>Unit tests comes with the framework</li>
</ul>
<p><a href="http://sachabarber.net/?page_id=523">Cinch</a></p>
<ul>
<li>Author: <a href="http://sachabarber.net">Sacha Barber</a></li>
<li>Silverlight support: no</li>
<li>Documentation: excellent, 6 articles published on CodeProject</li>
<li>Hosting : <a href="http://cinch.codeplex.com/">CodePlex</a></li>
<li>License:  Code Project Open License</li>
<li>Features:
<ul>
<li>attached behaviors</li>
<li>validation suing IDataErrorInfo</li>
<li>support for IEditableObject</li>
<li>weak events creation and subscription</li>
<li>mediator messaging using weak events</li>
<li>IOC/DI support (using Unity)</li>
<li>services: event logger, message box, open save dialog, popup</li>
<li>threading helpers</li>
<li>support for menu items</li>
<li>closeable viewmodels</li>
<li>MVVM code generator</li>
</ul>
</li>
</ul>
<p><a href="http://www.galasoft.ch/mvvm/getstarted/">MVVM Light Toolkit </a></p>
<ul>
<li>Author: <a href="http://www.galasoft.ch/index.html">Laurent Bugnion</a></li>
<li>Silverlight support: yes</li>
<li>Documentation: many articles available on Laurent’s blog + other developers as well</li>
<li>Hosting: <a href="http://mvvmlight.codeplex.com/">CodePlex</a></li>
<li>License: MIT license</li>
<li>Features:
<ul>
<li>MSI installer</li>
<li>VS project and item template</li>
<li>VS code snippets</li>
<li>Messenger system for inter-viewmodel communication</li>
</ul>
</li>
</ul>
<p><a href="http://www.julmar.com/blog/mark/2009/08/04/MVVMHelpersV103.aspx">MVVM Helpers</a></p>
<ul>
<li>Author: <a href="http://www.julmar.com/blog/mark/">Mark Smith</a></li>
<li>Silverlight support: no</li>
<li>Documentation: some articles on Mark’s blog</li>
<li>Hosting: personal website</li>
<li>License: not defined</li>
<li>Features:
<ul>
<li>attached behaviors</li>
<li>viewmodel creation using markup extension</li>
<li>attributes based validation</li>
<li>IOC/DI using ServiceProvider approach</li>
<li>closeable viewmodel</li>
<li>wait cursor (using new WaitCursor() { // your code here })</li>
</ul>
</li>
</ul>
<p><a href="http://mvvmfoundation.codeplex.com/">MVVM Foundation</a></p>
<ul>
<li>Author: <a href="http://joshsmithonwpf.wordpress.com/">Josh Smith</a></li>
<li>Silverlight support: no</li>
<li>Documentation: articles about the Messenger implementation on Josh or Marlon Grech’s blog</li>
<li>Hosting: <a href="http://mvvmfoundation.codeplex.com/">CodePlex</a></li>
<li>License: MS-PL</li>
<li>Features:
<ul>
<li>Messenger system for inter-viewmodel communication</li>
<li>PropertyChanged event monitor</li>
</ul>
</li>
</ul>
<p><a href="http://www.caliburnproject.org/">Caliburn</a></p>
<ul>
<li>Author: <a href="http://robeisenberg.com/Work.aspx">Rob Eisenberg</a></li>
<li>Silverlight support: yes</li>
<li>Documentation: complete <a href="http://caliburn.codeplex.com/Wiki/View.aspx?title=Table%20Of%20Contents">online documentation</a> available</li>
<li>Hosting: CodePlex http://www.codeplex.com/caliburn</li>
<li>License: MIT license</li>
<li>Features:
<ul>
<li> commands are built on top of Actions and thus share many of the same features, including multiple input parameters, filters and automatic asynchronous execution</li>
<li>presenters that handles UI lifecycle issue such as handling activation, deactivation and shutdown semantics for various UI components</li>
<li>Caliburn applications are fully testable</li>
<li>various utilities such as a background task manager</li>
<li>supports various UI pattern (not MVVM only)</li>
<li>dependency injection container</li>
</ul>
</li>
</ul>
<p><a href="http://wpfonyx.codeplex.com/">Onyx</a></p>
<ul>
<li>Author: William e Kempf</li>
<li>Silverlight support: no</li>
<li>Documentation: basic <a href="http://wpfonyx.codeplex.com/Wiki/View.aspx?title=Introduction">introduction</a> available on CodePlex</li>
<li>Hosting: <a href="http://wpfonyx.codeplex.com/">CodePlex</a></li>
<li>License: not specified</li>
<li>Features:
<ul>
<li> ServiceLocator pattern</li>
<li>ViewModel creation using a custom markup extension</li>
<li>UI related services such as IDisplayMessage</li>
</ul>
</li>
</ul>
<p><a href="http://calcium.codeplex.com/">Calcium</a></p>
<ul>
<li>Author: <a href="http://danielvaughan.orpius.com/">Daniel Vaughan</a></li>
<li>Silverlight support: no</li>
<li>Documentation: 2 very detailed articles on CodeProject (<a href="http://www.codeproject.com/KB/WPF/CalciumPart01.aspx">part1</a> and <a href="http://www.codeproject.com/KB/WPF/CalciumPart02.aspx">part2</a>)</li>
<li>Hosting: <a href="http://calcium.codeplex.com/">CodePlex</a></li>
<li>License: use, copy, modify, and/or distribute and keep the copyright!</li>
<li>Features:
<ul>
<li> Module Manager for enabling or disabling of modules at runtime</li>
<li>messaging services for interacting with the user from the client or server using the same API</li>
<li>Command Service to associate WPF ICommands with content interfaces that only become active when an active view or viewmodel implements the interface</li>
<li>Region Adapters for ToolBars and Menus</li>
<li>Client-server logging ready to work out-of-the-box</li>
<li>Includes modules, such as a Web Browser, Text Editor, Output Window, and many more</li>
<li>Tabbed interface with dirty file indication (reusable across modules)</li>
</ul>
</li>
</ul>
<p><a href="http://www.orktane.com/Blog/">nRoute</a></p>
<ul>
<li>Author: <a href="http://www.orktane.com/Blog/">Rishi</a></li>
<li>Silverlight support: yes</li>
<li>Documentation: many articles available on author&#8217;s blog (see CodePlex project home page for the links)</li>
<li>Hosting: <a href="http://nroute.codeplex.com/">CodePlex</a></li>
<li>License: MS-PL</li>
<li>Features:
<ul>
<li> support Blend3 behaviors and triggers models</li>
<li>resource locator framework</li>
<li>view services: OpenFileDialog, ShowMessage&#8230;</li>
<li>uses attributes to map View and ViewModel together</li>
</ul>
</li>
</ul>
<p><a href="http://nitomvvm.codeplex.com/">Nito MVVM</a></p>
<ul>
<li>Author: Shammah</li>
<li>Silverlight support: no</li>
<li>Documentation: no</li>
<li>Hosting: <a href="http://nitomvvm.codeplex.com/">CodePlex</a></li>
<li>License: not specified</li>
<li>Features:
<ul>
<li> various MVVM friendly implementations of the ICommand interface</li>
</ul>
</li>
</ul>
<p><a href="http://karlshifflett.wordpress.com/">Ocean</a></p>
<ul>
<li>Author: <a href="http://karlshifflett.wordpress.com/">Karl Shifflet</a></li>
<li> Silverlight support: no</li>
<li>Documentation: articles available on Karl&#8217;s blog</li>
<li>Hosting: personal website</li>
<li>License: not specified</li>
<li>Features:
<ul>
<li> written in VB.Net</li>
<li>attribute based validation</li>
<li>viewmodel base classes: relaycommand, closeableviewmodel&#8230;</li>
<li>SQL server data access layer</li>
</ul>
</li>
</ul>
<p><a href="http://coremvvm.codeplex.com/">Basic MVVM framework</a></p>
<ul>
<li>Author: <a href="http://blogs.msdn.com/llobo/default.aspx">Lester Lobo</a></li>
<li> Silverlight support: no</li>
<li>Documentation: sample application available with the library</li>
<li>Hosting: <a href="http://coremvvm.codeplex.com/">CodePlex</a></li>
<li>License: MS-PL</li>
<li>Features:
<ul>
<li> delegating Commands\Keybinding</li>
<li>messaging between VM&#8217;s</li>
<li>handling events as commands with attached behaviors</li>
<li>handling dialogs (and more) as services</li>
<li>VS code snippets</li>
</ul>
</li>
</ul>
<p><a href="http://goldlight.codeplex.com/">GoodLight</a></p>
<ul>
<li>Author: <a href="http://peteohanlon.wordpress.com/">Peter O&#8217;Hanlon</a><em> </em><em></em></li>
<li> Silverlight support: yes</li>
<li>Documentation: sample application available with the library</li>
<li>Hosting: <a href="http://goldlight.codeplex.com/">CodePlex</a></li>
<li>License: MS-PL</li>
<li>Features:
<ul>
<li> &#8220;workspace&#8221; management (set of document that can be closed)</li>
<li>skin support</li>
<li>messaging between VM&#8217;s</li>
</ul>
</li>
</ul>
<p>As you can see, each frameworks has its pros and cons. If you want a light Silverlight-compatible framework, Laurent&#8217;s framework is very nice. If you want a very rich framework, Sacha&#8217;s one is excellent. Whatever what your requirements are, each framework is very interesting and browsing the source code is a good way to understrand how stuff works and find cool ideas for your own needs.</p>
<p>To conclude, I&#8217;d like to thanks all those people who work very hard for the community ! An interesting discussion started a couple of days ago on the <a href="http://groups.google.com/group/wpf-disciples">WPF disciples Google group</a> about the creation of a common framework. Have a look <a href="http://groups.google.com/group/wpf-disciples/browse_thread/thread/6b6c60b835cfd8f2">here</a>.</p>
<p><a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.japf.fr%2f2009%2f10%2fa-quick-tour-of-existing-mvvm-frameworks%2f"><img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.japf.fr%2f2009%2f10%2fa-quick-tour-of-existing-mvvm-frameworks%2f" border="0" alt="kick it on DotNetKicks.com" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/10/a-quick-tour-of-existing-mvvm-frameworks/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Learn how .Net manages memory in 15min</title>
		<link>http://www.japf.fr/2009/08/learn-how-net-manages-memory-in-15min/</link>
		<comments>http://www.japf.fr/2009/08/learn-how-net-manages-memory-in-15min/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 13:20:24 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[.Net]]></category>
		<category><![CDATA[memory]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=248</guid>
		<description><![CDATA[A couple of days a ago I colleague sent me a cool link that I wanted to share here. If you want to learn how .Net manages memory in details, understand how the garbage collector works,  what is the next object pointer, how finalizers are managed (and much more !), you should check it out [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days a ago I colleague sent me a cool link that I wanted to share here.</p>
<p>If you want to learn how .Net <em><strong>manages memory</strong></em> in details, understand how the <strong><em>garbage collector</em></strong> works,  what is the <strong><em>next object pointer</em></strong>, how <strong><em>finalizers</em> </strong>are managed (and much more !), you should check it out this <a href="http://www.red-gate.com/products/ants_memory_profiler/DOTNET_Memory_Management/Index.html">cool video</a> made by the guys of <a href="http://www.red-gate.com/products/ants_performance_profiler/index.htm">ANTS Profiler</a>:</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/08/memory-management.png" rel="lightbox[248]"><img class="alignnone size-full wp-image-249" title="memory-management" src="http://www.japf.fr/wp-content/uploads/2009/08/memory-management.png" alt="memory-management" width="381" height="210" /></a></p>
<p><a href="http://www.red-gate.com/products/ants_memory_profiler/DOTNET_Memory_Management/Index.html">source video</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/08/learn-how-net-manages-memory-in-15min/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2010: Beta1 available with .Net4 and WPF4 included</title>
		<link>http://www.japf.fr/2009/05/visual-studio-2010-beta1-available-with-net4-and-wpf4-included/</link>
		<comments>http://www.japf.fr/2009/05/visual-studio-2010-beta1-available-with-net4-and-wpf4-included/#comments</comments>
		<pubDate>Tue, 19 May 2009 07:26:16 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[vs2010]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=221</guid>
		<description><![CDATA[In case you missed it, Beta1 of Visual Studio 2010 has been announced yesterday. Since monday it is available to all MSDN subscribers, and will be avaible to the rest of the world on wednesday. Documentation has also been updated to show the new features of this release. The download is on its way and [...]]]></description>
			<content:encoded><![CDATA[<p>In case you missed it, Beta1 of Visual Studio 2010 <a href="http://blogs.msdn.com/dannawi/archive/2009/05/15/visual-studio-2010-beta-1-available-for-the-msdn-subscribers-on-monday-may-18th.aspx">has been announced</a> yesterday.</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/05/vs2010.png" rel="lightbox[221]"><img class="alignnone size-medium wp-image-222" title="vs2010" src="http://www.japf.fr/wp-content/uploads/2009/05/vs2010-300x171.png" alt="vs2010" width="300" height="171" /></a></p>
<p>Since monday it is available to <a href="http://www.microsoft.com/australia/visualstudio/products/2010/default.mspx">all MSDN subscribers</a>, and will be avaible to the rest of the world on wednesday. <a href="http://blogs.msdn.com/wpfsdk/archive/2009/05/18/net-framework-4-and-vs-beta1-docs-are-posted.aspx">Documentation</a> has also been updated to show the new features of this release.</p>
<p>The download is on its way and I&#8217;ll try to post feedback as soon as I can, stay tuned !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/05/visual-studio-2010-beta1-available-with-net4-and-wpf4-included/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Browse your codebase like a pro with ReSharper</title>
		<link>http://www.japf.fr/2009/05/browse-your-codebase-like-a-pro-with-resharper/</link>
		<comments>http://www.japf.fr/2009/05/browse-your-codebase-like-a-pro-with-resharper/#comments</comments>
		<pubDate>Mon, 18 May 2009 11:27:03 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Stutio]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[resharper]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=211</guid>
		<description><![CDATA[I&#8217;ve already blogged about R# a couple of times. There is no doubt: it&#8217;s a must have for any serious .Net developper. A few weeks ago I learned and setup new shortcuts to improve my navigation skills in Visual Studio. Here are the results&#8230; If I want: to find a Type I hit Ctrl+T to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve already blogged about R# a couple of times. There is no doubt: it&#8217;s a must have for any serious .Net developper. A few weeks ago I learned and setup new shortcuts to improve my navigation skills in Visual Studio.</p>
<p>Here are the results&#8230; If I want:</p>
<ul>
<li>to find a <strong>Type</strong> I hit <strong>Ctrl+T</strong></li>
<li>to find a <strong>File</strong> I hit <strong>Ctrl+Shift+T</strong></li>
<li>to find a <strong>Member</strong> (in a file) I hit <strong>Ctrl+Alt+T</strong> (Note: I setup this one on my own using Tools/Options/Keyboard)</li>
</ul>
<p>A search box opens and I can start searching instantaneously.</p>
<p><a href="http://www.japf.fr/wp-content/uploads/2009/05/resharpernavigation1.png" rel="lightbox[211]"><img class="alignnone size-medium wp-image-217" title="resharpernavigation1" src="http://www.japf.fr/wp-content/uploads/2009/05/resharpernavigation1-300x92.png" alt="resharpernavigation1" width="300" height="92" /></a></p>
<p>Here are the basic scenarios :</p>
<ul>
<li>I want to open the <strong>ViewModelBase</strong> class, I hit <strong>Ctrl+T</strong> and then <strong>VMB</strong> (R# is able to search using capital letters)</li>
<li>I want to go to the <strong>OnPropertyChanged</strong>, I hit <strong>Ctrl+Alt+T</strong> and then <strong>OPC</strong> (same as previous example)</li>
<li>Finally, to open the file in the Solution Explorer I hit <strong>Shift+Alt+L</strong></li>
</ul>
<p>It&#8217;s simply amazing the time we can save using those simple shorcuts. Of course, you need to be quite familiar with your codebase (if you just arrive on a project it will be harder :p)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.japf.fr/2009/05/browse-your-codebase-like-a-pro-with-resharper/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future of WPF at Mix09</title>
		<link>http://www.japf.fr/2009/03/the-future-of-wpf-at-mix09/</link>
		<comments>http://www.japf.fr/2009/03/the-future-of-wpf-at-mix09/#comments</comments>
		<pubDate>Sun, 22 Mar 2009 20:27:54 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[mix09]]></category>
		<category><![CDATA[visual studio]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[xaml]]></category>

		<guid isPermaLink="false">http://www.japf.fr/?p=178</guid>
		<description><![CDATA[MIX09 is now over and the good news is that we can watch all sessions that have been recorded online ! I didn&#8217;t have time yet to watch all sessions I&#8217;m interested in, but I already saw &#8220;What&#8221;s new in WPF 4&#8243; video (available here). Here are the important points of this session regarding the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.japf.fr/wp-content/uploads/2009/03/mix09.jpg" rel="lightbox[178]"><img class="alignnone size-full wp-image-164" title="mix09" src="http://www.japf.fr/wp-content/uploads/2009/03/mix09.jpg" alt="mix09" width="129" height="113" /></a></p>
<p>MIX09 is now over and the good news is that we can watch all sessions that have been recorded <a href="http://videos.visitmix.com/MIX09/T39F">online</a> !</p>
<p>I didn&#8217;t have time yet to watch all sessions I&#8217;m interested in, but I already saw &#8220;What&#8221;s new in WPF 4&#8243; video (available <a href="http://videos.visitmix.com/MIX09/T39F">here</a>).</p>
<p>Here are the important points of this session regarding the future of WPF:</p>
<ul>
<li>Lot of new things are coming in WPF4: <strong>Text clarity improved</strong>, <strong>Multi-touch</strong>, Windows7 integration, <strong>Ribbon </strong>control, <strong>Focus management improvements</strong>, <strong>Visual State Manager</strong>, Client profile, Themes, Chart controls and a lot of <strong>bug fixes</strong>&#8230;</li>
<li>WPF4 will come together with .Net4 which brings its own set of cool new stuff: Dynamic Language, MEF, F#, parallel library</li>
<li>WPF will be the best choise for RAD under Windows7: Multi-touch, <strong>Taskbar integration</strong>, Ribbon, <strong>Common dialogs</strong>, <strong>File explorer</strong> customization&#8230;</li>
<li><strong>Multi-touch support</strong>: UIElement changes to manage touch related events, touch support is added for some controls (ScrollViewer)</li>
<li><strong>New composition API</strong>: developers can control graphical elements cached in video memory</li>
<li>Controls that are currently available in the <a href="http://www.codeplex.com/wpf">WPF toolkit</a> will be integrated into the platform (DataGrid, DatePicker&#8230;) &#8211; moreover an update of the toolkit has just been released</li>
<li>Developers tools are improved: VS2010 and Blend3 helps the usage of WPF (databinding support&#8230;)</li>
<li>.Net4 will come with a <strong>new XAML parser</strong>: faster, extensible, public API to manage BAML format</li>
<li>.Net4 XAML language has <strong>new XAML features</strong>: support for generics, better references by name</li>
</ul>
<p>I hope will see a CTP soon so that we&#8217;ll start playing with those new features <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/03/the-future-of-wpf-at-mix09/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
