<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Gabo's blog</title><subtitle type="html">wax on, wax off for .net developers</subtitle><id>http://weblogs.asp.net/gabriellopez/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/gabriellopez/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-06-01T18:55:00Z</updated><entry><title>iPad client for SharePoint</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2010/04/07/ipad-client-for-sharepoint.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2010/04/07/ipad-client-for-sharepoint.aspx</id><published>2010-04-07T23:01:00Z</published><updated>2010-04-07T23:01:00Z</updated><content type="html">I´m pleased to announce that at SouthLabs we´ve released a native iPad client for SharePoint , called SharePlus Office Mobile Client , already available in the app store . It consumes SharePoint's web services API, and supports offline browsing. The following is a brief presentation on it, with some screenshots. SharePlus iPad client for SharePoint View more presentations from SouthLabs ....(&lt;a href="http://weblogs.asp.net/gabriellopez/archive/2010/04/07/ipad-client-for-sharepoint.aspx"&gt;read more&lt;/a&gt;)&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7434703" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="SharePoint" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/SharePoint/default.aspx" /><category term="WSS" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WSS/default.aspx" /><category term="iPad" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/iPad/default.aspx" /><category term="iPhone" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/iPhone/default.aspx" /><category term="MOSS" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/MOSS/default.aspx" /></entry><entry><title>jQuery web service invocation 411 Length required Error</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2010/03/12/jquery-web-service-invocation-411-length-required-error.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2010/03/12/jquery-web-service-invocation-411-length-required-error.aspx</id><published>2010-03-12T09:04:00Z</published><updated>2010-03-12T09:04:00Z</updated><content type="html">&lt;p&gt;I had a jQuery web service invocation of the form: &lt;br&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "POST",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "/ws/MyServices.asmx/MyOpWithNoParam",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentType: "application/json; charset=utf-8",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; success: function(msg) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error: function(xhr, ajaxOptions, thrownError) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ///handle error&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &amp;nbsp;&lt;/p&gt;&lt;p&gt;When deployed on the web server (Windows 2008 Server, IIS7) it failed miserably at runtime with error:&amp;nbsp; HTTP Error 411 Length required&lt;/p&gt;&lt;p&gt;I tried changing to GET transport method with no luck, what fixed this issue was &lt;b&gt;adding one dummy string parameter to the webservice&lt;/b&gt;, and then adding the data field in the ajax invocation.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $.ajax({&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type: "POST",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; url: "/ws/MyServices.asmx/&lt;b&gt;MyOpWithONEParam&lt;/b&gt;",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; data: "{ data:'test' }",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; contentType: "application/json; charset=utf-8",&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; success: function(msg) {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error: function(xhr, ajaxOptions, thrownError) {&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }); &lt;/p&gt;&lt;p&gt;&amp;nbsp;hope this helps &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7379742" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="jQuery" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/jQuery/default.aspx" /></entry><entry><title>Web Deployment Project fails without errors</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2010/02/12/web-deployment-project-fails-without-errors.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2010/02/12/web-deployment-project-fails-without-errors.aspx</id><published>2010-02-12T15:34:00Z</published><updated>2010-02-12T15:34:00Z</updated><content type="html">&lt;p&gt;We are experiencing one odd issue in our development server, web deployment project build fails but the there are no errors in visual studio's errors list, and the output shows only:&lt;br&gt;&lt;/p&gt;&lt;p&gt;Done building project "XXXX.csproj_deploy.wdproj".&lt;br&gt;========== Rebuild All: 6 succeeded, 1 failed, 0 skipped ========== &lt;/p&gt;&lt;p&gt;There seem to be &lt;a href="http://abdullin.com/journal/2008/7/24/web-deployment-projects-fail-without-errors.html" mce_href="http://abdullin.com/journal/2008/7/24/web-deployment-projects-fail-without-errors.html"&gt;other reports&lt;/a&gt; of the same issue. The &lt;b&gt;workaround &lt;/b&gt;that seems to work is compiling from command line with &lt;b&gt;msbuild /p:Configuration=Release path\XXXX.csproj_deploy.wdproj&lt;/b&gt;&lt;/p&gt;&lt;p&gt;In this way the project builds successfully, but is still not a solution.&lt;/p&gt;&lt;p&gt;Has anyone experienced something similar? Any other workaround you know about?&amp;nbsp; &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7345208" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="vs2008" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/vs2008/default.aspx" /><category term="WDP" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WDP/default.aspx" /><category term="visual studio" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/visual+studio/default.aspx" /></entry><entry><title>Version handling in Workflow Foundation 4</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2010/01/26/version-handling-in-workflow-foundation-4.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2010/01/26/version-handling-in-workflow-foundation-4.aspx</id><published>2010-01-27T02:23:00Z</published><updated>2010-01-27T02:23:00Z</updated><content type="html">
&lt;p&gt;When comparing workflow engines, versionning is a key aspect to take into account. If you are going to implement a workflow based solution, before committing to a platform you need to know what level of support does the engine provide to manage changes throughout the lifecycle of a workflow, you need to know what's going to happen to all the active workflow instances deployed on live once you've made a change on the flow of activities. Will the running instances still run after the new deploy, will they take the changes into account or will they run according to the version of the flow they were deployed with? If not what will my migration strategy be then?&lt;/p&gt;

