<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Erno de Weerd</title><link>http://blogs.infosupport.com/blogs/ernow/default.aspx</link><description>About software development and training</description><language>en</language><generator>CommunityServer 2008.5 SP1 (Build: 31106.3070)</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ErnoDeWeerd" type="application/rss+xml" /><feedburner:browserFriendly>This is an XML content feed. It is intended to be viewed in a newsreader or syndicated to another site.</feedburner:browserFriendly><item><title>Do you play?</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/06/30/do-you-play.aspx</link><category>Coding</category><category>Design</category><category>Process</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Tue, 30 Jun 2009 13:43:41 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16240</guid><description>&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/chess_5F00_14818E48.jpg"&gt;&lt;img style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" title="chess" border="0" alt="chess" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/chess_5F00_thumb_5F00_1E667FB3.jpg" width="179" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A few years ago I advocated the addition of a Minister of IT to our government in a column. One of the main reasons for supporting this (or even being up for the position myself) is the apparent lack of thorough knowledge of information technology amongst our leaders. I still think that IT is so fundamental to our current society that there is no way of justifying having a Minister of Health, Welfare and Sports and not a Minister of IT.&lt;/p&gt;  &lt;p&gt;But &lt;a href="http://www.bobdylan.com/#/songs/times-they-are-changin"&gt;the times they are a-changing&lt;/a&gt;! (read that text when you don’t know it by heart)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://arstechnica.com/gaming/news/2009/06/uk-politician-understands-games-as-business-common-sense.ars"&gt;According to this article&lt;/a&gt; the UK has a member of parliament who at least know a bit about what he is talking about. Besides this being the ultimate excuse for playing games this also made me think about applying this attitude in my own life and work.&lt;/p&gt;  &lt;p&gt;When designing and implementing business software we talk to end users to gather feedback on our interpretation of the problem and solution. By doing this we slowly start to understand the end-user and become one ourselves. Especially during manual tests we play (pun intended) ‘end user’.&lt;/p&gt;  &lt;p&gt;But aren’t we kidding ourselves this way? Did we ever use the software for real? Did we ever have to do the job of the end user? Did we ever try a software solution created by a third party?&lt;/p&gt;  &lt;p&gt;Are we still using the same patterns, tools, libraries, languages, compilers, platforms, operating systems as we did a couple of years ago? If so, WHY? Did we examine new alternatives while being open to switch to these alternatives or are we old dogs with old tricks?&lt;/p&gt;  &lt;p&gt;Game on!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16240" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=16240</wfw:commentRss></item><item><title>Silverlight, Windows Live Writer and WordPress</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/06/21/silverlight-windows-live-writer-and-wordpress.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Sun, 21 Jun 2009 10:04:00 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16176</guid><description>&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/Wordpresslogo_5F00_7F42ECB6.png"&gt;&lt;img style="border-right-width:0px;display:block;float:none;border-top-width:0px;border-bottom-width:0px;margin-left:auto;border-left-width:0px;margin-right:auto;" title="Wordpress-logo" border="0" alt="Wordpress-logo" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/Wordpresslogo_5F00_thumb_5F00_67AB3F43.png" width="519" height="133" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#ff0000"&gt;Update! &lt;a href="http://blogs.infosupport.com/media/p/16175.aspx" target="_blank"&gt;Please download version 2&lt;/a&gt; It fixes some relative/absolute url problems.&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;You might have been wondering why on earth I haven’t included any Silverlight demos in this blog. The reason is as simple as it is frustrating: the software that runs this blog has no support for embedding Silverlight applications. Of course we might build this in due time but so far we haven’t.&lt;/p&gt;  &lt;p&gt;So I decided to have a look what is needed to allow Silverlight applications to be embedded in blog posts. Here is the short list:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The blogging software/engine must be able to render the correct HTML so the SL application will be in the post when readers download the post. (This raises an interesting issue: are the mainstream blog readers able to display SL apps?!) &lt;/li&gt;    &lt;li&gt;The internet server that hosts the SL applications has have the correct mime types registered so the SL application is displayed in the post instead of the user being prompted whether he wants to downloaded the XAP file. &lt;/li&gt;    &lt;li&gt;I use &lt;a href="http://windowslivewriter.spaces.live.com/"&gt;Windows Live Writer&lt;/a&gt; (WLW) to write my blog posts, I want to be able to insert and upload the SL application using WLW. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Here is what I did on my personal blog (not this one, as it is the corporate site and I am not allowed to mess with that) which uses WordPress. Please do realize that what I did can only be done when you have nearly full access to the server that hosts the blog. You can NOT follow these steps when your blog is hosted by some 3rd party such as WordPress.com.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Adding support for SL to WordPress was easy as pie. Tim made a very nice &lt;a href="http://wordpress.org/extend/plugins/silverlight-for-wordpress/"&gt;plugin for WordPress&lt;/a&gt;. Installing it was a breeze. &lt;a href="http://timheuer.com/blog/archive/2009/03/28/silverlight-for-wordpress-plugin.aspx"&gt;Thanks Tim!&lt;/a&gt; Tweaks I made:       &lt;ol&gt;       &lt;li&gt;Redirected the plug-in to my site so Tim’s site doesn’t get all the requests for the image that is being displayed when the reader hasn’t got the correct version of Silverlight installed. (It would be nice if Microsoft hosted some cool images for things like this. &lt;/li&gt;        &lt;li&gt;Not a real tweak but a true hack: I decided to add an extra parameter to the plug-in WITHOUT changing the plug-in’s code. See step 3. &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;My blog’s host uses a Configuration Panel that allows me quite some advanced tinkering with my website. Therefore adding correct &lt;a href="http://tim.raines.com.au/Lists/Posts/Post.aspx?ID=60"&gt;MIME Type support for Silverlight&lt;/a&gt; was a breeze. &lt;/li&gt;    &lt;li&gt;This is the most complex step so I’ll break it up in chewable bites, bytes or bits:      &lt;ul&gt;       &lt;li&gt;Using the experience I gathered while writing &lt;a href="http://blogs.infosupport.com/blogs/ernow/archive/2006/09/25/Community-Server-Gallery-Plugin-for-Windows-Live-Writer-version-2.0.aspx"&gt;a plug-in for WLW and the Community Server Gallery&lt;/a&gt;, &lt;a href="http://www.code-magazine.com/article.aspx?quickid=0804092&amp;amp;page=3"&gt;some good&lt;/a&gt; &lt;a href="http://blog.benhall.me.uk/2007/09/windows-live-writer-plugin-uploading.html"&gt;posts on the web&lt;/a&gt; and the, at times pathetic, &lt;a href="http://msdn.microsoft.com/en-us/library/aa738906.aspx"&gt;documentation on the MSDN&lt;/a&gt; I wrote a plug-in for WLW from scratch. My goal was a plug-in that makes embedding a Silverlight application into a post as easy as inserting an image. I think I got quite close. Here is the UI I designed (I might make it a bit cooler but this is OK for now):           &lt;br /&gt;          &lt;br /&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/Icon_5F00_6F0E3922.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="Icon" border="0" alt="Icon" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/Icon_5F00_thumb_5F00_039388A1.jpg" width="153" height="103" /&gt;&lt;/a&gt; &lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/DefaultOptions_5F00_7C744C28.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="DefaultOptions" border="0" alt="DefaultOptions" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/DefaultOptions_5F00_thumb_5F00_1818D81F.jpg" width="203" height="572" /&gt;&lt;/a&gt; &lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/InsertOptions_5F00_7EB0D4E4.jpg"&gt;&lt;img style="border-right-width:0px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="InsertOptions" border="0" alt="InsertOptions" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/InsertOptions_5F00_thumb_5F00_57768BAF.jpg" width="208" height="540" /&gt;&lt;/a&gt;           &lt;br /&gt;Some quirks I ran into:           &lt;ul&gt;           &lt;li&gt;WLW will only automagically upload a file (the .xap in this case) when the file is referred to in the post by an image tag (&amp;lt;img src=”Bar.xap”/&amp;gt;) or by a link (&amp;lt;a href=”Foo.xap”/&amp;gt;). The marker that is parsed by Tim’s plug-in does not include such a link so the xap didn’t get uploaded. My first hack was to add a hidden hyperlink &lt;strong&gt;to the post&lt;/strong&gt; but that is just plain ugly. So I decided to trick WLW into uploading the xap by adding a hyperlink &lt;strong&gt;to the marker&lt;/strong&gt;. Tim’s plug-in expects a marker that looks like this: [silverlight: URL, WIDTH, HEIGHT, MINVER] e.g. [silverlight: app.xap, 400, 300, foo=bar#second=true#test=1, 2.0.31005.0] So I made the WLW plugin to generate such a marker with a little extra in red: e.g. [silverlight: app.xap, 400, 300, foo=bar#second=true#test=1, 2.0.31005.0, &lt;span style="color:#ff0000;"&gt;&amp;lt;a style=”display:none” href=”local path to xap”&amp;gt;Fake Link&amp;lt;/a&amp;gt;&lt;/span&gt;] Tim’s plug-in ignores this so in the post that is downloaded to my dear readers (yes, you are one of them) there is no pollution. &lt;/li&gt;            &lt;li&gt;WordPress doesn’t like to have xap files uploaded to it by default. So you have to &lt;a href="http://blogs.voxeo.com/behindtheblog/2008/10/28/how-to-allow-the-upload-of-newer-file-types-not-listed-in-wordpress/"&gt;instruct WordPress to accept xap files&lt;/a&gt;. While it is not hard to do so, it requires access to the php code of WordPress on your site. Here is what I did: I opened the file named www.yoursitehere.com/wp-includes/functions.php and searched for this function:               &lt;br /&gt;function wp_check_filetype( $filename, $mimes = null ) in my version it was on line 2034 and added one line (in blue):               &lt;br /&gt;&lt;span style="color:#c0c0c0;"&gt;&amp;#39;gz|gzip&amp;#39; =&amp;gt; &amp;#39;application/x-gzip&amp;#39;,                &lt;br /&gt;&amp;#39;exe&amp;#39; =&amp;gt; &amp;#39;application/x-msdownload&amp;#39;,&lt;/span&gt;               &lt;br /&gt;&lt;span style="color:#0080ff;"&gt;&amp;#39;xap&amp;#39; =&amp;gt; &amp;#39;application/x-silverlight-app&amp;#39;,&lt;/span&gt; &lt;/li&gt;            &lt;li&gt;I haven’t found any way to force WLW to replace a Silverlight app other than by renaming the xap on the client, removing the old Silverlight app from the post and inserting the new version. The only other way I can think of is by logging in to WordPress as an admin and replace the xap file by hand. I might need this functionality because every now and then I make mistakes and need to update my code… &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;I am quite content with this solution but it would be nice to have some standard way of doing this for other blogging engines and blog post writing software. &lt;/p&gt;  &lt;p&gt;You can &lt;a href="http://blogs.infosupport.com/media/p/16175.aspx"&gt;download the WLW plug-in source code here&lt;/a&gt;. I am not going to put it up for download at the WLW plug-in gallery as I do not like their MSI requirement (it is way too complicated and last time I had to use WiX to make one) which is overkill for simply copying a dll. Use the plug-in at your own risk, use the sources anyway you like; when something goes wrong blame anyone but not me. Install it by dropping it in the \Program Files\Windows Live Writer\Plugins\ folder and restart WLW.&lt;/p&gt;  &lt;p&gt;Remember: you can only use this out-of-the-box when you are using WordPress and Windows Live Writer, you must be able to install Tim’s plug-in for WordPress, be able to add the MIME Types of your web server (or ask the provider nicely) and finally be able to edit the functions.php of your WordPress installation. Again: all at your own risk. Make backups before adjusting/trashing your blog!&lt;/p&gt;  &lt;p&gt;On the good side, this WLW plug-in could easily be customized into generating markers for other blogging server software. Feel free to do so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16176" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=16176</wfw:commentRss></item><item><title>Sampling</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/05/28/sampling.aspx</link><category>Coding</category><category>Design</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Thu, 28 May 2009 00:07:29 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:16018</guid><description>&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/character_5F00_set_5F00_selector_5F00_2F0F6601.jpg"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="character_set_selector" border="0" alt="character_set_selector" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/character_5F00_set_5F00_selector_5F00_thumb_5F00_22A142D8.jpg" width="420" height="219" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Whenever you test it is vital that you pick correct test data. Suppose you need to verify that you implemented an Add method correctly and you test it by passing 2 and 2 to be added. There are many implementations that would respond with 4. Here are a couple:&lt;/p&gt;  &lt;div style="border-bottom:gray 1px solid;border-left:gray 1px solid;padding-bottom:4px;line-height:12pt;background-color:#f4f4f4;margin:20px 0px 10px;padding-left:4px;width:97.5%;padding-right:4px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;max-height:200px;font-size:8pt;overflow:auto;border-top:gray 1px solid;cursor:text;border-right:gray 1px solid;padding-top:4px;"&gt;   &lt;div style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;     &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; num1 + num2;&lt;/pre&gt;

    &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; 4;&lt;/pre&gt;

    &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; num1 + num1;&lt;/pre&gt;

    &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; num1 * num2;&lt;/pre&gt;

    &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:white;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; Math.Pow(num1, num2);&lt;/pre&gt;

    &lt;pre style="border-bottom-style:none;padding-bottom:0px;line-height:12pt;border-right-style:none;background-color:#f4f4f4;margin:0em;padding-left:0px;width:100%;padding-right:0px;font-family:consolas, &amp;#39;Courier New&amp;#39;, courier, monospace;border-top-style:none;color:black;font-size:8pt;border-left-style:none;overflow:visible;padding-top:0px;"&gt;&lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; Math.Pow(num1, 2);&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;These might be obvious but most methods we implement aren’t that easy to grasp in the blink of an eye.&lt;/p&gt;

