<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://www.wintellect.com/cs/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Jeff Prosise's Blog</title><subtitle type="html" /><id>http://www.wintellect.com/cs/blogs/jprosise/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.wintellect.com/cs/blogs/jprosise/atom.aspx" /><generator uri="http://communityserver.org" version="2.1.61129.2">Community Server</generator><updated>2008-02-06T18:33:00Z</updated><entry><title>Silverlight Page Turning Made Simple</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/05/04/silverlight-page-turning-made-simple.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/05/04/silverlight-page-turning-made-simple.aspx</id><published>2008-05-05T00:26:00Z</published><updated>2008-05-05T00:26:00Z</updated><content type="html">&lt;P&gt;My latest &lt;A class="" title="Silverlight Page Turning Made Simple" href="http://msdn.microsoft.com/en-us/magazine/cc507644.aspx" target=_blank&gt;Wicked Code column&lt;/A&gt; is now online at MSDN Magazine. Titled "Silverlight Page Turning Made Simple," it presents a Silverlight 1.0 framework for building slick page-turning applications. I mentioned the framework in an &lt;A class="" title="Silverlight, SOHACHTOA, and Me" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/02/15/silverlight-sohcahtoa-and-me.aspx" target=_blank&gt;earlier blog post&lt;/A&gt; but didn't publish the source code because it needed to appear in MSDN Magazine first. Now you can download it, use it, and modify it to your heart's content.&lt;/P&gt;
&lt;P&gt;And yes, I'll port the framework to Silverlight 2.0 soon.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=6169" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>My Beef with Vista and IE</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/05/04/my-beef-with-vista-and-ie.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/05/04/my-beef-with-vista-and-ie.aspx</id><published>2008-05-04T23:33:00Z</published><updated>2008-05-04T23:33:00Z</updated><content type="html">&lt;P&gt;I have largely avoided problems with Vista by only running it on PCs on which it comes preinstalled. At least I avoided problems until a few weeks ago. With a total of five PCs and laptops now running Vista in my house, the constant avalanche of automatic updates seems to break something every day. The latest issue I’m fighting is one that causes ASP.NET apps launched in IE 7 from Visual Studio 2008 to sometimes start with JavaScript disabled. It’s pretty hard to teach an ASP.NET class when LinkButtons don’t work.&lt;/P&gt;
&lt;P&gt;But worse than having ASP.NET broken on my development box is what IE 7 has done to the PC in the kitchen. For more than 20 years my wife has used my hand-me-down PCs. Last week I bought her her first-ever new PC:&amp;nbsp; a Dell quad-core with 3 GB of RAM, a 500 MB hard disk, a 20-inch LCD monitor, and Vista Home Premium. (For the first time ever, I’m envious of her PC!) At first I was a little hot when Vista didn’t support my trusty USB wireless network adapter, but $70 and a new adapter later, Vista was happy and so was I.&lt;/P&gt;
&lt;P&gt;The smiles didn’t last long. My wife fired up IE 7 on her new computer and went to our high school’s parent portal to check my son’s math grade. IE, however, wouldn’t let her get past the login page; it kept insisting “Internet Explorer cannot display the webpage.” She asked if this was another Vista problem. I knowingly assured her it wasn’t, and informed her that she had been running IE 7 on XP for a long time. Just to make sure, I downloaded the latest version of Firefox and went to the parent portal. Much to my surprise, Firefox let me log in and view grades just fine! I spent the next couple of hours toggling settings in IE 7 trying to get past the problem, and a couple of hours after that doing Web searches and analyzing HTTP traffic to find out why IE 7 couldn’t display a page that Firefox had no problem with. (It has something to do with “302 Temporarily Moved” responses coming back over SSL/TLS, but that’s as far as I’ve gotten with it.)&lt;/P&gt;
&lt;P&gt;My wife can still check our son’s grades with IE 7 on her old XP PC. She can check grades with Firefox on her new Vista quad-core. But she can’t use IE 7 to check grades on Vista. She’s confused, and so am I.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=6165" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Control Interop, Silverlight-Style</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/12/control-interop-silverlight-style.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/12/control-interop-silverlight-style.aspx</id><published>2008-04-12T04:16:00Z</published><updated>2008-04-12T04:16:00Z</updated><content type="html">&lt;P&gt;A number of people have asked me in recent weeks whether two Silverlight 2 controls hosted in the same page can communicate with each other, and if so, how. I tell them they need to build a JavaScript bridge between the controls and then the controls can talk to each other just fine.&lt;/P&gt;
&lt;P&gt;Tonight I built a sample app to demonstrate. Here's what it looks like:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Control Interop Demo" style="WIDTH:466px;HEIGHT:480px;" height=480 alt="Control Interop Demo" src="http://www.wintellect.com/cs/photos/prosise/images/5848/466x480.aspx" width=466&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You drag the red ball in the upper rectangle and the blue rectangle in the lower rectangle mirrors the red ball's moves. The interesting aspect of this application is that each rectangle represents a different Silverlight control instance. In other words, the page hosts two Silverlight controls, and the red ball lives in one control while the blue ball lives in the other.&lt;/P&gt;
&lt;P&gt;Here are the OBJECT tags used to instantiate two Silverlight controls:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="silverlightControlHost1"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;object&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="data:application/x-silverlight,"&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="application/x-silverlight-2-b1"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;width&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="400"&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;height&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="300"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="SourceControl"&amp;gt;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="source"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="ClientBin/InteropDemo.xap"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="onerror"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="onSilverlightError"&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="background"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="white"&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;object&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="SilverlightControlHost2"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;object&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="data:application/x-silverlight,"&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;type&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="application/x-silverlight-2-b1"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;width&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="400"&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;height&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="300"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;id&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="TargetControl"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="source"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="ClientBin/OtherControl.xap"/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="onerror"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="onSilverlightError"&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;param&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:red;"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="background"&lt;/SPAN&gt; &lt;SPAN style="COLOR:red;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="white"&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;object&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;div&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;Each control has its own DIV, and each loads a different XAP file. How did I get Visual Studio to build two XAP files, each containing a separate control assembly? I just added a&amp;nbsp;second Silverlight Application project to the solution. If you already have a Web project in the solution, Visual Studio asks if you want the new project linked to the existing Web project:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Add Project Dialog" style="WIDTH:443px;HEIGHT:375px;" height=375 alt="Add Project Dialog" src="http://www.wintellect.com/cs/photos/prosise/images/5849/443x375.aspx" width=443&gt;&lt;/P&gt;
&lt;P&gt;Visual Studio obligingly adds the Silverlight project to the solution and configures the build settings so that building the project creates a second XAP file that, like the XAP file from the first project, is copied into the Web site's ClientBin directory.&lt;/P&gt;
&lt;P&gt;To link&amp;nbsp;the two Silverlight controls together, I began by converting the code-behind class for the second control (the one containing the blue ball) into a scriptable class and adding a scriptable method named MoveBall:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;ScriptableType&lt;/SPAN&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Page&lt;/SPAN&gt; : &lt;SPAN style="COLOR:#2b91af;"&gt;UserControl&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; Page()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#2b91af;"&gt;HtmlPage&lt;/SPAN&gt;.RegisterScriptableObject(&lt;SPAN style="COLOR:#a31515;"&gt;"other"&lt;/SPAN&gt;, &lt;SPAN style="COLOR:blue;"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;ScriptableMember&lt;/SPAN&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; MoveBall(&lt;SPAN style="COLOR:blue;"&gt;double&lt;/SPAN&gt; x, &lt;SPAN style="COLOR:blue;"&gt;double&lt;/SPAN&gt; y)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Ball.SetValue(&lt;SPAN style="COLOR:#2b91af;"&gt;Canvas&lt;/SPAN&gt;.LeftProperty, x);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Ball.SetValue(&lt;SPAN style="COLOR:#2b91af;"&gt;Canvas&lt;/SPAN&gt;.TopProperty, y);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;Then I added the following JavaScript function (the "bridge") to the HTML page:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; _target = &lt;SPAN style="COLOR:blue;"&gt;null&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;function&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; moveBall(x, y)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (_target == &lt;SPAN style="COLOR:blue;"&gt;null&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_target = document.getElementById(&lt;SPAN style="COLOR:#a31515;"&gt;'TargetControl'&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;_target.content.other.MoveBall(x, y);&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Finally, I added the following statement to the MouseMove handler in the first control (the one with the red ball):&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;HtmlPage&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;.Window.Invoke(&lt;SPAN style="COLOR:#a31515;"&gt;"moveBall"&lt;/SPAN&gt;, x, y);&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;LINE-HEIGHT:115%;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The X and Y coordinates passed in represent the current position of the red ball--the position I just moved it to in response to the latest mouse move.&lt;/P&gt;
&lt;P&gt;See how it works? You move the red ball. The MouseMove handler that moves the ball also calls the JavaScript moveBall function, which in turn calls the second control's MoveBall method. The red ball moves and the blue ball moves, too. This sample takes advantage of Silverlight 2's rich DOM integration features which allow C# methods to call JavaScript functions, JavaScript functions to call C# methods, and a whole lot more.&lt;/P&gt;
&lt;P&gt;I'll&amp;nbsp;post the source code this weekend. For now, it has been a long week, it's late, and I'll be locked away in a hotel all weekend building slides for my &lt;A class="" title="Silverlight Precon" href="https://www.msteched.com/dev/public/precons.aspx" target=_blank&gt;Silverlight precon&lt;/A&gt; at TechEd and taking care of other jobs that have piled up in my to-do list. Time to get some sleep.&lt;/P&gt;
&lt;P&gt;&lt;U&gt;UPDATE&lt;/U&gt;: The source code has been posted and you can &lt;A class="" title="Interop Demo Source Code" href="http://www.wintellect.com/Downloads/SilverlightInterop.zip"&gt;download it here&lt;/A&gt;. In addition, I posted a new version of SilverLife that uses DispatcherTimer rather a Storyboard to drive cell animations. You can &lt;A class="" title="SilverLife Source Code" href="http://www.wintellect.com/Downloads/SilverLife_2.0.zip"&gt;download the new version here&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5850" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Reading XAML from a Silverlight Application Assembly</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/08/reading-xaml-from-a-silverlight-application-assembly.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/08/reading-xaml-from-a-silverlight-application-assembly.aspx</id><published>2008-04-08T04:54:00Z</published><updated>2008-04-08T04:54:00Z</updated><content type="html">&lt;P&gt;I was having dinner with &lt;A class="" title="WPF Wonderland" href="http://wpfwonderland.wordpress.com/" target=_blank&gt;Walt Ritscher&lt;/A&gt; tonight&amp;nbsp;when he posed an interesting question: how can a Silverlight app load its own XAML from an application assembly?&lt;/P&gt;
&lt;P&gt;I thought I knew the answer, because I had just finished doing a lot of research into the various ways to package code and resources in Silverlight 2.0. And I knew that the XAML files in a Silverlight 2.0 app get embedded as resources in the application assembly, which in turn gets embedded in the application package (the application's XAP file). But when I got back to my hotel and tried it, it didn't work. So I played around some and found the secret incantation.&lt;/P&gt;
&lt;P&gt;Here's the Page.xaml file in the test app that I wrote:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;UserControl&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;="SilverlightTestApp.Page"&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="http://schemas.microsoft.com/client/2007"&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/SPAN&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&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;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;="LayoutRoot"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; Background&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;="White"&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;TextBlock&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;="Output" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;UserControl&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;And here's the output from the program:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="XAML Output" style="WIDTH:500px;HEIGHT:285px;" height=285 alt="XAML Output" src="http://www.wintellect.com/cs/photos/prosise/images/5820/500x285.aspx" width=500&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, here's the code in Page.xaml.cs that produces the output by loading Page.xaml from the application assembly and assigning it to a TextBlock object:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;StreamResourceInfo&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; sri = &lt;SPAN style="COLOR:#2b91af;"&gt;Application&lt;/SPAN&gt;.GetResourceStream&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;(&lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Uri&lt;/SPAN&gt;(&lt;SPAN style="COLOR:#a31515;"&gt;"SilverlightTestApp;component/Page.xaml"&lt;/SPAN&gt;, &lt;SPAN style="COLOR:#2b91af;"&gt;UriKind&lt;/SPAN&gt;.Relative));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;StreamReader&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; reader = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;StreamReader&lt;/SPAN&gt;(sri.Stream);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Output.Text = reader.ReadToEnd();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The trick is to include "&lt;EM&gt;assemblyname&lt;/EM&gt;;component" in the URI passed to GetResourceStream, even though the assembly you're loading from is the application assembly and not a library assembly. Normally you don't have to include the assembly name if you're targeting the application assembly, but this is obviously an exception--at least in Beta 1.&lt;/P&gt;
&lt;P&gt;I don't know how useful this information is, but it ought to make a good icebreaker at a Silverlight party.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5821" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Silverlight Deep Zoom</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/01/silverlight-deep-zoom.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/04/01/silverlight-deep-zoom.aspx</id><published>2008-04-01T22:25:00Z</published><updated>2008-04-01T22:25:00Z</updated><content type="html">&lt;P&gt;Like a lot of folks, I was pretty impressed the first time I saw Silverlight 2.0's new Deep Zoom feature at work. So I downloaded &lt;A class="" title="Deep Zoom Composer" href="http://blogs.msdn.com/expression/archive/2008/03/05/download-the-preview-of-the-deep-zoom-composer.aspx" target=_blank&gt;Deep Zoom Composer&lt;/A&gt; and starting building apps to see what makes Deep Zoom tick. Deep Zoom Composer is cool, but what really makes Deep Zoom shine is the MultiScaleImage control. It is amazing how much you can do with so little code.&lt;/P&gt;
&lt;P&gt;I built an app that incorporates some of my favorite travel photos:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Deep Zoom" style="WIDTH:460px;HEIGHT:480px;" height=480 alt="Deep Zoom" src="http://www.wintellect.com/cs/photos/prosise/images/5763/460x480.aspx" width=460&gt;&lt;/P&gt;
&lt;P&gt;You can zoom in and out with the mousewheel or pan around by dragging with the left mouse button down. Some of the photos I used are higher-res than others, but in most of them you can zoom in enough to reveal quite a lot of detail.&lt;/P&gt;
&lt;P&gt;You can &lt;A class="" title="Deep Zoom Demo" href="http://www.wintellect.com/silverlight/deepzoom/" target=_blank&gt;view the app online&lt;/A&gt;,&amp;nbsp;and you can &lt;A class="" title="Deep Zoom Demo Source Code" href="http://www.wintellect.com/Downloads/DeepZoom.zip" target=_blank&gt;download the source code&lt;/A&gt;. The download doesn't include the images because&amp;nbsp;the images comprise more than 30 MB. But you can generate your own images and metadata with Deep Zoom Composer and plug them into my demo. All you have to do is copy the output folder created by&amp;nbsp;Composer into DeepZoom_Web's ClientBin folder and point the MultiScaleImage control declared in Page.xaml to the info.bin or items.bin file in the output folder. Then fire up the app and zoom away.&lt;/P&gt;
&lt;P&gt;When I exported from Deep Zoom Composer, I checked the "Create Collection" box to export a collection of images rather than one monolithic image. Although my code currently doesn't take advantage of it, exporting a collection allows you to use the SubImages property of the MultiScaleImage control to addess the individual images and even to change their position, aspect ratio, opacity, and Z-index. It appears (though I haven't tried it yet) that you can also change the zoom factor of individual images. Look for an updated demo in the near future that demonstrates some of these enticing capabilities.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5762" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Threading and Marshaling in Silverlight 2.0</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/26/threading-and-marshaling-in-silverlight-2-0.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/26/threading-and-marshaling-in-silverlight-2-0.aspx</id><published>2008-03-26T23:45:00Z</published><updated>2008-03-26T23:45:00Z</updated><content type="html">&lt;P&gt;Quick: can you spot what's wrong with this code?&lt;/P&gt;&lt;SPAN style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';"&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Thread&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; thread = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Thread&lt;/SPAN&gt;(&lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;ThreadStart&lt;/SPAN&gt;(RunClock));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;thread.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:9pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; RunClock()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;while&lt;/SPAN&gt; (&lt;SPAN style="COLOR:blue;"&gt;true&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Clock.Text = &lt;SPAN style="COLOR:#2b91af;"&gt;DateTime&lt;/SPAN&gt;.Now.ToLongTimeString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:Calibri;mso-ansi-language:EN-US;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;}&lt;/SPAN&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The intent is to launch a thread and have that thread run an infinite loop updating a XAML TextBlock object that shows the current time of day. Aside from the questionable design (there are much more efficient ways to keep a time-of-day display up to date), there's something seriously wrong with this code. In fact, if you run it you'll find that the time-of-day display never updates at all. And therein lies a story.&lt;/P&gt;
&lt;P&gt;I was&amp;nbsp;surprised last year when I saw that&amp;nbsp;the Silverlight 1.1 alpha had a System.Threading namespace complete with all the classes I needed to launch threads, synchronize threads, acquire threads from a thread pool, etc. Silverlight 2.0 Beta 1 contains all these classes and more. I'm still amazed that I can write multithreaded apps that run in a browser, and I've been doing a lot of that lately--not because I need to, but just because I can. Silverlight 2.0's BackgroundWorker class simplifies the process of running tasks on background threads, and DispatchTimer is a handy alternative to empty Storyboards for programmable game timers. But you don't have to use either of them; you can&amp;nbsp;use Thread.Start, ThreadPool.QueueUserWorkItem, asynchronous delegates, and other mechanisms familiar to .NET developers to relegate tasks&amp;nbsp;to background threads.&lt;/P&gt;
&lt;P&gt;There is one nuance to Silverlight threading that you should be aware of, however: controls and other XAML objects can only be updated by the UI thread (the main thread that drives a Silverlight app). The reason the attempt to set the TextBlock's Text property in the example above fails is that we're attempting to set it from a background thread. For the sample to work, you need to modify it as follows:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;delegate&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;UpdateUIDelegate&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:9pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;Thread&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; thread = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Thread&lt;/SPAN&gt;(&lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;ThreadStart&lt;/SPAN&gt;(RunClock));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;thread.Start();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:9pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;...&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; RunClock()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;UpdateUIDelegate&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; action = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;UpdateUIDelegate&lt;/SPAN&gt;(UpdateUI));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;while&lt;/SPAN&gt; (&lt;SPAN style="COLOR:blue;"&gt;true&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;Clock.Dispatcher.BeginInvoke(action);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:9pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; UpdateUI()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;Clock.Text = &lt;SPAN style="COLOR:#2b91af;"&gt;DateTime&lt;/SPAN&gt;.Now.ToLongTimeString();&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In the&amp;nbsp;corrected code, the background&amp;nbsp;thread marshals the call back to the UI thread by calling UpdateUI through a delegate invoked&amp;nbsp;via the&amp;nbsp;TextBlock object's Dispatcher property. Dispatcher is inherited from DependencyObject and is therefore present in all UI objects. For old folks like me who used to program Windows, this is analagous to using PostMessage to post a message to another thread. You don't have to use the Dispatcher property of the object you intend to update; you can use Dispatcher on any UI object to marshal the call to the UI thread.&lt;/P&gt;
&lt;P&gt;Programmers who have written multithreaded WPF apps won't be surprised by any of this because WPF also requires UI objects to be updated by UI threads. And of course there are ways to avoid using Dispatcher altogether.&amp;nbsp;The BackgroundWorker class, for example, fires events on UI threads, so there's no need to do any marshaling before updating a UI object. But there are times in Silverlight when you simply can't avoid marshaling from a background thread to a UI thread, and when those circumstances arise, it's useful to know about Dispatcher.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5728" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Mousewheel Zooms in Silverlight 2.0</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/18/mousewheel-zooms-in-silverlight-2-0.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/18/mousewheel-zooms-in-silverlight-2-0.aspx</id><published>2008-03-19T00:11:00Z</published><updated>2008-03-19T00:11:00Z</updated><content type="html">&lt;P&gt;A few weeks ago I posted a short code sample demonstrating how to do mousewheel zooms in Silverlight 1.1. They're easier to do in Silverlight 2.0 and can be done without calling out of managed code, thanks to the new HtmlWindow class (and the HtmlPage.Window property, which returns a reference to an HtmlWindow).&lt;/P&gt;
&lt;P&gt;Here's a summary. First, assume you have a ScaleTransform that facilitates zooms:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#0000ff&gt;&amp;lt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-bidi-font-size:14.0pt;"&gt;ScaleTransform&lt;/SPAN&gt;&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-bidi-font-size:14.0pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-bidi-font-size:14.0pt;"&gt;x:Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-bidi-font-size:14.0pt;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-bidi-font-size:14.0pt;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;ZoomTransform&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Next, when the page loads, use HtmlWindow.AttachEvent to register a managed handler for mousewheel events:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;HtmlPage&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;.Window.AttachEvent(&lt;SPAN style="COLOR:#a31515;"&gt;"DOMMouseScroll"&lt;/SPAN&gt;, OnMouseWheelTurned);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;HtmlPage&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;.Window.AttachEvent(&lt;SPAN style="COLOR:#a31515;"&gt;"onmousewheel"&lt;/SPAN&gt;, OnMouseWheelTurned);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;HtmlPage&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;.Document.AttachEvent(&lt;SPAN style="COLOR:#a31515;"&gt;"onmousewheel"&lt;/SPAN&gt;, OnMouseWheelTurned);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;Here's the event handler that responds to mousewheel events by manipulating the ScaleTransform:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; OnMouseWheelTurned(&lt;SPAN style="COLOR:#2b91af;"&gt;Object&lt;/SPAN&gt; sender, &lt;SPAN style="COLOR:#2b91af;"&gt;HtmlEventArgs&lt;/SPAN&gt; args)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;double&lt;/SPAN&gt; delta = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#2b91af;"&gt;ScriptObject&lt;/SPAN&gt; e = args.EventObject;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (e.GetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"wheelDelta"&lt;/SPAN&gt;) != &lt;SPAN style="COLOR:blue;"&gt;null&lt;/SPAN&gt;) &lt;SPAN style="COLOR:green;"&gt;// IE and Opera&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;delta = ((&lt;SPAN style="COLOR:blue;"&gt;double&lt;/SPAN&gt;)e.GetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"wheelDelta"&lt;/SPAN&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (&lt;SPAN style="COLOR:#2b91af;"&gt;HtmlPage&lt;/SPAN&gt;.Window.GetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"opera"&lt;/SPAN&gt;) != &lt;SPAN style="COLOR:blue;"&gt;null&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;delta = -delta;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (e.GetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"detail"&lt;/SPAN&gt;) != &lt;SPAN style="COLOR:blue;"&gt;null&lt;/SPAN&gt;) &lt;SPAN style="COLOR:green;"&gt;// Mozilla and Safari&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;delta = -((&lt;SPAN style="COLOR:blue;"&gt;double&lt;/SPAN&gt;)e.GetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"detail"&lt;/SPAN&gt;));&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (delta &amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:green;"&gt;// Zoom in&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleX += 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleY += 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;else&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (delta &amp;lt; 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:green;"&gt;// Zoom out&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleX -= 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleY -= 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;if&lt;/SPAN&gt; (delta != 0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;args.PreventDefault();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;e.SetProperty(&lt;SPAN style="COLOR:#a31515;"&gt;"returnValue"&lt;/SPAN&gt;, &lt;SPAN style="COLOR:blue;"&gt;false&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;Anything affected by the ScaleTransform will now scale up and down with mousewheel movements.&lt;/P&gt;
&lt;P&gt;My mousewheel event handler is browser-independent and correctly reports the direction of travel, but it doesn't take into account the differences in the &lt;EM&gt;magnitude&lt;/EM&gt; of travel reported by various browsers. Scott Hanselman pointed me to an &lt;A class="" title="house of mirrors" href="http://blois.us/blog/2008/03/ive-heard-number-of-people-wondering.html" target=_blank&gt;excellent blog post by Pete Blois&lt;/A&gt; that includes downloadable source code for a MouseWheelHelper class that accounts for differences in magnitude, too. Check it out if you want to make mousewheel handling simple as pie in Silverlight 2.0.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5679" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Alerting the User in Silverlight 2.0</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/18/alerting-the-user-in-silverlight-2-0.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/18/alerting-the-user-in-silverlight-2-0.aspx</id><published>2008-03-18T21:49:00Z</published><updated>2008-03-18T21:49:00Z</updated><content type="html">&lt;P&gt;Silverlight 1.1 lacked a managed equivalent of JavaScript's window.alert, so when I wanted to pop up a message box (actually, an alert box) in Silverlight 1.1, I used the platform's DOM integration features to fire a scriptable event from C# and handle the event in JavaScript. Then, in the event handler, I called&amp;nbsp;window.alert.&lt;/P&gt;
&lt;P&gt;There's no need for such shenanigans in Silverlight 2.0 because you can call window.alert via a managed wrapper:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;HtmlPage&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;.Window.Alert(&lt;SPAN style="COLOR:#a31515;"&gt;"Error!"&lt;/SPAN&gt;);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;HtmlPage.Window contains a reference to an HtmlWindow object representing the browser window. You can also use HtmlWindow.AttachEvent to register managed handlers for mousewheel events, making it relatively easy to process mousewheel events in Silverlight 2.0 without the intervention of JavaScript. I'll provide an example in a future blog post.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5676" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Loading Images from the Local File System in Silverlight 2.0</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/15/loading-images-from-the-local-file-system-in-silverlight-2-0.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/15/loading-images-from-the-local-file-system-in-silverlight-2-0.aspx</id><published>2008-03-15T21:02:00Z</published><updated>2008-03-15T21:02:00Z</updated><content type="html">&lt;P&gt;In Silverlight 1.1, it was impossible to load images from the local file system unless you uploaded them to a server first. In Silverlight 2.0, it's a piece of cake to load local images as long as you involve the user by displaying an OpenFileDialog:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';"&gt;OpenFileDialog&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt; ofd = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;OpenFileDialog&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;ofd.Filter = &lt;SPAN style="COLOR:#a31515;"&gt;"JPEG Files (*.jpg;*.jpeg)|*.jpg;*.jpeg | All Files (*.*)|*.*"&lt;/SPAN&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;ofd.FilterIndex = 1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt; (ofd.ShowDialog() == &lt;SPAN style="COLOR:#2b91af;"&gt;DialogResult&lt;/SPAN&gt;.OK)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:#2b91af;"&gt;Stream&lt;/SPAN&gt; stream = ofd.SelectedFile.OpenRead();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR:#2b91af;"&gt;BitmapImage&lt;/SPAN&gt; bi = &lt;SPAN style="COLOR:blue;"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;BitmapImage&lt;/SPAN&gt;();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bi.SetSource(stream);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyImage.Source = bi;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; stream.Close();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;In this example, "MyImage" is a reference to a XAML Image object.&lt;/P&gt;
&lt;P&gt;I just returned from DevWeek in London. The excitement level around Silverlight was very high, and the highlight of my week was&amp;nbsp;doing Silverlight presentations for&amp;nbsp;standing-room-only crowds.&amp;nbsp;Thanks to Dave Wheeler for talking up Silverlight in his keynote and getting the crowds thinking about XAML!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5578" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>SilverLife 2.0</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/06/silverlife-2-0.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/03/06/silverlife-2-0.aspx</id><published>2008-03-06T15:20:00Z</published><updated>2008-03-06T15:20:00Z</updated><content type="html">&lt;P&gt;Silverlight 2.0 Beta 1 shipped yesterday, so I thought now would be a good time to deploy a new version of SilverLife. SilverLife is a Silverlight implementation of John Conway's game of Life. Version 1.0, which I published in August of last year, targeted the Silverlight 1.1 alpha. Version 2.0 targets the new Silverlight 2.0 beta and can be viewed at &lt;A href="http://www.wintellect.com/silverlife"&gt;http://www.wintellect.com/silverlife&lt;/A&gt;. You can download the source code from &lt;A href="http://www.wintellect.com/downloads/silverlife_2.0.zip"&gt;www.wintellect.com/downloads/silverlife_2.0.zip&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="SilverLife 2.0" style="WIDTH:406px;HEIGHT:480px;" height=480 alt="SilverLife 2.0" src="http://www.wintellect.com/cs/photos/prosise/images/5396/406x480.aspx" width=406&gt;&lt;/P&gt;
&lt;P&gt;SilverLife&amp;nbsp;2.0 looks almost exactly like version 1.0, save for the buttons at the bottom of the grid. Silverlight 1.1 had no controls&amp;nbsp;built in, so I had to manufacture something that looked like buttons. Silverlight 2.0 Beta 1 contains more than 20&amp;nbsp;built-in control types, so I used Button controls. I also took advantage of the new style support in Silverlight 2.0 to stylize the buttons. First I defined a&amp;nbsp;style named "LifeButton" in XAML:&lt;/P&gt;&lt;FONT color=#a31515 size=2&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;/P&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Key&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="LifeButton"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="Button"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="Width"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="132" /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="Height"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="44" /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="FontSize"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="16" /&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;&lt;/FONT&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;Then I applied the style to the four Button controls:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="StartButton"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; LifeButton&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; ... &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="StopButton"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; LifeButton&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; ... &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="StepButton"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; LifeButton&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; ... &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; x&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;:&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="ClearButton"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; Style&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; LifeButton&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:red;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt; ... &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:9pt;FONT-FAMILY:'Times New Roman','serif';mso-fareast-font-family:'Times New Roman';mso-ansi-language:EN;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&amp;nbsp;&lt;/P&gt;&lt;/SPAN&gt;
&lt;P&gt;This is an extremely simple example, but styles can be much more complex and can even use templates to completely redefine a control's visual tree. Styles and templates are going to be incredibly important to Silverlight 2.0 apps, so I'll be writing more about them later.&lt;/P&gt;
&lt;P&gt;Porting SilverLife from Silverlight 1.1 to 2.0 required just a handful of changes. First I used Visual Studio 2008 to create a new Silverlight project. Then I imported most of the code and XAML from the first version of SilverLife and began patching things up. Here are some of the changes that were required:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;The XamlReader class moved to the System.Windows.Markup namespace&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;XamlReader.Load now requires an xmlns="&lt;A href="http://schemas.microsoft.com/client/2007"&gt;http://schemas.microsoft.com/client/2007&lt;/A&gt;" attribute&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;HtmlPage.Document.GetElementByID changed to HtmlPage.Document.GetElementById&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;The IsolatedStorageFileStream constructor&amp;nbsp;now throws an IsolatedStorageException rather than an IOException if you attempt to open a file that doesn't exist&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;One of the most pleasant surprises in Silverlight 2.0 Beta 1 is the simplified deployment strategy. XAML files and other resources (for example, images) are now compiled into the application's assembly. Moreover, the assembly and any assemblies it depends upon are&amp;nbsp;packaged in a XAP file, which is a glorified zip file containing a manifest. The upshot is that deploying the application to Wintellect's Web server required two simple steps:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;
&lt;DIV&gt;Copy Default.html (the page that hosts the application) into the Silverlife directory&lt;/DIV&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;DIV&gt;Create a ClientBin folder in that directory and copy Silverlife.xap into it&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;That's it! Other than adding a new MIME type ("application/x-silverlight-app") to IIS and mapping it to XAP files (a one-time procedure), deployment involved nothing more copying a&amp;nbsp;couple of files. How cool is that?&lt;/P&gt;
&lt;P&gt;Another pleasant surprise was the fact that Silverlight 2.0 displays a default progress UI as the XAP file is downloaded. Now users won't have to stare at a blank canvas as they wait for assemblies to be downloaded. Nor will you, the developer, have to code up a progress UI.&lt;/P&gt;
&lt;P&gt;I'll have much, much more to say in future posts. A new day is dawning, and it has Silverlight 2.0 written all over it!&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5397" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Sightseeing in Shanghai</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/02/29/sightseeing-in-shanghai.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/02/29/sightseeing-in-shanghai.aspx</id><published>2008-02-29T13:49:00Z</published><updated>2008-02-29T13:49:00Z</updated><content type="html">&lt;P&gt;I just concluded a week in Shanghai and&amp;nbsp;begin the journey&amp;nbsp;home tomorrow. I had the pleasure of working with a lot&amp;nbsp;of very smart (and very polite) Microsoft developers in Beijing and Shanghai these past two weeks and will be bringing home a lot of fond memories.&lt;/P&gt;
&lt;P&gt;I had yesterday off,&amp;nbsp;so after having a leisurely breakfast, walking down to Starbucks for a vanilla mocha, and working in the hotel the rest of the morning, I decided to do some sightseeing. I went to the Bund, which is Shanghai’s most popular tourist destination and is about a 15-minute cab ride from my hotel. The Bund lies alongside the Huangpu River in downtown Shanghai. There are lots of skyscrapers along the river, plus the world’s tallest TV tower (the “Oriental Pearl”). Here are some pictures. The Oriental Pearl is the tall tower on the left side in the first picture:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="The Bund (1)" style="WIDTH:500px;HEIGHT:375px;" height=375 alt="The Bund (1)" src="http://www.wintellect.com/cs/photos/prosise/images/5378/500x375.aspx" width=500&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="The Bund (2)" style="WIDTH:500px;HEIGHT:375px;" height=375 alt="The Bund (2)" src="http://www.wintellect.com/cs/photos/prosise/images/5379/500x375.aspx" width=500&gt;&lt;/P&gt;
&lt;P&gt;While I was at the Bund, I took the opportunity to walk down Nanjing Street, which is Shanghai’s most popular shopping area, to do some shopping for my girls. It’s about a mile long and it’s wall-to-wall stores. Here’s what it looks like:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Nanjing Street (1)" style="WIDTH:500px;HEIGHT:375px;" height=375 alt="Nanjing Street (1)" src="http://www.wintellect.com/cs/photos/prosise/images/5380/500x375.aspx" width=500&gt;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Nanjing Street (2)" style="WIDTH:500px;HEIGHT:666px;" height=666 alt="Nanjing Street (2)" src="http://www.wintellect.com/cs/photos/prosise/images/5381/original.aspx" width=500&gt;&lt;/P&gt;
&lt;P&gt;I got back to the hotel about 3:00 and hadn’t had lunch, so I walked to the Heng Shan Cafe down the street and had their yummy Sichuan (Szechuan) chili chicken. It costs $7, whereas a large cup of Starbucks coffee costs almost $6:&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Sichuan Chicken" style="WIDTH:500px;HEIGHT:375px;" height=375 alt="Sichuan Chicken" src="http://www.wintellect.com/cs/photos/prosise/images/5382/500x375.aspx" width=500&gt;&lt;/P&gt;
&lt;P&gt;The red things are peppers, and yes, they’re hot. But I’m careful not to eat too many of them and it is a *wonderful* meal!&lt;/P&gt;
&lt;P&gt;While in China, I've been reading &lt;A class="" title="The World is Flat" href="http://www.amazon.com/World-Flat-3-0-History-Twenty-first/dp/0312425074/ref=pd_bbs_sr_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1204293813&amp;amp;sr=8-1" target=_blank&gt;The World is Flat&lt;/A&gt; by Pulitzer Prize winning author Thomas Friedman. It is a terrific read and a real eye-opener, especially in light of my recent experiences in India and China. It should be required reading for every high school student in America. If you haven't read it, consider picking up a copy. The world really is flat (and becoming flatter every day), and the way to succeed in a flat world is to think horizontally. Too bad our idiot politicians don't read this book. Then again, it's probably way over their heads.&lt;/P&gt;&lt;img src="http://www.wintellect.com/cs/aggbug.aspx?PostID=5383" width="1" height="1"&gt;</content><author><name>jprosise</name><uri>http://www.wintellect.com/cs/members/jprosise.aspx</uri></author></entry><entry><title>Mousewheel Zooms in Silverlight 1.1</title><link rel="alternate" type="text/html" href="http://www.wintellect.com/cs/blogs/jprosise/archive/2008/02/23/mousewheel-zooms-in-silverlight-1-1.aspx" /><id>http://www.wintellect.com/cs/blogs/jprosise/archive/2008/02/23/mousewheel-zooms-in-silverlight-1-1.aspx</id><published>2008-02-23T07:26:00Z</published><updated>2008-02-23T07:26:00Z</updated><content type="html">&lt;P&gt;Yesterday I was asked how one can do mousewheel zooms in Silverlight 1.1 given that 1.1 doesn’t provide any mechanism for registering managed handlers for mousewheel events.&lt;/P&gt;
&lt;P&gt;It can still be done, thanks to the fact that Silverlight 1.1 permits managed methods to be called from JavaScript. Here’s an example. Start with a XAML file containing a Canvas with a ScaleTransform. Here’s one that displays a smiley face:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas.RenderTransform&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;ScaleTransform&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;x:Name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;ZoomTransform&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas.RenderTransform&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Ellipse&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas.Left&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;20&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Canvas.Top&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;20&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;200&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;200&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Stroke&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;StrokeThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;10&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Fill&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Yellow&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Ellipse&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas.Left&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;80&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Canvas.Top&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;80&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;35&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;25&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Stroke&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Fill&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Ellipse&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas.Left&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;140&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Canvas.Top&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;80&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;35&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;25&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Stroke&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Fill&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Path&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Data&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;M 70, 150 A 60, 60 0 0 0 170, 150&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;Stroke&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Black&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;StrokeThickness&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;15&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR:red;"&gt;StrokeStartLineCap&lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;Round&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:red;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;StrokeEndLineCap&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;"&lt;SPAN style="COLOR:blue;"&gt;Round&lt;/SPAN&gt;"&lt;SPAN style="COLOR:blue;"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 10pt;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#a31515;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;Canvas&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;LINE-HEIGHT:115%;FONT-FAMILY:'Courier New';mso-bidi-font-size:14.0pt;mso-no-proof:yes;"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:8pt;LINE-HEIGHT:115%;mso-bidi-font-size:11.0pt;"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Next,&amp;nbsp;register the XAML code-behind class as a scriptable class and include scriptable ZoomIn and ZoomOut methods, too:&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;System.Windows.Browser.S&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:#2b91af;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;criptable&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;COLOR:blue;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;public&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt; &lt;SPAN style="COLOR:blue;"&gt;partial&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR:#2b91af;"&gt;Page&lt;/SPAN&gt; : &lt;SPAN style="COLOR:#2b91af;"&gt;Canvas&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; Page_Loaded(&lt;SPAN style="COLOR:blue;"&gt;object&lt;/SPAN&gt; o, &lt;SPAN style="COLOR:#2b91af;"&gt;EventArgs&lt;/SPAN&gt; e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;InitializeComponent();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:#2b91af;"&gt;WebApplication&lt;/SPAN&gt;.Current.RegisterScriptableObject&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;(&lt;SPAN style="COLOR:#a31515;"&gt;"magic"&lt;/SPAN&gt;, &lt;SPAN style="COLOR:blue;"&gt;this&lt;/SPAN&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;[&lt;SPAN style="COLOR:#2b91af;"&gt;System.Windows.Browser.Scriptable&lt;/SPAN&gt;]&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR:blue;"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR:blue;"&gt;void&lt;/SPAN&gt; ZoomIn()&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleX += 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ZoomTransform.ScaleY += 0.1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10pt;FONT-FAMILY:'Courier New';mso-no-proof:yes;"&gt;&lt;SPAN style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;LINE-HEIGHT:normal;mso-layout-grid-align:none;"&gt;&lt;SPAN style="FONT-SIZE:10