&lt;p&gt;There's a new version due in March/April of the .NET Framework, and a new &lt;span style="font-weight: bold;"&gt;Workflow Foundation&lt;/span&gt; along with it, both &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=DED875C8-FE5E-4CC9-B973-2171B61FE982&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=DED875C8-FE5E-4CC9-B973-2171B61FE982&amp;amp;displaylang=en"&gt;already available in Beta 2 version&lt;/a&gt;. I'm working on a project based on WF 3.5, and this feature, or the lack of it, has been a major drawback in the current implementation, so when I heard a new version was coming I started to do some research on the topic.&lt;/p&gt;

&lt;p&gt;If you google Workflow Foundation versionning some of the best WF4 links you come across are from the workflow forum threads were the versionning issue appears, in particular in &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/25538e1f-9a53-4557-980a-c0f9692f2c4a" mce_href="http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/25538e1f-9a53-4557-980a-c0f9692f2c4a"&gt;this thread&lt;/a&gt;, the response seems to be (and I quote): &lt;i&gt;"WF4 will not support upgrading existing workflow instances to new definitions. Those instances will need to complete before they can be replaced."&lt;/i&gt;.&lt;/p&gt;

&lt;p&gt;On the other hand, in &lt;a href="http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/7cb152d0-419f-4cb0-bed2-cb8a69c8bb52" mce_href="http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/7cb152d0-419f-4cb0-bed2-cb8a69c8bb52"&gt;this thread&lt;/a&gt; a different and more verbose description is provided, where changes are classified as &lt;b&gt;ok changes&lt;/b&gt;, and &lt;b&gt;breaking changes&lt;/b&gt;.&lt;/p&gt;
 

&lt;p&gt;Based on this threads we decided to do some testing with the beta 2 available to check the behavior of applying changes to a workflow with running instances stored in persistence. We started by modifying the existing persistence sample solution in the training kit (\WF_WCF_Samples\WF\Basic\Persistence\InstancePersistence).&lt;/p&gt;
 

&lt;p&gt;Basically we started several workflow instances with a first basic workflow version, where they unloaded onidle on a bookmark in the middle of the execution. Then we modified the workflow, recompiled, and then loaded and resumed the execution of the persisted instances with a new version of the flow.&lt;/p&gt;

&lt;p&gt;The original workflow was:&lt;/p&gt;

&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/MyWorkflow_v1_Sequence.png" width="510" height="212"&gt;&lt;/td&gt;

&lt;td&gt;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/MyWorkflow_v1_Sequence_Detail.png" width="160" height="236"&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The results were the following:&lt;/p&gt;

&lt;p&gt;The first change applied to the workflow (activities were added at the end of the sequence) did not break the running instances, but it &lt;span style="font-weight: bold;"&gt;was not taken into account by them either&lt;/span&gt;. Workflow instances started with the first version of the workflow completed according to the original logic, while new instances did take the change into account.  Looking back at the threads, this change seems to be an &lt;b&gt;ok change&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;Change applied (2 new activities at the end of the sequence):&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/MyWorkflow_v2_Sequence_Detail.png" width="196" height="416"&gt;

&lt;p&gt;The second change (a conditional activity was added at the beginning of the workflow) did break the running instances, where the execution failed with the following exception message: "'WriteLine' is not of type 'Sequence'. When loading this instance you must ensure that the activity with name 'WriteLine' implements 'Sequence'".&lt;/p&gt;

&lt;p&gt;Second change applied (a conditional activity was included before the existing sequence activity, no variables, arguments or bookmarks were added or modified though):&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/MyWorkflow_v3_Conditional.png" width="809" height="303"&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;

&lt;p&gt;Bottom line, WF4 seems to behave according to what &lt;a href="http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/25538e1f-9a53-4557-980a-c0f9692f2c4a" mce_href="http://social.msdn.microsoft.com/Forums/en-US/wfprerelease/thread/25538e1f-9a53-4557-980a-c0f9692f2c4a"&gt;Amadeo Casas stated in the forum thread&lt;/a&gt;, &lt;b&gt;WF4 does not seem to support upgrading existing workflow instances to new definitions&lt;/b&gt;, with the observation that &lt;b&gt;some changes are ok&lt;/b&gt;, meaning they will not break the running instances, and will only be taken into account by new ones, while &lt;b&gt;there are other changes that are not ok, but are breaking changes&lt;/b&gt;. In this cases and when in doubt imho the safe choice would be to deploy current workflow assembly to the GAC, and deploy the new one with a different, increased version number also in the GAC, pretty much as we had to do in WF 3.5.&lt;/p&gt;