&lt;p&gt;Now have a look at this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_03_5F00_7B66F9A2.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="CodeSample_03" border="0" alt="CodeSample_03" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_03_5F00_thumb_5F00_41E3E9AB.png" width="642" height="378" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; Does it look familiar? When spending a lot of time coding in Visual Studio the font you use is more important than you might think. There are a lot of &lt;a href="http://hivelogic.com/articles/view/top-10-programming-fonts" target="_blank"&gt;coding fonts&lt;/a&gt; and it is worth it to put some time in selecting your favorite. So how do you select a coding font? Well, the obvious thing to do is to test them. But what is a valid test? &lt;/p&gt;

&lt;p&gt;The easiest way is to switch to the font and start coding and see if the font works for you. Less work is to examine the font a bit better before switching so that is why Visual Studio has a tiny sample in the dialog above:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_01_5F00_7303244B.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="CodeSample_01" border="0" alt="CodeSample_01" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_01_5F00_thumb_5F00_409F50CC.png" width="206" height="59" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Unfortunately most font-aware coders don’t care about A, a, B, b, X, x, Y, y, Z and z. Most care about 1, i, I, L, o, O, 0, B, 8, : and ; spotting the difference between 1 and i is getting more and more important due to the dynamic languages. (&lt;a href="http://www.4guysfromrolla.com/webtech/faq/Intermediate/faq6.shtml" target="_blank"&gt;Remember “Option Explicit”?&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;Microsoft felt our pain and changed the sample in the dialog in Visual Studio 2010 (Beta 1):&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_02_5F00_44A99E9E.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:block;float:none;margin-left:auto;border-top:0px;margin-right:auto;border-right:0px;" title="CodeSample_02" border="0" alt="CodeSample_02" src="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Blogs.Components.WeblogFiles/ernow/CodeSample_5F00_02_5F00_thumb_5F00_527BE499.png" width="211" height="60" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I have been working with Visual Studio 2010 (I am writing a C# 4.0 + Parallel Programming training) for a while now and I like what they did to the editor and I can’t wait to get my hands on the final release.&lt;/p&gt;