&lt;p&gt;The sources used in the test can be &lt;a href="http://weblogs.asp.net/blogs/gabriellopez/WF4_Versionning_POC_src.zip" mce_href="http://weblogs.asp.net/blogs/gabriellopez/WF4_Versionning_POC_src.zip"&gt;downloaded from here&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7324472" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="WWF" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WWF/default.aspx" /><category term="WF4" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WF4/default.aspx" /></entry><entry><title>asp.net contact web form + send email</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2010/01/22/asp-net-contact-web-form-send-email.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2010/01/22/asp-net-contact-web-form-send-email.aspx</id><published>2010-01-22T18:36:00Z</published><updated>2010-01-22T18:36:00Z</updated><content type="html">&lt;p&gt;We've recently launched &lt;a href="http://southlabs.com" title="SouthLabs" mce_href="http://southlabs.com"&gt;SouthLabs website&lt;/a&gt;, so once we received all the html+css&amp;amp;imgs from our designers we had to bring to life the site, and had to implement a basic contact us web form, with basic input validation, and support to send an email upon submit. &lt;/p&gt;&lt;p&gt;I figure this could might save someone 15 minutes worth of work (maybe myself in the future :) in case you need something similar.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Input validation is performed with jQuery validation plugin, and emails are sent with a contact.ashx handler, that expects a gmail account config to send the email.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/contact.png" title="ASP.NET Contact Form" alt="ASP.NET Contact Form" mce_src="http://weblogs.asp.net/blogs/gabriellopez/contact.png" width="404" height="283"&gt;&lt;/p&gt;&lt;p&gt;The source code can be &lt;a href="http://weblogs.asp.net/blogs/gabriellopez/WebContactForm.zip" title="ASP.NET Web contact form" mce_href="http://weblogs.asp.net/blogs/gabriellopez/WebContactForm.zip"&gt;downloaded from here&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7319969" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="ajax" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/ajax/default.aspx" /><category term="asp.net" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/asp.net/default.aspx" /></entry><entry><title>Workflow  + WCF + ASP.NET sample updated</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/11/11/workflow-wcf-asp-net-sample-updated.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/11/11/workflow-wcf-asp-net-sample-updated.aspx</id><published>2008-11-11T12:01:00Z</published><updated>2008-11-11T12:01:00Z</updated><content type="html">&lt;p&gt;Back in 2006 when Workflow foundation was still WWF (and some of us believed it was going to change the world), and all the foundations were "add ons" on top of the .NET 2.0 version of the framework I set out to build a reference asp.net help desk solution to learn the basics of the once new workflow &amp;amp; communication foundations, plus asp.net membership to see if I could make sense of all these technologies in one integrated sample.&lt;/p&gt;&lt;p&gt;The project was named &lt;a href="http://sinergia.sourceforge.net/" mce_href="http://sinergia.sourceforge.net/"&gt;Sinergia and lives in sourceforge&lt;/a&gt; (why sourceforge and not codeplex is the topic for another post). It turned out to be a pretty good experience, I played hosting workflow in a couple different hosts, and I finally settled for a Windows Service. It was a good excercise to learn what could be the best practices for developing, testing and deploying a workflow solution. I think it provides good guidance for anyone looking to build a workflow based, web .net solution.&lt;br&gt;&lt;/p&gt;&lt;p&gt;I updated the project some weeks ago, to the .net 3.5 version of the framework. It's available for &lt;a href="https://sourceforge.net/project/showfiles.php?group_id=168325" mce_href="https://sourceforge.net/project/showfiles.php?group_id=168325"&gt;download here&lt;/a&gt;.Post PDC word is Workflow Foundation is going through some major changes, which I still have to evaluate, understand and some day maybe impact on this bits.&lt;br&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6729332" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="WCF" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WCF/default.aspx" /><category term="WWF" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WWF/default.aspx" /></entry><entry><title>Silverlight free controls</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/10/09/silverlight-free-controls.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/10/09/silverlight-free-controls.aspx</id><published>2008-10-09T17:01:00Z</published><updated>2008-10-09T17:01:00Z</updated><content type="html">&lt;p&gt;We are doing some Silverlight development so I started to
look for third party controls to make my webapp look sexy, and came across &lt;a href="http://blogs.msdn.com/mgrayson/" mce_href="http://blogs.msdn.com/mgrayson/"&gt;Martin Grayson’s&lt;/a&gt;Blacklight project. Seems Microsoft is investing in developing and releasing quality controls, source code and everything, not tied to the official Silverlight release. &lt;/p&gt;

&lt;p&gt;In a nutshell Blacklight’s control are among the best free
up to date silverlight controls out there. &lt;a href="http://mightymeaty.members.winisp.net/blacklight.silverlight/"&gt;You can check them out online here&lt;/a&gt;. The source code is available for download in the &lt;a href="http://www.codeplex.com/blacklight/"&gt;codeplex project site&lt;/a&gt;.
They make for good examples to learn control development in Silverlight.&lt;/p&gt;

&lt;p&gt;I’ve modified the &lt;b&gt;silverlight docking panel&lt;/b&gt; to support different docking layouts, you can download the twisted &lt;a href="http://weblogs.asp.net/blogs/gabriellopez/Blacklight.SilverlightRC0-DockPosition.zip"&gt;source code here&lt;/a&gt;. &lt;br&gt;&lt;/p&gt;

&lt;p&gt;By the way if you know of any other good Silverlight control
suite let me know.&lt;/p&gt;