&lt;p&gt;In my search for fonts for coders I stumbled on this very cool tool called &lt;a href="http://fontstruct.fontshop.com/" target="_blank"&gt;FontStruct&lt;/a&gt;. So if you are feeling creative, create your own font!&lt;/p&gt;

&lt;p&gt;What is your favorite coding font? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=16018" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=16018</wfw:commentRss></item><item><title>Browsers, 3D, Google and OpenGL</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/04/22/browsers-3d-google-and-opengl.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Tue, 21 Apr 2009 23:38:00 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:15681</guid><description>&lt;p&gt;Google &lt;a href="http://google-code-updates.blogspot.com/2009/04/toward-open-web-standard-for-3d.html"&gt;published a new browser plug-in that implements the O3D standard&lt;/a&gt;. It is a very early version but the videos and the demos make its use and intent&amp;nbsp;pretty clear. This implementation uses OpenGL.&lt;/p&gt;
&lt;p&gt;I expect to see Flash, Silverlight and OD3 competing for bringing hardware accelerated 3D content to the browser. Competition is a good thing so I hope they all do their utmost in getting the user the best experience AND the developers the best tooling.&lt;/p&gt;
&lt;p&gt;Some random thoughts:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Browsers and hardware acceleration: that seems a contradiction. I expect some friction there.&lt;/li&gt;
&lt;li&gt;I hope someone will implement O3D in DirectX&lt;/li&gt;
&lt;li&gt;The browser is becoming a strange thing: a host, a platform, a content renderer. One of these days someone will rip it up in pieces or someone else will integrate it al perfectly. The distinction between an OS, browser, platform and plug-in is getting less and less clear.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=15681" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=15681</wfw:commentRss></item><item><title>Merger</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/04/21/merger.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Mon, 20 Apr 2009 23:21:00 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:15675</guid><description>&lt;p&gt;&lt;a href="http://blogs.infosupport.com/cfs-file.ashx/__key/CommunityServer.Components.PostAttachments/00.00.01.56.74/merger.JPG"&gt;&lt;img border="0" src="http://blogs.infosupport.com/resized-image.ashx/__size/550x0/__key/CommunityServer.Components.PostAttachments/00.00.01.56.74/merger.JPG" alt="" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;One of the key&amp;nbsp;arguments in the battle between the .NET stack and the Java stack is the &amp;quot;one supplier&amp;quot; versus &amp;quot;multiple suppliers&amp;quot; argument.&lt;/p&gt;
&lt;p&gt;Now that &lt;a href="http://www.oracle.com/us/corporate/press/018363"&gt;Oracle is buying Sun&lt;/a&gt; I dug into the press releases and found this little gem in the &lt;a href="http://www.oracle.com/sun/sun-faq.pdf"&gt;Frequently Asked Questions&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;em&gt;&lt;b&gt;&lt;span&gt;How is the transaction expected to benefit partners?&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;span&gt;Oracle and Sun partners are expected to benefit by working with a single vendor to address customer needs for enterprise systems.&lt;/span&gt;&lt;/em&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.microsoft.com/presspass/features/1999/06-14pss.mspx"&gt;Sounds familiar&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;As most technical people I am primarily interested in what the Java technology stack will look like. And by that I do not mean the obligatory &lt;em&gt;&amp;quot;don&amp;#39;t you worry, we&amp;#39;ll support all of them&amp;quot;&lt;/em&gt; in the FAQ but I want to know what will remain after 1 to 5 years. What will happen to JavaFX, MySQL, GlassFish and NetBeans? I do not expect Oracle to drop them but they might decide to discontinue the innovation of these products. We need to know about that so we can advise our customers when&amp;nbsp;selecting products and technologies.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=15675" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=15675</wfw:commentRss></item><item><title>Light!</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/03/18/Light_2100_.aspx</link><category>Design</category><category>3D Rendering</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Wed, 18 Mar 2009 08:58:48 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:15353</guid><description>&lt;p&gt;A while ago I attended a presentation and in the slideshow I noticed a picture with very interesting attributes. The background of the slide was pure white and the picture had a white background too so there was a perfect blending in of the image however, the object in the image was white as well so all you could see was its shadows. I have been programming and playing with &lt;a href="http://en.wikipedia.org/wiki/Ray_tracing_(graphics)#Software" target="_blank"&gt;raytracers&lt;/a&gt; for long enough (more than 20 years) to recognize a raytraced image pretty quickly but this one was different, it used &lt;a href="http://en.wikipedia.org/wiki/Radiosity" target="_blank"&gt;radiosity&lt;/a&gt; causing the shadows to be more real and correctly colored. &lt;/p&gt;  &lt;p&gt;To make a long story short: I dived once again into the world of &lt;a href="http://www.povray.org/" target="_blank"&gt;POV-Ray&lt;/a&gt;, &lt;a href="http://www.povray.org/download/" target="_blank"&gt;Moray&lt;/a&gt; and radiosity. My goal was create a stock of transparent images by rendering shadows only so the images would fit on ANY background. I am not going to give you my images (just come to a presentation I give to see them) but I am going to give you my recipe.&lt;/p&gt;  &lt;p&gt;But first, in honor of the first CTP of Silverlight 3 that is to be released later today, (if you look around on the internet you can already find the bits) I have rendered this using the recipe below (except for the blue colors).&lt;/p&gt;  &lt;p&gt;&lt;img style="display:block;float:none;margin-left:auto;margin-right:auto;" alt="SL3" src="http://blogs.infosupport.com/photos/ernow/images/15347/original.aspx" /&gt;&lt;/p&gt;  &lt;p&gt;Here is what you do in POV-Ray:&lt;/p&gt;  &lt;p&gt;Setup radiosity like this:&lt;/p&gt;  &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;radiosity {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    brightness       2.2&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    count            100&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    error_bound      0.75&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    gray_threshold   0.0&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    low_error_factor 0.2&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    minimum_reuse    0.015&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    nearest_count    10&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;    recursion_limit  1&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    #&lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (version&amp;gt;3.1)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      adc_bailout      0.01&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      max_sample       -1.0&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      media            off&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      normal           off&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      always_sample    1&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      pretrace_start   0.08&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      pretrace_end     0.04&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;    #end&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;  }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Radiosity works best when not explicitly using any lights like point lights, ambient lights or area lights in POV-Ray or any raytracer due to the way radiosity works. What you need is some objects made from materials that emit light (that sounds like an ordinary light but to the raytracer there is a very distinct difference). To get the effect I was looking for I created two materials:&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;#declare Pure_White_Light = &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;   material  &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;   {   &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      texture&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      {      &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;         pigment&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            color rgb &amp;lt;1.0, 1.0, 1.0&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         }      &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;         finish&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            ambient 1.0&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            specular 0.7266&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            roughness 0.006139&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;   }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&amp;#160;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;#declare White = &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;   material&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;   {   &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;      texture&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      {      &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;         pigment&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            color rgb &amp;lt;1.0, 1.0, 1.0&amp;gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         }      &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;         finish&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            ambient 0.0&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            phong 0.1151&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            phong_size 25.163333&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            specular 0.769767&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;            roughness 0.0&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;            metallic 0.5&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;      }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;   }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The magic is in the ‘finish’ as you can see the Pure_White_Light material emits an ambient light.&lt;/p&gt;

&lt;p&gt;Assign the objects you want to use as lights in your scene this emitting material and you are set to go.&lt;/p&gt;

&lt;p&gt;One final step:&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;background { color &amp;lt;1.000,1.000,1.000&amp;gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;The image that is being rendered will be rendered to a white background. This will make it possible to add a transparency to the image based on the ‘darkness’ of the image in a image processing tool like &lt;a href="http://www.getpaint.net/" target="_blank"&gt;Paint.NET&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So lets render a cube:&lt;/p&gt;

&lt;p&gt;&lt;img style="display:block;float:none;margin-left:auto;margin-right:auto;" alt="cube_01" src="http://blogs.infosupport.com/photos/ernow/images/15348/original.aspx" /&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;On a white background this appears quite good and subtle. (Remember this is all a matter of taste and this is my blog so I am entitled to give my opinion and you do not have to agree ;-) ) Now let’s get this cube ready for an other background. &lt;/p&gt;

&lt;p&gt;Start Paint.NET after installing the &lt;a href="http://paintdotnet.forumer.com/viewtopic.php?p=13573#p13573" target="_blank"&gt;Alpha Mask plugin&lt;/a&gt; and open the image. First invert the colors of the image.&lt;/p&gt;

&lt;p&gt;&lt;img style="display:block;float:none;margin-left:auto;margin-right:auto;" src="http://blogs.infosupport.com/photos/ernow/images/15349/original.aspx" /&gt;&lt;/p&gt;

&lt;p&gt;Next, apply the Alpha Mask plugin and select the same image as the alpha mask and invert the mask.&lt;/p&gt;

&lt;p&gt;&lt;img style="display:block;float:none;margin-left:auto;margin-right:auto;" src="http://blogs.infosupport.com/photos/ernow/images/15350/original.aspx" /&gt;&lt;/p&gt;

&lt;p&gt;You’ll end up with the transparent version of the image above:&lt;/p&gt;

&lt;p&gt;&lt;img style="display:block;float:none;margin-left:auto;margin-right:auto;" src="http://blogs.infosupport.com/photos/ernow/images/15351/original.aspx" /&gt;&lt;/p&gt;

&lt;p&gt;(The checker pattern is the background that Paint.NET shows when there is nothing to see)&lt;/p&gt;

&lt;p&gt;This image can be used on top of any color in a slideshow. Of course I am going to write a plugin for Paint.NET that does all of this in a single keystroke but that’s for later ;-)&lt;/p&gt;