&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6667317" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/silverlight/default.aspx" /></entry><entry><title>The young history of our industry</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/07/28/the-young-history-of-our-industry.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/07/28/the-young-history-of-our-industry.aspx</id><published>2008-07-28T04:51:32Z</published><updated>2008-07-28T04:51:32Z</updated><content type="html">&lt;p&gt;My engineering career didn't provide any formal insight into the history and timeline of events that led to were software, and software companies are today. I never had a history of software subject, but I remember enjoying when some teacher would go out topic into historical anecdotes about when a technology appeared. 
&lt;/p&gt;&lt;p&gt;That's why I bought &lt;a href="http://www.amazon.com/Airline-Reservations-Sonic-Hedgehog-Computing/dp/026253262X"&gt;From Airline Reservations to Sonic the Hedgedog: A history of the software industry&lt;/a&gt;. Yeah a history book with a long title about the IT Industry, but it turned out to be really good reading.
&lt;/p&gt;&lt;p&gt;It follows a business perspective, that might be a bit dense at times, but it's worth it. It starts with military software projects in the fifties, sage, sabre, fortran, cobol, and goes on until middle of the nineties. It covers software contractors, corporate business software, as well as retail mass market products, including a chapter dedicated to the video game industry.
&lt;/p&gt;&lt;p&gt;It's good to learn how software companies and products were born and died, what were the strategies, revenues and historical contexts for the companies that shaped today's software industry landscape.   &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6452602" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author></entry><entry><title>MOSS Search Tunning algorithm</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/07/16/moss-search-tunning-algorithm.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/07/16/moss-search-tunning-algorithm.aspx</id><published>2008-07-16T16:17:10Z</published><updated>2008-07-16T16:17:10Z</updated><content type="html">&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;&lt;span style="color:blue"&gt;if&lt;/span&gt; (!Customer.IsHappyWithSearchResultsRelevance)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;{
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://technet.microsoft.com/en-us/library/cc262541(TechNet.10).aspx"&gt;Enable search query logging&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://technet.microsoft.com/en-us/library/cc262796(TechNet.10).aspx"&gt;Configure Authoritative Pages&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://blogs.msdn.com/hodgblog/archive/2007/01/29/moss-search-result-removal.aspx"&gt;Remove undesired result pages&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://blah.winsmarts.com/2007-5-MOSS_2007_Trick_-_Search_Scopes_+_Managed_Properties__Tasty_Dish.aspx"&gt;Configure Search Scopes&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://blogs.msdn.com/miketag/archive/2007/07/16/reasons-for-a-full-crawl.aspx"&gt;Schedule full &amp;amp; incremental crawls&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;    
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:green"&gt;//[http://&amp;lt;MOSSURL&amp;gt;/ssp/admin/_layouts/SpUsageSspSearchResults.aspx]&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:blue"&gt;foreach&lt;/span&gt;(Keyword k &lt;span style="color:blue"&gt;in&lt;/span&gt; Top Queries With Low ClickThrough&lt;span style="color:green"&gt;) 
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://office.microsoft.com/en-us/sharepointserver/HA011605771033.aspx"&gt;Add keywords, synonyms and best bets&lt;/a&gt;(k)&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    }            
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://msdn.microsoft.com/en-us/library/bb219479.aspx"&gt;Develop Custom Search Webpart with Custom SQL Syntax&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:green"&gt;//handle with care, black magic involved, time space search continum in jeopardy
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;a href="http://www.codeplex.com/searchrelevancy"&gt;Change property weights with relevancy tool&lt;/a&gt;&lt;span style="color:green"&gt;
			&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
 &lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:blue"&gt;if&lt;/span&gt;(Customer.StillUnhappy) {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;
			&lt;span style="color:blue"&gt;return&lt;/span&gt;
			&lt;a href="http://www.fastsearch.com/"&gt;Call the cavalry&lt;/a&gt; || WaitUntil_MOSS_2009() &lt;span style="color:green"&gt;//busy wating?
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;    }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family:Courier New; font-size:10pt"&gt;}&lt;/span&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6407241" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="SharePoint" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/SharePoint/default.aspx" /><category term="search" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/search/default.aspx" /></entry><entry><title>eBanking meets RIA</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/27/ebanking-meets-ria.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/27/ebanking-meets-ria.aspx</id><published>2008-06-27T04:11:00Z</published><updated>2008-06-27T04:11:00Z</updated><content type="html">So we said to ourselves, all internet banking applications look pretty much the same, despite there are some new toys in town like &lt;b&gt;Silveright&lt;/b&gt;, and AJAX. What would be the result of applying &lt;b&gt;Rich Internet Application&lt;/b&gt; technologies to our &lt;b&gt;internet banking&lt;/b&gt; platform?&lt;br&gt;&lt;br&gt;

This was the result back in January,
&lt;br&gt;&lt;br&gt;
&lt;object width="425" height="344"&gt;
&lt;param name="movie" value="http://www.youtube.com/v/Q5Gixj31xF4&amp;amp;hl=en"&gt;
&lt;embed src="http://www.youtube.com/v/Q5Gixj31xF4&amp;amp;hl=en" mce_src="http://www.youtube.com/v/Q5Gixj31xF4&amp;amp;hl=en" type="application/x-shockwave-flash" width="425" height="344"&gt;&lt;/object&gt;
&lt;br&gt;&lt;br&gt;
Now where are back again working on a new, improved version.&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6325720" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/silverlight/default.aspx" /><category term="internet banking" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/internet+banking/default.aspx" /><category term="financial services" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/financial+services/default.aspx" /></entry><entry><title>Office Seat Map webpart</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/27/office-seat-map-webpart.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/27/office-seat-map-webpart.aspx</id><published>2008-06-27T02:57:00Z</published><updated>2008-06-27T02:57:00Z</updated><content type="html">
&lt;p&gt;In our efforts to make the most of our intranet, and the SharePoint intranets projects we deliver, I'm developing a &lt;b&gt;Silverlight&lt;/b&gt; based, &lt;b&gt;Office Map webpart&lt;/b&gt;. I like to think of it as a Google Maps, or Virtual Earth, for the enterprise cubicles.  
&lt;/p&gt;

&lt;p&gt;It's fairly simple stuff right now, I'm querying contact information from the MOSS User Profiles store and I'm displaying it associated to a x,y pair of coordinates on top of an office map image, Silverlight is just perfect for this kind of stuff. Profiles positioning is a drag and drop task carried out by and admin.
&lt;/p&gt;

&lt;p&gt;This is what it looks like now,
&lt;/p&gt;

&lt;p align="center"&gt;&amp;nbsp;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/seatmap.png" title="office seat map webpart" alt="office seat map webpart" mce_src="http://weblogs.asp.net/blogs/gabriellopez/seatmap.png" width="400" height="272"&gt;&lt;/p&gt;

&lt;p&gt;Some scenarios I think a tool like this could come in handy are:
&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mapping names to faces, and viceversa (what was the name again of the new guy seated over there?)
&lt;/li&gt;

&lt;li&gt;Geo querying workmates basic contact information (phone, email, mobile)
&lt;/li&gt;

&lt;li&gt;Locating resources, printers, shredders in the office (ok, I've just sent ten copies to HP LaserJet 3320, now where the heck is that printer?)
&lt;/li&gt;

&lt;li&gt;Management Office space, and seat assignment planning. Designing and sharing possible seat layouts.
&lt;/li&gt;

&lt;li&gt;Communicating seat assignments highlighting only those who've been moved 
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It'd be cool to integrate it to a map provider like Virtual Earth, zooming in from the world map to the office building, into the seat map.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6325469" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="SharePoint" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/SharePoint/default.aspx" /><category term="silverlight" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/silverlight/default.aspx" /><category term="enterprise 2.0" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/enterprise+2.0/default.aspx" /><category term="intranet" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/intranet/default.aspx" /></entry><entry><title>Silverlight 2 Beta 2 is out there, but hold on...</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/08/silverlight-2-beta-2-is-out-there-but-hold-on.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/08/silverlight-2-beta-2-is-out-there-but-hold-on.aspx</id><published>2008-06-08T17:10:00Z</published><updated>2008-06-08T17:10:00Z</updated><content type="html">&lt;p&gt;As &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx"&gt;Scott Guthrie posted&lt;/a&gt;, there's a new release available of Silverlight 2, it's &lt;b&gt;beta version 2&lt;/b&gt; now this time, and we are getting closer to the release.I've upgraded to the new version, and here's a quick review of the pros and cons,&lt;br&gt; &lt;/p&gt;&lt;p&gt;&lt;b&gt;The Pros&lt;/b&gt;,&lt;/p&gt;&lt;ul&gt;&lt;li&gt;It has &lt;b&gt;go live&lt;/b&gt; license, meaning you can take it to production and you'll get support&lt;/li&gt;&lt;li&gt;There's a new Expression Blend preview, compatible with the VS2008 SP1 beta&lt;/li&gt;&lt;li&gt;It has several enhancements in the control template editing support, for out of the box controls&lt;br&gt;&lt;/li&gt;&lt;li&gt;A new feature called Visual State Manager which enables customization of controls look&amp;amp;feel in specific states, like checked, unchecked, pressed, visited and the transitions animations between states&lt;/li&gt;&lt;li&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx" mce_href="http://weblogs.asp.net/scottgu/archive/2008/06/06/silverlight-2-beta2-released.aspx"&gt;Check scott's entry for the full list and explanation&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;b&gt;The Cons&lt;/b&gt;,&lt;br&gt;&lt;ul&gt;&lt;li&gt; Clients upgraded to beta 2 won't be able to run beta 1 apps,&amp;nbsp; so if you have a bunch of silverlight applications it's an all or none upgrade decision.&lt;/li&gt;&lt;li&gt;&lt;b&gt;It's buggy in the WCF service reference wizard&lt;/b&gt;, you may want to check &lt;a href="http://silverlight.net/forums/t/17500.aspx" mce_href="http://silverlight.net/forums/t/17500.aspx"&gt;this forum thread&lt;/a&gt;. You get some very annoying &lt;b&gt;Unable to find service 'DynamicTypeService'&lt;/b&gt; messages, plus some object reference not set to an instance of an object when trying to add a new reference. This for me has been a low blow, since I may have to rewrite all the communication logic, or wait for a fix :(&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;I'll keep you in the loop,&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6257642" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/silverlight/default.aspx" /><category term="WCF" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/WCF/default.aspx" /></entry><entry><title>The state of the art in code quality metrics</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/07/the-state-of-the-art-in-code-quality-metrics.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/07/the-state-of-the-art-in-code-quality-metrics.aspx</id><published>2008-06-07T17:23:00Z</published><updated>2008-06-07T17:23:00Z</updated><content type="html">&lt;p&gt;&lt;img src="http://blog.pengoworks.com/enclosures/wtfm_cf7237e5-a580-4e22-a42a-f8597dd6c60b.jpg" mce_src="http://blog.pengoworks.com/enclosures/wtfm_cf7237e5-a580-4e22-a42a-f8597dd6c60b.jpg" height="471" width="500"&gt;&lt;/p&gt;&lt;p&gt;Any coincidence with reality is on your account&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6255937" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author></entry><entry><title>SOA Governance</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/02/soa-governance.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/02/soa-governance.aspx</id><published>2008-06-02T17:08:08Z</published><updated>2008-06-02T17:08:08Z</updated><content type="html">&lt;p&gt;&lt;strong&gt;SOA Governance&lt;/strong&gt;, a term that's taking off but's not always easy to pick up. &lt;a href="http://www.ibm.com/developerworks/webservices/library/ar-servgov/?S_TACT=105AGX04&amp;amp;S_CMP=ART"&gt;Here's a good article from IBM that introduces it&lt;/a&gt;, explaining what would happen if there is no SOA Governance in the enterprise.
&lt;/p&gt;&lt;p&gt;&lt;em&gt;"Service-Oriented Architecture (SOA) is a compelling technique for developing software applications that best align with business models. However, SOA increases the level of cooperation and coordination required between business and information technology (IT), as well as among IT departments and teams. This cooperation and coordination is provided by SOA governance, which covers the tasks and processes for specifying and managing how services and SOA applications are supported."&lt;/em&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6242454" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author></entry><entry><title>How to develop a casual game with Silverlight 2</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/gabriellopez/archive/2008/06/01/how-to-develop-a-casual-game-with-silverlight-2.aspx" /><id>http://weblogs.asp.net/gabriellopez/archive/2008/06/01/how-to-develop-a-casual-game-with-silverlight-2.aspx</id><published>2008-06-01T20:55:00Z</published><updated>2008-06-01T20:55:00Z</updated><content type="html">&lt;p&gt;Game programming was my first love in computer science, and a couple of weeks ago I decided to give it a try with the new Silverlight 2 version available. To my surprise I could accomplish something fun with little effort, and maybe there's someone out there trying to do stuff like this, so let's go through the basics of building a casual game with silverlight 2. Our target will be to develop a mutant version of the old &lt;a href="http://en.wikipedia.org/wiki/Breakout" mce_href="http://en.wikipedia.org/wiki/Breakout"&gt;breakout&lt;/a&gt; classic. We are going to animate a paddle to prevent a ball from touching the ground while breaking bricks on top of each screen.
&lt;/p&gt;&lt;p&gt;Assuming you have a Visual Studio 2008 installation, with the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e0bae58e-9c0b-4090-a1db-f134d9f095fd&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=e0bae58e-9c0b-4090-a1db-f134d9f095fd&amp;amp;displaylang=en"&gt;Silverlight Tools for VS2008&lt;/a&gt; loaded, let's start by creating a Silverlight Application Project. 
&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;table style="border-collapse: collapse;" border="0"&gt;&lt;colgroup&gt;&lt;col style="width: 319px;"&gt;&lt;col style="width: 319px;"&gt;&lt;/colgroup&gt;&lt;tbody valign="top"&gt;&lt;tr&gt;&lt;td style="padding-left: 7px; padding-right: 7px;"&gt;&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/silverlightapp.png" title="silverlight visual studio" alt="silverlight visual studio" mce_src="http://weblogs.asp.net/blogs/gabriellopez/silverlightapp.png" height="200" width="300"&gt;&lt;br&gt;&lt;/p&gt;&lt;/td&gt;&lt;td style="padding-left: 7px; padding-right: 7px;"&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/silverlightapp2.png" title="silverlight visual studio web app" alt="silverlight visual studio web app" mce_src="http://weblogs.asp.net/blogs/gabriellopez/silverlightapp2.png" height="155" width="210"&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;First we are going to modify the Page.xaml created page, to include all the elements our simple game will have, being those: 
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;a paddle, 
&lt;/li&gt;&lt;li&gt;a ball, 
&lt;/li&gt;&lt;li&gt;some bricks to destroy
&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Let's start by changing the default Grid layout, to use instead a Canvas layout, with some rectangles in it. Use the following xaml code:
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New;"&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
				&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Canvas&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="GameCanvas"&lt;/span&gt;&lt;span style="color: red;"&gt; Background&lt;/span&gt;&lt;/span&gt;&lt;span style="color: blue;"&gt;&lt;span style="font-size: 8pt;"&gt;="LightGray" &lt;/span&gt;&lt;span style="font-size: 3pt;"&gt;
				&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: red;"&gt;Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="400" &lt;/span&gt;&lt;span style="color: red;"&gt;Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="300"&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
			&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="paddle"&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Black"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="60"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="10"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Top&lt;/span&gt;&lt;span style="color: blue;"&gt;="280"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Left&lt;/span&gt;&lt;span style="color: blue;"&gt;="180"/&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
			&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="ball"&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Black"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="10"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="10"&lt;/span&gt;&lt;span style="color: red;"&gt; RadiusX&lt;/span&gt;&lt;span style="color: blue;"&gt;="5"&lt;/span&gt;&lt;span style="color: red;"&gt; RadiusY&lt;/span&gt;&lt;span style="color: blue;"&gt;="5"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Left&lt;/span&gt;&lt;span style="color: blue;"&gt;="200"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Top&lt;/span&gt;&lt;span style="color: blue;"&gt;="250"/&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
			&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="Brick1"&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Red"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="40"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="15"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Left&lt;/span&gt;&lt;span style="color: blue;"&gt;="120"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Top&lt;/span&gt;&lt;span style="color: blue;"&gt;="50"/&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
			&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="Brick2"&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Blue"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="40"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="15"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Left&lt;/span&gt;&lt;span style="color: blue;"&gt;="180"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Top&lt;/span&gt;&lt;span style="color: blue;"&gt;="50"/&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;
			&lt;/span&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Rectangle&lt;/span&gt;&lt;span style="color: red;"&gt; x&lt;/span&gt;&lt;span style="color: blue;"&gt;:&lt;/span&gt;&lt;span style="color: red;"&gt;Name&lt;/span&gt;&lt;span style="color: blue;"&gt;="Brick3"&lt;/span&gt;&lt;span style="color: red;"&gt; Fill&lt;/span&gt;&lt;span style="color: blue;"&gt;="Green"&lt;/span&gt;&lt;span style="color: red;"&gt; Width&lt;/span&gt;&lt;span style="color: blue;"&gt;="40"&lt;/span&gt;&lt;span style="color: red;"&gt; Height&lt;/span&gt;&lt;span style="color: blue;"&gt;="15"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Left&lt;/span&gt;&lt;span style="color: blue;"&gt;="240"&lt;/span&gt;&lt;span style="color: red;"&gt; Canvas.Top&lt;/span&gt;&lt;span style="color: blue;"&gt;="50"/&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: rgb(163, 21, 21); font-family: Courier New;"&gt;
			&lt;/span&gt;&lt;span style="color: blue; font-family: Courier New;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21); font-family: Courier New;"&gt;Canvas&lt;/span&gt;&lt;span style="color: blue; font-family: Courier New;"&gt;&amp;gt;&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You should be able to see something like this in the updated design preview,&lt;/p&gt;&lt;p&gt;&lt;img src="http://weblogs.asp.net/blogs/gabriellopez/preview.png" title="silverlight casual game breakout" alt="silverlight casual game breakout" mce_src="http://weblogs.asp.net/blogs/gabriellopez/preview.png" align="middle" height="300" width="399"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="text-align: center;"&gt;
	&lt;/p&gt;&lt;h2&gt;Animating the paddle
&lt;/h2&gt;&lt;p&gt;To animate the paddle we are going to add an event handler for the KeyDown event, in the Canvas element of the Page user control. When doing this we'll come across a beta bug, adding the Canvas KeyDown event handler in the xaml doesn't work (at least, not for me), but if I register the event handler in the code behind it works.
&lt;/p&gt;&lt;p style="text-align: center;"&gt;
	&lt;/p&gt;&lt;p&gt;So far, my code looks something like the following code block, and after build you should be able to happily move your paddle left and right ways.
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;public&lt;/span&gt; Page()
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;            &amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this&lt;/span&gt;.KeyDown += &lt;span style="color: blue;"&gt;new&lt;/span&gt;
			&lt;span style="color: rgb(43, 145, 175);"&gt;KeyEventHandler&lt;/span&gt;(GameCanvas_KeyDown);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;        }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;private&lt;/span&gt;
			&lt;span style="color: blue;"&gt;void&lt;/span&gt; GameCanvas_KeyDown(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43, 145, 175);"&gt;KeyEventArgs&lt;/span&gt; e)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; currentX = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)paddle.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; newX = 0;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (e.Key.Equals(&lt;span style="color: rgb(43, 145, 175);"&gt;Key&lt;/span&gt;.Left)) 
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; newX = currentX - 5;                                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (newX &amp;lt; 0)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; newX = 0;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt;
			&lt;span style="color: blue;"&gt;if&lt;/span&gt; (e.Key.Equals(&lt;span style="color: rgb(43, 145, 175);"&gt;Key&lt;/span&gt;.Right))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;            &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; newX = currentX + 5;                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; ((newX + paddle.Width) &amp;gt; GameCanvas.Width)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; newX = GameCanvas.Width - paddle.Width;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; paddle.SetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty, newX);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 9pt;"&gt;        }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;But there's still not much fun involved, everything still is pretty static, so let's animate the ball now.