&lt;p&gt;&lt;img src="http://blogs.infosupport.com/photos/ernow/images/15352/original.aspx" /&gt;&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=15353" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=15353</wfw:commentRss></item><item><title>How experienced are you?</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/02/03/How-experienced-are-you_3F00_.aspx</link><category>Design</category><category>Windows Presentation Foundation Tutorials (FKA: Avalon)</category><category>WPF</category><category>Silverlight</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Tue, 03 Feb 2009 13:09:00 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:15027</guid><description>&lt;p&gt;Normally I do not like companies that create user&amp;nbsp;interface controls because they:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Make all applications look the same&lt;/li&gt;&lt;li&gt;Invent stuff that should have been in the framework&lt;/li&gt;&lt;li&gt;Don&amp;#39;t think out of the box&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;(and, to be honest, I simply envy them because it&amp;#39;s such a cool job to create them)&lt;/p&gt;&lt;p&gt;Infragistics has some nice controls but they now published a &lt;a href="http://quince.infragistics.com/#/Main"&gt;catalog of User Experience (UX) patterns&lt;/a&gt;. Nice job!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=15027" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=15027</wfw:commentRss></item><item><title>Are you comfy?</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/01/22/Are-you-comfy_3F00_.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Wed, 21 Jan 2009 23:11:00 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14969</guid><description>&lt;p align="center"&gt;&lt;img style="width:290px;height:229px;" height="229" src="http://blogs.infosupport.com/photos/ernow/images/14970/original.aspx" width="290" align="middle" /&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Reading an article like &lt;a href="http://www.joelonsoftware.com/articles/fieldguidetodevelopers.html"&gt;A Field Guide to Developers by Joel Spolsky&lt;/a&gt; makes me wonder:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;What part of this story is 'American' and what could/should be implemented right here, right now?&lt;/li&gt;    &lt;li&gt;If you answered the previous question with 'all of it is very American', my guess is you are a manager. If you answered 'we need all of that right here and now', I think you are a recruiter or addicted to being pampered. (Or is that my latent manager alter ego?)&lt;/li&gt;    &lt;li&gt;How do these 'environmental conditions' MoSCoW (Must have, Should Have, Could have, Would have) for me?&lt;/li&gt;    &lt;li&gt;How do you, dear reader, MoSCoW them?&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;My 'environmental priorities'&lt;/strong&gt;    &lt;br /&gt;(Read the article to understand what these topics mean)&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Must (can't do without)&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A spot where I can work without getting interrupted when I don't want to be interrupted.&lt;/li&gt;    &lt;li&gt;A clean, bright office but not sterile or lamp lit&lt;/li&gt;    &lt;li&gt;Top notch chair and table&lt;/li&gt;    &lt;li&gt;Smart colleagues&lt;/li&gt;    &lt;li&gt;Independence and autonomy&lt;/li&gt;    &lt;li&gt;Work on something interesting&lt;/li&gt;    &lt;li&gt;Use cool new tools&lt;/li&gt;    &lt;li&gt;Identify with my company&lt;/li&gt;    &lt;li&gt;Getting paid competitively&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;u&gt;Should (can do without but only after being/getting convinced)&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Free reign on Amazon.com&lt;/li&gt;    &lt;li&gt;No politics&lt;/li&gt;    &lt;li&gt;Flying first class&lt;/li&gt;    &lt;li&gt;Pick my own projects&lt;/li&gt;    &lt;li&gt;Multiple screens&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;u&gt;Could (it would be pleasant to have these but I can do without)&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Nice office location&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;u&gt;Would (good to have but I wouldn't even notice if it is lacking)&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Limo pick up&lt;/li&gt;    &lt;li&gt;Being treated like a star&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The funny thing is that having all must have would make me feel like 'being treated like a star'. &lt;/p&gt;  &lt;p&gt;While assembling this list I was rather shocked to find out what my Musts and Shoulds are. I like to think of myself as someone who isn't hooked to a lot of stuff and adapts easily. However, the way I prioritized was by thinking about the effect the 'thing' would have on my work. My guess is that I would be more productive with these around. The fact that those makes me happy, content and comfy is just proof of the fact that I would be more productive and deliver a higher quality.&lt;/p&gt;  &lt;p&gt;Oh, and by the way, I am not telling you which are the ones I have and which I don't: I am not allowing this post to turn into a battle of the employers.    &lt;br /&gt;Please consider that when responding with your MoSCoWs ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14969" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">3</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14969</wfw:commentRss></item><item><title>Crocs in Code</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2009/01/08/Crocs-in-Code.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Thu, 08 Jan 2009 11:49:53 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14913</guid><description>&lt;p&gt;&lt;img height="256" src="http://blogs.infosupport.com/photos/ernow/images/14912/original.aspx" width="192" /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Today someone asked me why you should NOT do the following:&lt;/p&gt;  &lt;p&gt;Subclass and leave an inherited operation empty, not abstract but empty.&lt;/p&gt;  &lt;p&gt;Now, there are very good reasons to give but my wife told me a true story that I liked so much I decided to share it:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Steve_Irwin"&gt;Steve Irwin&lt;/a&gt;, the crocodile hunter, kept crocodiles in his zoo in cages &lt;u&gt;without&lt;/u&gt; doors. He reasoned as follows: if the cages have doors, there will come a day that someone leaves a door open. So he made the zoo keepers jump over the fences to get into the cages.&lt;/p&gt;  &lt;p&gt;When you subclass and leave the method empty you create a door in your code and some day, someone will open that door.&lt;/p&gt;  &lt;p&gt;It might be completely harmless (the croc just ate) but it could also be the start of a wild chase throught the entire zoo hunting a croc that is looking for dinner.&lt;/p&gt;  &lt;p&gt;Do not create potential hazards, Murphy lives just around the corner.&lt;/p&gt;  &lt;p&gt;Yes, I know, there are many good reasons sending shivers down your spine that indicate there is something wrong with the code:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;why would you subclass if the inherited method does not belong in the subclass?&lt;/li&gt;    &lt;li&gt;what is the functional specification and justification of an empty method?&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;but I loved this story.&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14913" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14913</wfw:commentRss></item><item><title>Observe!</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/12/12/Observe_2100_.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Fri, 12 Dec 2008 02:03:08 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14864</guid><description>&lt;p&gt;I just noticed something new in the MSDN documentation about the ObservableCollection&amp;lt;T&amp;gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="2"&gt;You can enumerate over any collection that implements the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;IEnumerable&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; interface, and this is adequate for one-time data binding in Silverlight. However, to set up dynamic bindings so that insertions or deletions in the collection can update the UI automatically, the collection must implement the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;INotifyCollectionChanged&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; interface. This interface exposes the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;CollectionChanged&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; event, an event that should be raised whenever the underlying collection changes. &lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="2"&gt;Silverlight provides the ObservableCollection&amp;lt;T&amp;gt; class, which is a provided base class data collection that implements the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;INotifyCollectionChanged&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; interface, as well as the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;INotifyPropertyChanged&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; interface. It also has the expected collection support, defined by deriving from the &lt;/font&gt;&lt;a&gt;&lt;font size="2"&gt;Collection&amp;lt;T&amp;gt;&lt;/font&gt;&lt;/a&gt;&lt;font size="2"&gt; class.&lt;/font&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;That last part about Silverlight adding the INotifyPropertyChanged is pretty important. Previous versions of the MSDN and books about WPF mentioned that the ObservableCollection in fact did raise the PropertyChanged event but I soon found out it didn't (and still doesn't).&lt;/p&gt;  &lt;p&gt;Now Silverlight adds this behavior. At first glance that is a good thing but thinking about it made me wonder: we now have a class (generic) in WPF/NET 3.5 and Silverlight with the same name and role but different behavior. That might prove to be a bad thing.&lt;/p&gt;  &lt;p&gt;Let's hope WPF/Net 3.5 will quickly follow the Silverlight.&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14864" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14864</wfw:commentRss></item><item><title>Do you Scrum?</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/12/05/Do-you-Scrum_3F00_.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Fri, 05 Dec 2008 07:33:31 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14823</guid><description>&lt;p&gt;I have been reading about &lt;a href="http://en.wikipedia.org/wiki/Scrum_(development)" target="_blank"&gt;Scrum&lt;/a&gt; and if you know me even a little you will not be surprised by me giving you this link: &lt;a href="http://www.gamasutra.com/view/feature/3724/top_10_pitfalls_using_scrum_.php"&gt;Top 10 Pitfalls Using Scrum Methodology for Video Game Development&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;A very interesting read (including the comments) and again I'd like to note that game development isn't that different from 'regular' line of business application development.&lt;/p&gt;  &lt;p align="center"&gt;&lt;img src="http://blogs.infosupport.com/photos/ernow/images/14822/original.aspx" /&gt;&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14823" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14823</wfw:commentRss></item><item><title>Silverlight and the Mouse(Wheel) part II</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/11/21/Silverlight-and-the-Mouse_2800_Wheel_2900_-part-II.aspx</link><category>.NET</category><category>Silverlight</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Fri, 21 Nov 2008 06:03:00 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14765</guid><description>&lt;p&gt;&lt;a href="http://blogs.infosupport.com/ernow/archive/2008/11/14/Silverlight-and-the-Mouse_2800_Wheel_2900_.aspx"&gt;I wrote about Silverlight and the mouse(wheel) before&lt;/a&gt; and the responses are pretty good. One question that stuck to my brain and has been asked in forums is how to actually have controls like the ListBox respond to the MouseWheel event.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;First some code&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;After decorating a ComboBox like this:&lt;/p&gt;&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;MouseWheel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;ComboBoxOnMouseWheel&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;         ...&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;ComboBox&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;It is pretty easy to add this code:&lt;/p&gt;&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; private void ComboBoxOnMouseWheel(object sender, SilverlightMouseSupport.MouseWheelEventArgs e)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     ComboBox comboBox = sender as ComboBox;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     if (comboBox != null)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         if (e.Delta &lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 0 &amp;amp;&amp;amp; comboBox.SelectedIndex &lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt; 0)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;             comboBox.SelectedIndex--;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         else if (e.Delta &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt; 0 &amp;amp;&amp;amp; comboBox.SelectedIndex &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt; comboBox.Items.Count -1)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;             comboBox.SelectedIndex++;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;But as you will notice when testing this code the ComboBox only responds to the wheel when it is collapsed. I tried adding the decorator to the ItemsPanel but that froze the entire Silverlight application. I see no solution for that.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;On to the ListBox&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;To make a control that uses the ScrollViewer to scroll its content you need to access the ScrollViewer that is in the template of the control. For some reason the GetTemplateChild method was made protected so the only way to get it you need to sub class the control and add a little code:&lt;/p&gt;&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;class&lt;/span&gt; ListBox : System.Windows.Controls.ListBox&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; ScrollViewer ScrollViewer&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;         get&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;return&lt;/span&gt; GetTemplateChild(&lt;span style="color:#006080;"&gt;&amp;quot;ScrollViewer&amp;quot;&lt;/span&gt;) &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; ScrollViewer;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;This ListBox now has a ScrollViewer property that can be used in code like this:&lt;/p&gt;&lt;div style="font-size:8pt;margin:20px 0px 10px;overflow:auto;width:97.5%;cursor:text;max-height:200px;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border:gray 1px solid;padding:4px;"&gt;&lt;div style="font-size:8pt;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ListBoxOnMouseWheel(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, SilverlightMouseSupport.MouseWheelEventArgs e)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#008000;"&gt;//note: this is a special ListBox, not a standard Silverlight listbox.&lt;/span&gt;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     ListBox listBox = sender &lt;span style="color:#0000ff;"&gt;as&lt;/span&gt; ListBox;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; scrollStep = 10;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (listBox != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;     {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         ScrollViewer scrollViewer = listBox.ScrollViewer;&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (scrollViewer != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (e.Delta &amp;gt; 0 &amp;amp;&amp;amp; scrollViewer.VerticalOffset &amp;gt; 0)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;             {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;                 scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - e.Delta * scrollStep);&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;             }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (e.Delta &amp;lt; 0 &amp;amp;&amp;amp; scrollViewer.VerticalOffset &amp;lt; scrollViewer.ScrollableHeight)&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;             {&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;                 scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - e.Delta * scrollStep);&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;             }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;         }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;     }&lt;/pre&gt;&lt;pre style="font-size:8pt;margin:0em;overflow:visible;width:100%;color:black;line-height:12pt;font-family:consolas, 'Courier New', courier, monospace;background-color:white;border-style:none;padding:0px;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt; }&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;I have tried to encapsulate this behavior into the ListBox class itself but the problem I ran into is that to make it easy to use I need a way of manipulating the template of the ListBox to add the decorator. It is easy to replace an entire template of a control but I wanted to add the decorator to the existing template in runtime. That is not possible as far as I can see.&lt;/p&gt;&lt;p&gt;I updated the download with this code so you can test and try for yourself.&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Concluding&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;It looks like a hack. And it is. To get this working we need the Silverlight Base Control developers to help us out on this.&lt;/p&gt;&lt;p&gt;&lt;a href="http://blogs.infosupport.com/files/folders/ernow/entry14722.aspx" target="_blank"&gt;Download here&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14765" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14765</wfw:commentRss></item><item><title>Interfaces and compatibility</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/11/14/Interfaces-and-compatibility.aspx</link><category>Design</category><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Fri, 14 Nov 2008 07:09:06 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14724</guid><description>&lt;p&gt;Sticking to industry standard interfaces can safe your life... Last week I found out that an interface that I have been using for years and years might become more common than expected.&lt;/p&gt;  &lt;p&gt;For years manufactures created weak implementations that most of the time didn't stick to the original interface definition. That might have had something to do with patents and stuff.&lt;/p&gt;  &lt;p&gt;I can wait for good, solid, fitting and inspiring implementations.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.portfolio.com/news-markets/national-news/ap/2008/11/12/battle-of-the-bricks-lego-fails-in-trademark-bid" target="_blank"&gt;Read the announcement here.&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14724" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14724</wfw:commentRss></item><item><title>Silverlight and the Mouse(Wheel)</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/11/14/Silverlight-and-the-Mouse_2800_Wheel_2900_.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Fri, 14 Nov 2008 06:14:53 PST</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14723</guid><description>&lt;p&gt;The requested feature is simple: I want full mouse support in Silverlight. I want to use the mouse wheel and the right mouse button. &lt;/p&gt;  &lt;p&gt;After reading numerous blog posts and coding several proofs of concept I found that it is no easy task to get there. (Yes, browsers should be named as part of the evil axis)&lt;/p&gt;  &lt;p&gt;First the good news:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Mouse wheel support is possible. &lt;/li&gt;    &lt;li&gt;I created a very handsome (if I may say so) decorator-like control to add mouse wheel support to a Silverlight application. &lt;/li&gt;    &lt;li&gt;No javascript writing needed. &lt;/li&gt;    &lt;li&gt;You can download it here (look at the end of this post) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;The bad news:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Right mouse button support is a disaster. &lt;/li&gt;    &lt;li&gt;I did not add this to the decorator because I can not get a cross-browser solution to work correctly. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;The details on the good news&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Browsers have different ways of getting the wheel event data. First of all: the browser events are different. Here is how I solved that:&lt;/p&gt;  &lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;   &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;     &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;private&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; AttachBrowserMouseWheelEvent()&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (HtmlPage.IsEnabled)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (HtmlPage.BrowserInformation.UserAgent.Contains(&lt;span style="color:#006080;"&gt;&amp;quot;Firefox&amp;quot;&lt;/span&gt;))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;             HtmlPage.Plugin.AttachEvent(&lt;span style="color:#006080;"&gt;&amp;quot;DOMMouseScroll&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ProcessOnMouseWheel);&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (HtmlPage.BrowserInformation.UserAgent.Contains(&lt;span style="color:#006080;"&gt;&amp;quot;MSIE&amp;quot;&lt;/span&gt;) ||&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;             HtmlPage.BrowserInformation.UserAgent.Contains(&lt;span style="color:#006080;"&gt;&amp;quot;Opera&amp;quot;&lt;/span&gt;) ||&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;             HtmlPage.BrowserInformation.UserAgent.Contains(&lt;span style="color:#006080;"&gt;&amp;quot;Safari&amp;quot;&lt;/span&gt;))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;             HtmlPage.Plugin.AttachEvent(&lt;span style="color:#006080;"&gt;&amp;quot;onmousewheel&amp;quot;&lt;/span&gt;, &lt;span style="color:#0000ff;"&gt;this&lt;/span&gt;.ProcessOnMouseWheel);&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Note that I only tested this code on IE7 and FF2 and FF3.&lt;/p&gt;

&lt;p&gt;A major difference between this code and several examples I found on the web is that I register for the Plugin events, NOT the document or page events. Another difference is that I try to register only one single event; most samples on the web register all and might end up getting the same event multiple times.&lt;/p&gt;

&lt;p&gt;Once you get the correct event you have to parse the event data and of course this is also different for different browsers.&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;public&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;void&lt;/span&gt; ProcessOnMouseWheel(&lt;span style="color:#0000ff;"&gt;object&lt;/span&gt; sender, HtmlEventArgs e)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt; {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (_isMouseOverChild)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;double&lt;/span&gt; delta = 0;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;         ScriptObject eventObj = e.EventObject;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (eventObj.GetProperty(&lt;span style="color:#006080;"&gt;&amp;quot;wheelDelta&amp;quot;&lt;/span&gt;) != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  11:&lt;/span&gt;             delta = ((&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)eventObj.GetProperty(&lt;span style="color:#006080;"&gt;&amp;quot;wheelDelta&amp;quot;&lt;/span&gt;)) / 120;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  12:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  13:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  14:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (HtmlPage.Window.GetProperty(&lt;span style="color:#006080;"&gt;&amp;quot;opera&amp;quot;&lt;/span&gt;) != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  15:&lt;/span&gt;                 delta = -delta;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  16:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  17:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;else&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (eventObj.GetProperty(&lt;span style="color:#006080;"&gt;&amp;quot;detail&amp;quot;&lt;/span&gt;) != &lt;span style="color:#0000ff;"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  18:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  19:&lt;/span&gt;             delta = -((&lt;span style="color:#0000ff;"&gt;double&lt;/span&gt;)eventObj.GetProperty(&lt;span style="color:#006080;"&gt;&amp;quot;detail&amp;quot;&lt;/span&gt;)) / 3;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  20:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  21:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (HtmlPage.BrowserInformation.UserAgent.Contains(&lt;span style="color:#006080;"&gt;&amp;quot;Macintosh&amp;quot;&lt;/span&gt;))&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  22:&lt;/span&gt;                 delta = delta * 3;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  23:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  24:&lt;/span&gt;&amp;#160; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  25:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (delta != 0)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  26:&lt;/span&gt;         {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  27:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;bool&lt;/span&gt; handled = OnMouseWheel(delta);&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  28:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;if&lt;/span&gt; (handled)&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  29:&lt;/span&gt;             {&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  30:&lt;/span&gt;                 e.PreventDefault();&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  31:&lt;/span&gt;             }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  32:&lt;/span&gt;         }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  33:&lt;/span&gt;     }&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  34:&lt;/span&gt; }&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Don't get me started on this it only shows how decent people like me end up solving problems that shouldn't be our's in the first place.&lt;/p&gt;

&lt;p&gt;So, how do we get this code in our precious little Silverlight applications? All examples that I found on the web require page-wide handling of the events or subclassing controls but I wanted a the event to be fired per Silverlight control and I wanted to be able to get rid of this helper code with the least amount of hassle as soon as Microsoft comes out with a real solution.&lt;/p&gt;

&lt;p&gt;I wanted a decorator. Silverlight has no decorator (WPF does...) So I browsed to Codeplex and looked up the code on the Silverlight Viewbox which should be a decorator to find out how they solved that. &lt;em&gt;Whoohoo&lt;/em&gt; for open source: I was able to copy-paste most of the code (let me know if I violated any copyrights doing that). This caused the client code to be able to look like this:&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;UserControl&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;x:Class&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;SilverlightApplication1.Page&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;     &lt;span style="color:#ff0000;"&gt;xmlns&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt;     &lt;span style="color:#ff0000;"&gt;xmlns:x&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   4:&lt;/span&gt;     &lt;span style="color:#ff0000;"&gt;xmlns:m&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;clr-namespace:SilverlightMouseSupport;assembly=SilverlightMouseSupport&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   5:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   6:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;MouseWheel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TextBoxOnMouseWheel&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   7:&lt;/span&gt;             &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBox&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Text&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Scroll the mouse wheel above this textbox.&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   8:&lt;/span&gt;         &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   9:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;Grid&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;  10:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;UserControl&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;As you can see: no special requirements, just a namespace and a wrapping control (decorator).&lt;/p&gt;

&lt;p&gt;BTW: wouldn't it be nice to have attached events (like attached properties) so you could write this:&lt;/p&gt;

&lt;div style="border-right:gray 1px solid;padding-right:4px;border-top:gray 1px solid;padding-left:4px;font-size:8pt;padding-bottom:4px;margin:20px 0px 10px;overflow:auto;border-left:gray 1px solid;width:97.5%;cursor:text;max-height:200px;line-height:12pt;padding-top:4px;border-bottom:gray 1px solid;font-family:consolas, 'Courier New', courier, monospace;background-color:#f4f4f4;"&gt;
  &lt;div style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;
    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   1:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:#f4f4f4;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   2:&lt;/span&gt;     &lt;span style="color:#0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#800000;"&gt;TextBox&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;m:MouseSupport&lt;/span&gt;.&lt;span style="color:#ff0000;"&gt;MouseWheel&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;TextBoxOnMouseWheel&amp;quot;&lt;/span&gt; &lt;span style="color:#ff0000;"&gt;Text&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;=&amp;quot;Scroll the mouse wheel above this textbox.&amp;quot;&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="padding-right:0px;padding-left:0px;font-size:8pt;padding-bottom:0px;margin:0em;overflow:visible;width:100%;color:black;border-top-style:none;line-height:12pt;padding-top:0px;font-family:consolas, 'Courier New', courier, monospace;border-right-style:none;border-left-style:none;background-color:white;border-bottom-style:none;"&gt;&lt;span style="color:#606060;"&gt;   3:&lt;/span&gt; &lt;span style="color:#0000ff;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#800000;"&gt;m:MouseSupport&lt;/span&gt;&lt;span style="color:#0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Although there is no need to edit the TestPages (Html or Aspx) that are generated by Visual Studio, I did edit the Html page because I wanted to be able to use multiple Silverlight controls and the generated javascript simply lacks support for that. So any differences in this page are entirely optional. No need for javascript coding to be able to use the MouseSupport decorator.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Details on the bad news&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For some reason publishers of browser plug-ins think it is necessary to bother the users of our (Rich Internet) applications with the fact that that particular area of the browser is using Silverlight or Flash/Flex/JavaFX by having a hard-coded context menu (right mouse button menu) that allows the user to configure the plug-in. As nice as that may be for a developer, for a user it is totally inappropriate. What would you think when you right-click in Word and you get a menu that allows you to change the wallpaper of your desktop?&lt;/p&gt;

&lt;p&gt;So what to do? I tried to add &lt;em&gt;oncontextmenu=&amp;quot;return false;&amp;quot;&lt;/em&gt; to the Html body or the plug-in tag. This does work but not in Firefox and causes a non-XHTML 1.0 violation. In Firefox, the context menu is still appearing but by right-clicking a second time the event does trigger but that silly context menu is still there. So I resolved to kill this feature from the decorator. If you know how to fix it, let me know and I'll add back in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimers and download&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The code is provided as is. No fees and no guarantees. Also: let me know if I violated any copyrights.&lt;/p&gt;

&lt;p&gt;MouseSupport is a decorator which is used to add mouse events to Silverlight controls.It has been tested on Microsoft Internet Explorer 7 and Firefox versions 2 and 3. 
  &lt;br /&gt;Known issues/restrictions:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;When switching to full screen Silverlight, the mouse wheel events are no longer being send to the control. &lt;/li&gt;

  &lt;li&gt;The MouseWheel event is NOT a routed event. To catch the MouseWheel event on a parent decorate the parent with its own MouseSupport decorator. &lt;/li&gt;

  &lt;li&gt;The MouseSupport decorator has several properties like Background, BorderBrush etc. that should not be used, the control should remain UI-less. &lt;/li&gt;

  &lt;li&gt;The MouseSupport decorator has a Template property but it can NOT be set. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="http://blogs.infosupport.com/files/folders/ernow/entry14722.aspx" target="_blank"&gt;Go to the download...&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Some extra's&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I ran into a very nasty 'feature' of Silverlight while making this. Somehow child controls of custom controls could not be referenced in code. I added a solution for this problem to the download. Let's hope Microsoft fixes this soon.&lt;/p&gt;

&lt;p&gt;Somehow my installation of Visual Studio 2008 does no longer support my Mouse Wheel. The IDE does not respond nor do the web browsers that I open for debugging. In particular for this project that was a real pain as you can imagine. Let me know if you know a solution for this problem.&lt;/p&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14723" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14723</wfw:commentRss></item><item><title>Design</title><link>http://blogs.infosupport.com/blogs/ernow/archive/2008/10/16/Design.aspx</link><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Erno de Weerd</dc:creator><pubDate>Thu, 16 Oct 2008 05:32:00 PDT</pubDate><guid isPermaLink="false">56f6167b-0c51-4839-ab2d-34653eeb5c9c:14559</guid><description>&lt;p&gt;What is the first thing that you think of when you read or hear &amp;quot;Design&amp;quot;?&lt;/p&gt;&lt;ul&gt;&lt;li&gt;UML&lt;/li&gt;&lt;li&gt;Mondriaan&lt;/li&gt;&lt;li&gt;Graphic Tablet&lt;/li&gt;&lt;li&gt;Architecture&lt;/li&gt;&lt;li&gt;Paint.Net&lt;/li&gt;&lt;li&gt;Apple&lt;/li&gt;&lt;li&gt;Money&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;As a true da Vinci (lover of all arts and suffering from &lt;a href="http://everything2.com/index.pl?node_id=639440"&gt;the same syndrome&lt;/a&gt;) a strange mix of these enters my brain and causes me to stare into a distant future envisioning clean, shiny, single purpose tools and gadgets that make day to day life a breeze.&lt;/p&gt;&lt;p&gt;The creation of things. From problem to solution, from idea to realization, from sketch to prototype. That is the really hard part.&lt;/p&gt;&lt;p&gt;As our customers are getting more and more used to &amp;quot;design&amp;quot; hardware and &amp;quot;design&amp;quot; software, our industry of business applications is slowly catching up with all this coolness by slipping in an occasional gradient and animation that gives the applications the extra umpf. Unfortunately we never learned how to use these correctly nor did we learn to come up with new glittering blings so we end up with copying our precious gradient and animation from project to project, doing what we always do: copy the code.&lt;/p&gt;&lt;p&gt;There are people who know about this stuff. They don&amp;#39;t know programming, software patterns, C# or XML but they&amp;nbsp;invent the glitters that make all of us go &lt;em&gt;wooooow!!!&lt;/em&gt;&lt;/p&gt;&lt;p&gt;How do we get both programmers and graphic/user interface designer to work together?&lt;/p&gt;&lt;p&gt;Please, let&amp;#39;s not do the old waterfall trick again: having the artist draw a marvelous prototype and then spend months by having the programmers to recreate it in their favorite programming platform. I bet the customer wants to change the design as soon as he sees it in action so we need an iterative way of designing and implementing.&lt;/p&gt;&lt;p&gt;One of my favorite industries is been having the same problem for a while now so let&amp;#39;s see what we can learn from them: &lt;a href="http://www.gamasutra.com/view/feature/1651/the_codeart_divide_how_technical_.php"&gt;http://www.gamasutra.com/view/feature/1651/the_codeart_divide_how_technical_.php&lt;/a&gt;&lt;/p&gt;&lt;p&gt;It might be hard to read at times, as the article is using very particular terms of graphics and games programming but a couple of things stand out:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Those game programming teams are actual software programming teams, not just a bunch of kids that play around. They have budgets, deadlines, customers, requirements, on the side tool development, politics, communication difficulties... they look just like us.&lt;/li&gt;&lt;li&gt;Content, art, assets, levels, graphics, etc. are first class citizens of the project. These teams seem to understand that these will drive the customers towards their product. Yes code is important but without the graphics and art there is no product.&lt;/li&gt;&lt;li&gt;As much as programmers and graphic designers are different you need some team members that not just understand both worlds but are also respected in both worlds. These are like glue in your team.&lt;/li&gt;&lt;li&gt;The process you use needs some sort of pipeline: a way of moving the design assets into the actual software. You can do that by procedures but tools and software can help a great deal by automating that.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Wouldn&amp;#39;t it be great to really integrate UI design like this in our projects? And on a personal note: I would love to play this &amp;quot;Technical Artist&amp;quot;-role in a project.&lt;/p&gt;&lt;p&gt;At times the game industry is light-years ahead of us...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.infosupport.com/aggbug.aspx?PostID=14559" width="1" height="1"&gt;</description><slash:comments xmlns:slash="http://purl.org/rss/1.0/modules/slash/">2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.infosupport.com/blogs/ernow/rsscomments.aspx?PostID=14559</wfw:commentRss></item></channel></rss>