&lt;/p&gt;&lt;h2&gt;Animating the ball
&lt;/h2&gt;&lt;p&gt;In Silverlight there might be a better way to do this with storyboards, but I'm going to go old school on this one and use a timer, and increment the ball coordinates with a vector. 
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New;"&gt;        System.Threading.&lt;span style="color: rgb(43, 145, 175);"&gt;Timer&lt;/span&gt; tick;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New;"&gt;
			&lt;span style="color: blue;"&gt;double&lt;/span&gt; vectorY = 10;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New;"&gt;
			&lt;span style="color: blue;"&gt;double&lt;/span&gt; vectorX = 10;&lt;/span&gt;
	&lt;/p&gt;&lt;p&gt;In the code of a new GotFocus handler for the Canvas element, we are going to set the timer. The timer invokes the OnTick handler on wake  up, which in turn uses the beautiful Dispatcher.BeginInvoke(()=&amp;gt;UpdateBallPosition()) lambda expression to execute code in the UI thread, and be able to access safely all the UI elements in the canvas, and calculate the new coordinates of the ball and update them.
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;private&lt;/span&gt;
			&lt;span style="color: blue;"&gt;void&lt;/span&gt; OnGotFocus(&lt;span style="color: blue;"&gt;object&lt;/span&gt; source, &lt;span style="color: rgb(43, 145, 175);"&gt;EventArgs&lt;/span&gt; args)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tick = &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.Threading.&lt;span style="color: rgb(43, 145, 175);"&gt;Timer&lt;/span&gt;(OnTick, &lt;span style="color: blue;"&gt;null&lt;/span&gt;, 1000, 100);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;        }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;void&lt;/span&gt; OnTick(&lt;span style="color: blue;"&gt;object&lt;/span&gt; sender)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this&lt;/span&gt;.Dispatcher.BeginInvoke(() =&amp;gt; UpdateBallPosition());
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;        }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;void&lt;/span&gt; UpdateBallPosition()
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;        {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; x = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)ball.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; y = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)ball.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.TopProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; paddleX = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)paddle.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; paddleY = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)paddle.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.TopProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; maxX = GameCanvas.Width;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; double&lt;/span&gt; maxY = GameCanvas.Height;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; x += vectorX;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; y += vectorY;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/span&gt; collision detection
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/span&gt; outer boundaries
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (x &amp;lt;= 0 || x &amp;gt;= (maxX - ball.Width))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; vectorX = -(vectorX);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; x = (x &amp;lt;= 0) ? 0 : x;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; x = x &amp;gt;= (maxX - ball.Width) ? (maxX - ball.Width) : x;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool&lt;/span&gt; paddleHit = ((y + ball.Height) &amp;gt;= paddleY &amp;amp;&amp;amp; x &amp;gt;= paddleX &amp;amp;&amp;amp; x &amp;lt;= (paddleX + paddle.Width));
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt; (y &amp;lt;= 0 || y &amp;gt;= (maxY - ball.Height) || paddleHit)
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; vectorY = -(vectorY);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; y = (y &amp;lt;= 0) ? 0 : y;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; y = y &amp;gt;= (maxY - ball.Height) ? (maxY - ball.Height) : y;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: blue; font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: blue; font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ball.SetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.TopProperty, y);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ball.SetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty, x);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="font-family: Courier New;"&gt;        }&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Then we add code like the following to enable collision detection with the bricks, 
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&lt;span style="color: blue;"&gt;            #region&lt;/span&gt; collision detection blocks
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;double&lt;/span&gt; blockY = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)Brick1.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.TopProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;double&lt;/span&gt; blockX = (&lt;span style="color: blue;"&gt;double&lt;/span&gt;)Brick1.GetValue(&lt;span style="color: rgb(43, 145, 175);"&gt;Canvas&lt;/span&gt;.LeftProperty);
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: blue;"&gt;if&lt;/span&gt; (y &amp;gt;= blockY &amp;amp;&amp;amp; y &amp;lt;= (blockY + Brick1.Height) &amp;amp;&amp;amp; x &amp;gt;= blockX &amp;amp;&amp;amp; x &amp;lt;= (blockX + Brick1.Width))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;            {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;
			&lt;span style="color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //block collision
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Brick1.Fill = &lt;span style="color: blue;"&gt;new&lt;/span&gt;
			&lt;span style="color: rgb(43, 145, 175);"&gt;SolidColorBrush&lt;/span&gt;(&lt;span style="color: rgb(43, 145, 175);"&gt;Colors&lt;/span&gt;.Yellow);                                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vectorY = -(vectorY);                
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 8pt;"&gt;            }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 8pt;"&gt;&lt;span style="color: blue; font-family: Courier New;"&gt;            #endregion&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This is just for one brick, you do your thing to generalize this code for all three bricks. 
&lt;/p&gt;&lt;p&gt;And of course, it wouldn't be a game if there's no way to loose or win, so we add logic to control win or lose conditions.
&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&lt;span style="color: blue;"&gt;            #region&lt;/span&gt; gameover and win conditions
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;
			&lt;span style="color: green;"&gt;//GAME OVER?
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;
			&lt;span style="color: blue;"&gt;if&lt;/span&gt; (y &amp;gt;= (maxY - ball.Height))
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;            {
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;
			&lt;span style="color: green;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //game over 
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tick.Dispose();                             
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;
			&lt;span style="color: blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return&lt;/span&gt;;
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-family: Courier New; font-size: 10pt;"&gt;            }
&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;span style="color: blue; font-family: Courier New;"&gt;            #endregion&lt;/span&gt;
		&lt;/span&gt;&lt;/p&gt;&lt;p&gt;This is just the lose condition, but I hope you get the idea. Next week we'll pimp up this solution to add score handling and sounds to this breakout mutant. The &lt;a href="http://weblogs.asp.net/blogs/gabriellopez/BreakoutMutant.zip" title="silverlight casual game sample" mce_href="http://weblogs.asp.net/blogs/gabriellopez/BreakoutMutant.zip"&gt;source code from the developed casual game sample can be downloaded from here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6240194" width="1" height="1"&gt;</content><author><name>gabouy</name><uri>http://weblogs.asp.net/members/gabouy.aspx</uri></author><category term="silverlight" scheme="http://weblogs.asp.net/gabriellopez/archive/tags/silverlight/default.aspx" /></entry></feed>