<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Jaime Rodriguez  : silverlight</title><link>http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx</link><description>Tags: silverlight</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>What is new in WPF and Cider on the .NET Framework 4 and VS2010 beta 2 release</title><link>http://blogs.msdn.com/jaimer/archive/2009/10/23/what-is-new-in-wpf-and-cider-on-the-net-framework-4-and-vs2010-beta-2-release.aspx</link><pubDate>Fri, 23 Oct 2009 14:39:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9912080</guid><dc:creator>jaimer</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9912080.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9912080</wfw:commentRss><description>&lt;P&gt;This post is a quick recap of the most important changes for WPF and Silverlight developers in this Beta 2 release. I definitely will return to a few of these topics over the next few weeks, so stay tuned for updates and new posts. Please note that this post is NOT all-inclusive; there are lots of features and smaller bug fixes that I am leaving out. I will try to dig those up as we go along in the next few weeks! &lt;/P&gt;
&lt;P&gt;Also, I've listed links to the Beta 1 posts at the bottom of the post for those needing a refresh. I've also sprinkled links to the videos in our “WPF in VS2010 Beta 2 series” throughout the post, as well as listing them at the end. &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;STRONG&gt;New in the Visual Studio 2010 Cider designer&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You can see a video with most of the Beta 2 updates &lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Whats-new-in-the-WPF-and-Silverlight-Cider-Designer-in-VS2010-beta2/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Whats-new-in-the-WPF-and-Silverlight-Cider-Designer-in-VS2010-beta2/"&gt;in this 14 minute video with Mark Wilson Thomas&lt;/A&gt;. &lt;BR&gt;In the video, Mark shares a MUST USE registry key to improve the performance of Visual Studio 2010 Beta 2. &lt;BR&gt;&lt;BR&gt;For the record, this is in the readme, it is not a hack and Mark has documented it on his &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4bda432a-4e18-4fb5-a257-15c0e653b3a9" target=_blank mce_href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4bda432a-4e18-4fb5-a257-15c0e653b3a9"&gt;announcement&lt;/A&gt;:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Registry Switch for improved performance &lt;BR&gt;&lt;/STRONG&gt;Because of a late-breaking change, you will need to make a configuration change to see the best designer performance. This configuration change will not be necessary in the final released versions of the product. &lt;BR&gt;&lt;STRONG&gt;NOTE:&lt;/STRONG&gt; Editing the registry can cause serious problems that may require you to reinstall Windows. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk. Refer to the article on registry editing for your OS (e.g &lt;A href="http://support.microsoft.com/kb/136393" mce_href="http://support.microsoft.com/kb/136393"&gt;http://support.microsoft.com/kb/136393&lt;/A&gt;) for advice.&amp;nbsp; &lt;BR&gt;&lt;EM&gt;1. Close any open VS instances &lt;BR&gt;2. Open RegEdit (as an administrator as needed) &lt;BR&gt;3. Select the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0 key &lt;BR&gt;4. Right click and add key, type ClrHost &lt;BR&gt;5. In the newly created key, right click and add a DWORD32 with the name StartupFlags &lt;BR&gt;6. Set its value to 5 &lt;BR&gt;7. Close RegEdit &lt;BR&gt;8. Start up Visual Studio and use as normal &lt;BR&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;[&lt;U&gt;10/28 update&lt;/U&gt;. Mark now has a &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4511d43f-c134-4329-a970-e374252a620e" mce_href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4511d43f-c134-4329-a970-e374252a620e"&gt;disclaimer&lt;/A&gt;&amp;nbsp;and it is in bold red on his page, so it must be important, go read &lt;A href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4511d43f-c134-4329-a970-e374252a620e" mce_href="http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner/thread/4511d43f-c134-4329-a970-e374252a620e"&gt;it&lt;/A&gt;: &lt;/EM&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;EM&gt;The registry hack might create instability or increased Virtual Memory Usage in some VS scenarios.&amp;nbsp; If you see this, feel free to remove the config change and report it on Connect. &lt;/EM&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;Also, if you are not using Cider designer a lot (for WPF and Silverlight) the configuration change is not helping you. So don't enable it unless you are using the designer a lot. &lt;/EM&gt;&lt;EM&gt;] &lt;/EM&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Here are my cliff-notes from the video: &lt;BR&gt;&lt;BR&gt;For WPF developers&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The designer continues to stabilize.&amp;nbsp; All the features introduced in Beta1 – including improvements on the designer, brush editor, IntelliSense on binding markup extensions, data sources window- have been cleaned up and the performance has been boosted.&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;The property browser has been updated with a new view that tells you what is the source for the value of a property (e.g. is the source set locally, from a style, binding, etc.).&amp;nbsp;&amp;nbsp; This feature is proving incredibly handy based just on my one week of using it! &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Support for StaticResources in app.xaml. Finally! No more long pack://application,,,/ syntax required. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Improved error handling, much like Blend, where the designer can isolate errors to a specific user control; the designer now ‘recovers’ and gives you meaningful information about the error. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Now there is design-time data support; compatible with Blend.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;For Silverlight developers, &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You finally get an interactive designer where you can drag &amp;amp; drop and get all the designer features available in WPF -&amp;nbsp; zero to 70 MPH in a single release- Cha-Ching!! &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;New Graphics (minus text) features for the WPF run-time?&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; You can &lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Graphics-improvements-in-WPF-4/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Graphics-improvements-in-WPF-4/"&gt;watch demos for most of these in this video with David&amp;nbsp; Teitlebaum&lt;/A&gt;.&amp;nbsp; You can get the demos for this video &lt;A href="http://www.cookingwithxaml.com/recipes/wpf4/graphics.zip" target=_blank mce_href="http://www.cookingwithxaml.com/recipes/wpf4/graphics.zip"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;Cached Composition&lt;/EM&gt;&lt;/STRONG&gt;. This feature allows you to “cache” any UI Element as a bitmap that can be persisted in video memory. The cache supports dirty regions, so it redraws when needed (with out you needing to detect it).&amp;nbsp;&amp;nbsp; &lt;BR&gt;Cached elements can be live objects (e.g. a textblock) and can be transformed, rotated, etc. &lt;BR&gt;This feature is incredibly powerful for WPF scalability. If you watch David’s video you will see how he went from ~10fps on a live drawing, to 60fps when he cached it. I recently had a similar experience in a 3D viewer; my CPU decreased by 80% for all my drag &amp;amp; drops once I cached the 3D scene during the drags. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/08/27/layout-rounding.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/08/27/layout-rounding.aspx"&gt;&lt;STRONG&gt;&lt;EM&gt;Layout Rounding&lt;/EM&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; &lt;/STRONG&gt;allows WPF to avoid the blurriness that results in images and text when they are using layout with sub-pixel positioning.&amp;nbsp; This feature is in Silverlight 2; again, nice to have compatibility. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Pixel Shader 3&lt;/STRONG&gt; &lt;STRONG&gt;support&lt;/STRONG&gt; &lt;/EM&gt;expands the effects pipeline significantly since PS3 has a lot more instructions.&amp;nbsp;A good reference on difference on # od instructions between PS2 and PS2 is at &lt;A href="http://en.wikipedia.org/wiki/High_Level_Shader_Language" mce_href="http://en.wikipedia.org/wiki/High_Level_Shader_Language"&gt;wikipedia&lt;/A&gt;.&lt;BR&gt;Note: The gotcha for this features is that Pixel Shader 3 does not default back to software rendering, so you will need to test to see if hardware supports the feature before you use it. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;Animation easing functions &lt;/EM&gt;&lt;/STRONG&gt;allow designers to create more realistic, fluid animations. This feature matches the easing functions in Silverlight 3 and provides XAML compatibility.&amp;nbsp; Out of the box, you get&amp;nbsp; CircleEase, BackEase, ExponentialEase, Quadraticease, CubicEase, QuarticEase, Quinticease, PowerEase, Elasticease, BounceEase, and SineEase.&amp;nbsp; There is also an interface (IEasingFunction), so you can create your own easing functions and plug them into any of the existing animations via a new Dependency property on all stock animations.&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;RenderOptions.ClearTypeHint &lt;/STRONG&gt;&lt;/EM&gt;allows you to turn ClearType on in scenarios where the system previously turned it off. &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;New Text Features &lt;BR&gt;&lt;/STRONG&gt;You can watch most of these improvements with insightful explanations in this &lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/New-Text-Stack-in-WPF-4/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/New-Text-Stack-in-WPF-4/"&gt;Channel9 video with Chipalo Street&lt;/A&gt;. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A&lt;STRONG&gt;&lt;EM&gt; &lt;/EM&gt;&lt;/STRONG&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx"&gt;&lt;STRONG&gt;&lt;EM&gt;new text rendering stack&lt;/EM&gt;&lt;/STRONG&gt;&lt;/A&gt; improves the clarity and puts&amp;nbsp; the application developer in control of the rendering and formating options. With this new stack you choose between the old world WPF text (which worked well for some scenarios), and new text with comparable sharpness to Win32/GDI.&amp;nbsp; &lt;BR&gt;Configuring the text enhancements is handled mostly via two new attached properties: &lt;BR&gt;&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx"&gt;TextOptions.TextFormatingMode&lt;/A&gt; allows you to control the metrics for formatting text. You get two options:&lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Ideal – is the old WPF, the glyphs maintain high fidelity with their outlines, and placement of the final glyph is not taken into account &lt;/LI&gt;
&lt;LI&gt;Display – uses GDI compatible metrics and ensures glyph widths are in whole pixels (clarity of the text is much higher when text aligns to whole pixels) &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx"&gt;TextOptions.TextRenderingMode&lt;/A&gt; allows you to control how the text is rendered. &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;Auto – respects the system setting; this is usually ClearType for most systems &lt;/LI&gt;
&lt;LI&gt;ClearType – forces the rendering to Cleartype -this is what we were doing in earlier versions of WPF&lt;/LI&gt;
&lt;LI&gt;GrayScale – renders grayscale, antialiased text &lt;/LI&gt;
&lt;LI&gt;Aliased –&amp;nbsp; no antialiasing is used. &lt;BR&gt;Note: Per Chipalo, aliased vs. antialiased does not lead to perf differences; this surprised me. &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/08/24/wpf-4-0-text-stack-improvements.aspx"&gt;Embedded bitmaps&lt;/A&gt; &lt;/STRONG&gt;&lt;/EM&gt;adds support for (mostly) East Asian fonts that contain bitmaps for some characters at small sizes. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/09/01/bindable-run.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/09/01/bindable-run.aspx"&gt;Bindable Run&lt;/A&gt; &lt;/STRONG&gt;&lt;/EM&gt;is simply the old Run, fixed so that Run.Text is a dependency property and can be data bound. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/09/01/caret-brush.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/09/01/caret-brush.aspx"&gt;&lt;EM&gt;&lt;STRONG&gt;Customization support for Caret Brush&lt;/STRONG&gt;&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/EM&gt;allows you to replace the Caret in TextBox, PasswordBox and RichTextBox. You can replace the CaretBrush with any brush. Go crazy!&amp;nbsp; You can also customize SelectionBrush and SelectionOpacity on all controls that support selection –including TextBox, RichTextBox, PasswordBox, FlowDocumentPageViewer, FlowDocumentScrollViewer and FlowDocumentReader. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/text/archive/2009/10/02/custom-dictionaries.aspx" target=_blank mce_href="http://blogs.msdn.com/text/archive/2009/10/02/custom-dictionaries.aspx"&gt;&lt;EM&gt;&lt;STRONG&gt;Custom Dictionaries&lt;/STRONG&gt;&lt;/EM&gt;&lt;/A&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;allows you to customize the dictionary used for spell checking in WPF applications. In previous releases, WPF used the OS dictionary, but did not allow you to extend it. Now with Custom dictionaries you can extend the dictionary to include your specialized industry lingo.&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;New Control &amp;amp; Data binding features &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;VisualStateManager &lt;/EM&gt;support&lt;/STRONG&gt;. VSM actually ships in the platform and all the controls have been tweaked to support Visual States. This means you can now customize Control templates using VSM and get higher compatibility with Silverlight. &lt;BR&gt;Note: Despite the VSM support in all the controls, the actual control templates were not changed, you will need to replace the template to use VSM. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;Inheritance Context for Input Binding &lt;/EM&gt;&lt;/STRONG&gt;enables the MVVM scenario of&amp;nbsp; binding InputBinding.Command to a command in a ViewModel.&amp;nbsp; The Key and Modifiers property in KeyBinding are now Dependency Properties; same for MouseAction and MouseBinding. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;DependencyObject.SetCurrentValue&amp;nbsp; &lt;/EM&gt;&lt;/STRONG&gt;is a new method introduced mostly for Custom Control authors.&amp;nbsp; SetCurrentValue method changes the effective value of the property, but existing triggers, data bindings, and styles will continue to work because the ValueSource for the property is not changed.&amp;nbsp; A lot of the controls in WPF were tweaked to use this, so their old SetValue calls were replaced with SetCurrentValue. I hear the recommendation is for custom control authors to use this method instead of SetValue; reccomendation makes sense, I am not sure if it applies 100% of the time, or just 99%; so use with 1% caution. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;Databinding support for DynamicObjects.&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp; With .NET 4’s support for dynamic keyword, a lot of people will be using DynamicObject (and I DynamicMetaObjectProvider).&amp;nbsp; You will be able to bind to these dynamic objects using the same syntax than a property of any other object. You will even be able to use typed DataTemplates (as long as you are using concrete typesthat derive from DynamicObject.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;New Windows 7 features&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;MultiTouch &lt;/EM&gt;&lt;/STRONG&gt;is fully functional in Beta2. WPF now has full support for multitouch including&amp;nbsp; manipulation, inertia, and raw-touch events.&amp;nbsp;&amp;nbsp; The support is at UIElement, UIElement3D and ContentElement –which means every thing with LIFE in WPF supports Multitouch.&amp;nbsp; &lt;BR&gt;This topic is going to get its own blog post (and hopefully a video) soon, so stay tuned. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;&lt;STRONG&gt;Taskbar &lt;/STRONG&gt;&lt;/EM&gt;support for Windows 7, including jumplists, progress bar, overlay icon, and thumbnail buttons (with WPF commanding support).&amp;nbsp; This topic will also get its own blog post soon. &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Deployment update &lt;BR&gt;&lt;/STRONG&gt;You can watch a demo and get the whole picture from this Channel 9 &lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/NET-4-Client-Profile/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/NET-4-Client-Profile/"&gt;video interview with Jossef Goldberg&lt;/A&gt;. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;A href="http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx" target=_blank mce_href="http://blogs.msdn.com/jgoldb/archive/2009/10/19/what-s-new-in-net-framework-4-client-profile-beta-2.aspx"&gt;Client profile&lt;/A&gt;&lt;/EM&gt; &lt;/STRONG&gt;is critical to the deployment of the framework outside of managed enterprises. By subsetting the full framework to a client SKU, we will decrease download size, and improve the framework install times.&amp;nbsp; &lt;BR&gt;In Beta 2, client profile is near feature complete: &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;You can see it as its own separate, serviceable SKU&lt;/LI&gt;
&lt;LI&gt;The tools have support for it, including the References dialog in VS2010 filtering for assemblies only in client profile SKU if that is what you are targeting.&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;A few assemblies that were not in client profile SKU are now included, this increased the size to 30 MB, which is still a great improvement compared to full framework.&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Hopefully this gets you caught up on beta2.&amp;nbsp; Time to play! &lt;A href="http://www.microsoft.com/visualstudio/en-us/try/default.mspx#download" target=_blank mce_href="http://www.microsoft.com/visualstudio/en-us/try/default.mspx#download"&gt;Download visual Studio 2008 beta2&lt;/A&gt;.&amp;nbsp; Stay tuned for a few more posts on the topics above. &lt;/P&gt;
&lt;P&gt;LINK ROLL!! &lt;/P&gt;
&lt;P&gt;Beta 2 links: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Graphics-improvements-in-WPF-4/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Graphics-improvements-in-WPF-4/"&gt;WPF 4 Graphics Improvements with David Teitlebaum&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/New-Text-Stack-in-WPF-4/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/New-Text-Stack-in-WPF-4/"&gt;WPF 4 Text Improvements with Chipalo Street&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/NET-4-Client-Profile/" target=_blank mce_href="http://channel9.msdn.com/posts/Jaime+Rodriguez/NET-4-Client-Profile/"&gt;What’s New in Client Profile with Jossef Goldberg&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/posts/Jaime+Rodriguez/Whats-new-in-the-WPF-and-Silverlight-Cider-Designer-in-VS2010-beta2/" target=_blank&gt;What’s New in Cider in VS2010 beta2 with Mark Wilson-Thomas&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Beta 1 (but still relevant links)&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/shows/Continuum/WPF4Beta1DesignerLookingForward/" target=_blank mce_href="http://channel9.msdn.com/shows/Continuum/WPF4Beta1DesignerLookingForward/"&gt;Cider in VS 2010 beta1&lt;/A&gt; has a long list of improvements for WPF and Silverlight developers in VS2010. All of these are still IN! &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://channel9.msdn.com/shows/Continuum/MultitouchWPF4Beta1/" target=_blank mce_href="http://channel9.msdn.com/shows/Continuum/MultitouchWPF4Beta1/"&gt;Multitouch in WPF with Anson Tsao&lt;/A&gt;, this was recorded after Beta 1, so shows some Beta 2 roadmap/features.&lt;/LI&gt;&lt;/UL&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9912080" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+7/default.aspx">Windows 7</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/VS2010/default.aspx">VS2010</category></item><item><title>Expression Studio TuTorialS Starter Kit</title><link>http://blogs.msdn.com/jaimer/archive/2009/08/11/expression-studio-tutorials-starter-kit.aspx</link><pubDate>Wed, 12 Aug 2009 09:26:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9865624</guid><dc:creator>jaimer</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9865624.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9865624</wfw:commentRss><description>&lt;p&gt;Via &lt;a href="http://ux.artu.tv/"&gt;Arturo Toledo&lt;/a&gt; (internal email).&amp;#160; The Expression team released four great Expression starter kits today.. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://download.microsoft.com/download/A/4/9/A49AB02F-F035-402C-9B26-84860EEAF7DC/Prototyping_with_Sketchflow_StarterKit.zip"&gt;Introduction to Prototyping with Sketchflow in Expression Blend 3&lt;/a&gt;    &lt;br /&gt;Discover Sketchflow, a new feature set in Expression Blend 3 that helps you define the concept for user experiences in early stages of the design process. From sketches to wireframes to protoypes of simple or high definition, Sketchflow provides you the right tools to communicate your ideas and gather feedback from others.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://download.microsoft.com/download/1/1/C/11C8F2E2-711B-4581-A688-6B66DA4D1124/VentureIntoGaming_ExpressionBlend3_StarterKit.zip"&gt;Venture into Gaming with Behaviors in Expression Blend 3&lt;/a&gt;&amp;#160; &lt;br /&gt;Learn more about how to build a traditional &amp;quot;bricks&amp;quot; game using Expression Blend 3 Behaviors. Simply drag and drop Behaviors over objects in your artboard to easily add powerful and sophisticated functions like animation, physics, interactivity, data connection, effects and more. All without coding. The ever growing Behaviors Gallery at expression.microsoft.com is always available for you to download new behaviors.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://download.microsoft.com/download/F/3/4/F343C86B-FEE4-4448-8715-CA768BB305FE/ExpressionWeb3_SuperPreview_StarterKit.zip"&gt;Discovering SuperPreview in Expression Web 3&lt;/a&gt;&lt;strong&gt;      &lt;br /&gt;&lt;/strong&gt;Learn more about SuperPreview, a new visual diagnostics tool in Expression Web 3. In this Starter Kit you will be provided with detailed guidance on how to leverage SuperPreview to diagnose issues across multiple browser, all with full rendering fidelity and detailed control.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://download.microsoft.com/download/B/9/8/B9874A4F-58F8-4D01-8E2F-E1DAC62ED4A3/SilverlightSupport_Web3_StarterKit.zip"&gt;Support for Silverlight in Expression Web 3&lt;/a&gt;    &lt;br /&gt;Learn how to leverage the new and easy to use Silverlight support features in Expression Web 3. Then take your websites and publish them to an FTP location without having to leave Expression Web. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;------- &lt;/p&gt;  &lt;p&gt;I just got done watching the Sketchflow tutorial videos; they were excellent!!&amp;#160; Moving to behaviors next :) &lt;/p&gt;  &lt;p&gt;Enjoy!! &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9865624" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/expression/default.aspx">expression</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>New release of WPF Toolkit, now with charts! </title><link>http://blogs.msdn.com/jaimer/archive/2009/06/25/new-release-of-wpf-toolkit-now-with-charts.aspx</link><pubDate>Fri, 26 Jun 2009 07:57:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9804781</guid><dc:creator>jaimer</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9804781.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9804781</wfw:commentRss><description>&lt;P&gt;The &lt;A href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117" target=_blank mce_href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117"&gt;June release of the WPF toolkit&lt;/A&gt; went live today, it now includes the charts &lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/NewreleaseofWPFToolKiTNOWWITHCHARTS_134BD/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/NewreleaseofWPFToolKiTNOWWITHCHARTS_134BD/image_2.png"&gt;&lt;IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; MARGIN: 0px 0px 0px 25px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image align=right src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/NewreleaseofWPFToolKiTNOWWITHCHARTS_134BD/image_thumb.png" width=263 height=209 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/NewreleaseofWPFToolKiTNOWWITHCHARTS_134BD/image_thumb.png"&gt;&lt;/A&gt;that come with the Silverlight toolkit. &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/delay" target=_blank mce_href="http://blogs.msdn.com/delay"&gt;David Anson&lt;/A&gt; has the scoop and a great sample on the &lt;A title=charts href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx"&gt;charts&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The other controls (Datagrid, VSM, and DatePicker) also include a few minor fixes (check the &lt;A href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117" target=_blank mce_href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117"&gt;release notes&lt;/A&gt;). &lt;BR&gt;&amp;nbsp; &lt;BR&gt;There is not an update for the WPF ribbon; we are still hopingthe update to ribbon comes after (or around same time) as .NET4 beta2.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Enjoy the charts and the new toolkit, please don’t forget to send feedback. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;PS. – Congrats to David Anson for the release; he has been the biggest advocate for the charts making it into WPF. I am sure he put some ‘over-time’ given how much they are doing with the Silverlight control toolkit too.&amp;nbsp; Thanks David! &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9804781" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>Programming differences between WPF and SIlverlight, a WHitePaper</title><link>http://blogs.msdn.com/jaimer/archive/2009/06/09/programming-differences-between-wpf-and-silverlight-a-whitepaper.aspx</link><pubDate>Tue, 09 Jun 2009 19:46:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9716471</guid><dc:creator>jaimer</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9716471.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9716471</wfw:commentRss><description>&lt;p&gt;Wintellect just posted a great &lt;a href="http://wpfslguidance.codeplex.com/"&gt;70 page white paper on codeplex&lt;/a&gt; about the “&lt;a href="http://wpfslguidance.codeplex.com/"&gt;programming differences between WPF and Silverlight&lt;/a&gt;”.&amp;nbsp;&amp;nbsp; &lt;/p&gt; &lt;p&gt;I have not dissected it yet, but from a quick scan it looks very useful. &lt;br&gt;I will be printing it and dissecting it on my flight to the next (and last) &lt;a href="http://blogs.msdn.com/jaimer/archive/2009/04/01/announcing-the-using-wpf-to-build-lob-applications-training-tour.aspx"&gt;WPF for LOB Tour&lt;/a&gt; stop: Chicago. &lt;br&gt;&lt;/p&gt; &lt;p&gt;Please share feedback on the paper.&amp;nbsp;&amp;nbsp; Is it useful?? What is it missing?? Is it a fair assessment of the status on our continuum.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9716471" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/xaml/default.aspx">xaml</category></item><item><title>WPF effects Library running in Silverlight 3</title><link>http://blogs.msdn.com/jaimer/archive/2009/03/25/wpf-effects-library-running-in-silverlight-3.aspx</link><pubDate>Thu, 26 Mar 2009 02:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9508904</guid><dc:creator>jaimer</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9508904.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9508904</wfw:commentRss><description>&lt;P&gt;At MIX last week, we announced that Silverlight 3 supports effects, written in HLSL 2.0 ..&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you remember from &lt;A href="http://blogs.msdn.com/jaimer/archive/2008/10/03/announcement-wpf-shader-effects-library-on-codeplex.aspx" target=_blank mce_href="http://blogs.msdn.com/jaimer/archive/2008/10/03/announcement-wpf-shader-effects-library-on-codeplex.aspx"&gt;this previous post&lt;/A&gt;, we have a codeplex WPF library with 20+ effects and greater number of&amp;nbsp; transition effects.&amp;nbsp; Charles Bissonette, in the Blend team ported the library to Silverlight, and we have now merged it into codeplex.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The effects included in this first release are: &lt;BR&gt;BandedSwirl, Bloom, BrightExtract, ColorKeyAlpha, ColorTone, ContrastAdjust, DirectionalBlur, Embossed, Gloom, GrowablePoissonDiskEffect, InvertColor, LightStreak, Magnify, Monochrome, Pinch, Pixelate, Ripple, Sharpen, SmoothMagnify, Swirl, Tone, Toon, and ZoomBlur &lt;/P&gt;
&lt;P&gt;The transition effects include: &lt;BR&gt;BandedSwirl, Blings, Blood, CircleReveal, CircleStretch, CircularBlur, CloudReveral, Cloudy, Crumble, Dissolve, DropFade, Fade, LeastBright, LineReveal, MostBright, PixelateIn, PixelateOut, Pixelate, RadialBlur, RadialWiggle, RandomCircleReveal, Ripple, Rotate, Saturate, Shrink, SlideIn, SmoothSwirl, Swirl, Water, Wave.&lt;/P&gt;
&lt;P&gt;If you have Silverlight 3 and want to see the library in action, click &lt;A href="http://www.cookingwithxaml.com/meals/wpfslfx/default.html" mce_href="http://www.cookingwithxaml.com/meals/wpfslfx/default.html"&gt;here&lt;/A&gt;, or in the image below. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.cookingwithxaml.com/meals/wpfslfx/default.html" mce_href="http://www.cookingwithxaml.com/meals/wpfslfx/default.html"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; MARGIN-RIGHT: 0px" title=basic border=0 alt=basic align=right src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/basic_9.png" width=475 height=279 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/basic_9.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To play with the sample app: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Select type of media ( vector or image) &lt;/LI&gt;
&lt;LI&gt;Click on the checkbox by the effect name to apply an effect. &lt;BR&gt;You can apply multiple effects at same time.&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;Tweak the sliders and textboxes to configure the effect.&amp;nbsp; &lt;BR&gt;Note: the textboxes save changes on lost focus, so will need to tab out and back in. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;My favorite is the transitions. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Click on the top right button to see the show.&amp;nbsp; Each 3 seconds the transition will change. The first time they repeat twice so you can see the details, later they get random. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;BR&gt;If you do not have Silverlight 3, &lt;A href="http://www.adamkinney.com/" mce_href="http://www.adamkinney.com/"&gt;Adam Kinney&lt;/A&gt; and I recorded an impromptu &lt;A href="http://channel9.msdn.com/shows/Continuum/WPFFX-in-Silverlight/" mce_href="http://channel9.msdn.com/shows/Continuum/WPFFX-in-Silverlight/"&gt;video&lt;/A&gt; for you to see &lt;A href="http://channel9.msdn.com/shows/Continuum/WPFFX-in-Silverlight/" mce_href="http://channel9.msdn.com/shows/Continuum/WPFFX-in-Silverlight/"&gt;watch the demo&lt;/A&gt; with out needing to update your bits to SL3). &lt;/P&gt;
&lt;P&gt;Geeking it out (aka the details): &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Porting the library was trivial,&amp;nbsp; there is&amp;nbsp; probably a total of &amp;lt; 50 #if SILVERLIGHT in the project. They mostly relate to dependency properties ( SL does not do UIPropertyMetadata) and or the use of Vector (not in SL, but Point serves the purpose).. &lt;/LI&gt;
&lt;LI&gt;SL effects are not hardware accelerated ( due to security) but it performs pretty well on my machine.. Let us know if you see otherwise. &lt;/LI&gt;
&lt;LI&gt;Silverlight does not have VisualBrushes,&amp;nbsp; but you can use the new WriteableBitmap to create a snapshot of a visual ala&amp;nbsp; RenderTargetBitmap in WPF so you can create cool transitions.&amp;nbsp;&amp;nbsp; I did it for the start/stop transitions (though I must say I picked some really funky effects for the transitions). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The source is in &lt;A href="http://wpffx.codeplex.com/" target=_blank mce_href="http://wpffx.codeplex.com/"&gt;codeplex&lt;/A&gt;. &lt;BR&gt;Packaging will likely change. Right now it is WPF project with SL project linking to the WPF files (the way I keep it in source control) but&amp;nbsp; I think for easier download, it will become separate zips and I can duplicate the files just for releases (source can still be single shared file).&amp;nbsp;&amp;nbsp; &lt;BR&gt;Please check the pre-requisites in codeplex, you will need latest DirectX SDK, .NET 3.5 SP1 ( or VS 2008 SP1),&amp;nbsp; the Shader Effect build task from &lt;A href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14962" mce_href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=14962"&gt;WPF Futures&lt;/A&gt; and of course SL3 and SL3 tools if you want to run the SL bits. &lt;/P&gt;
&lt;P&gt;More effects pictures: &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/One_2.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/One_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=One border=0 alt=One src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/One_thumb.png" width=384 height=219 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/One_thumb.png"&gt;&lt;/A&gt; &lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/Two_2.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/Two_2.png"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=Two border=0 alt=Two src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/Two_thumb.png" width=384 height=217 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WPFeffectsLibraryrunninginSilverlight3_E9C3/Two_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Pinch + Inverted colors.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Embossed&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Enjoy, please report bugs/issues if needed. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9508904" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/Effects/default.aspx">Effects</category></item><item><title>Microsoft Client Continuum in action: The Silverlight toolkit charts, running in WPF</title><link>http://blogs.msdn.com/jaimer/archive/2008/11/16/microsoft-client-continuum-in-action-the-silverlight-toolkit-charts-running-in-wpf.aspx</link><pubDate>Mon, 17 Nov 2008 10:05:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9107666</guid><dc:creator>jaimer</dc:creator><slash:comments>17</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/9107666.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=9107666</wfw:commentRss><description>&lt;p&gt;The Silverlight toolkit CTP released at PDC includes some new charting functionality&amp;#160; (Column, Bar, Pie, Line, and Scatter).&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;The long-term plan is for all of these controls to be ported to WPF; but inspired by &lt;a href="http://dotnet.org.za/rudi/archive/2008/11/06/wpf-themes-released.aspx"&gt;Rudi&amp;#8217;s work on porting the themes&lt;/a&gt;, I peeked into the task to see if the Microsoft continuum would hold for the controls too. &lt;/p&gt;  &lt;p&gt;The results were darn good, I had the charts project compiled in WPF in ~20 mins; and after that, I only had to make a few run-time tweaks to get the project running&amp;#8230; ( look for the #WPF&amp;#160; pre-processor in the code..&amp;#160;&amp;#160; there is only a handful). &lt;/p&gt;  &lt;p&gt;Since the charting library is an early &amp;quot;preview&amp;quot; quality, I will probably not do a full port or any testing, but in case some one wants to carry it further, the source code is &lt;a href="http://www.cookingwithxaml.com/continuum/samples/sltoolkit.zip"&gt;here&lt;/a&gt;..&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Screenshot follows&amp;#8230;&amp;#160; These are the same charts as in the SL Toolkit sample but running in a WPF app (named Window1 for Rob).. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MicrosoftClientContinuuminactionTheSilve_144B0/WPFSLCharts_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="685" alt="WPFSLCharts" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/MicrosoftClientContinuuminactionTheSilve_144B0/WPFSLCharts_thumb.png" width="766" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9107666" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/continuum/default.aspx">continuum</category></item><item><title>Working with Collections in Deep Zoom.</title><link>http://blogs.msdn.com/jaimer/archive/2008/06/23/working-with-collections-in-deep-zoom.aspx</link><pubDate>Tue, 24 Jun 2008 09:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8645948</guid><dc:creator>jaimer</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8645948.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8645948</wfw:commentRss><description>&lt;P&gt;In the Deep Zoom run-time, you can load two types of compositions: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A single image &lt;STRONG&gt;composition &lt;/STRONG&gt;is when you interact with a single image at run-time.&amp;nbsp; This does not mean you started with a single image, you could start with many images and compose a scene, then you export from Composer and all of the images get 'stitched' into a single composition that you can interact with at run-time.&amp;nbsp; You interact (like zooming, opacity, etc.) with your image by changing the properties of your MultiScaleImage. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;A "&lt;STRONG&gt;Collection of Images&lt;/STRONG&gt;" is when you compose a scene but export it as a collection of images (duh jaime do u get paid by the word? word, word?) &lt;BR&gt;At run-time, you can still interact with each of the individual images in your composition.&amp;nbsp;&amp;nbsp; &lt;BR&gt;The images are exposed via the SubImages collection of your MultiScaleImage.&amp;nbsp;&amp;nbsp; You can still set properties in the MultiScaleImage and these properties will affect all the images in the collection [for example if I Zoom-in to 200% in MSI, that would impact which SubImages are visible] but with collections I also get the benefit of interacting with the SubImages directly. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Collections have a lot more flexibility of course, but I also caution of two tiny concerns: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;when dealing with collections,&amp;nbsp; you likely end up downloading a few more tiles as you go.&amp;nbsp; Not a huge deal &lt;/LI&gt;
&lt;LI&gt;Your images load independently;&amp;nbsp; this again is not a huge deal unless you have huge discrepancies in size; in that case you will see your small images load earlier than your bigger ones.&amp;nbsp; [To solve this you could play with Opacity] &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;This post is about working with Collections, so let's assume I decided the two issues above are not in play (that is the case for most people).&amp;nbsp; &lt;BR&gt;&lt;BR&gt;To find out what we can do with a MultiScaleSubImage, all we need is to look at the class definition: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;AspectRatio&lt;/STRONG&gt; - readonly property ==&amp;nbsp; width/height. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Opacity&lt;/STRONG&gt; = self-explains;&amp;nbsp; 0== transparent.&amp;nbsp; 1.0 == Opaque &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;ViewportOrigin&lt;/STRONG&gt; == top-left corner of the image.&amp;nbsp; Stay tuned for a lot more below. This is a really interesting property and 1/3&amp;nbsp; the point of this post &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;ViewportWidth&lt;/STRONG&gt; == width of the area to be displayed.&amp;nbsp; This value is in logical coordinates. For example: &lt;/LI&gt;
&lt;UL&gt;
&lt;LI&gt;a value of 1 displays the entire image (no zoom), &lt;/LI&gt;
&lt;LI&gt;a value of 0.5 is 200% zoomed in and a value of 0 is completely zoomed (user cannot see the image at all). &lt;/LI&gt;
&lt;LI&gt;A value above 1 is zooming out from the image. For example, a value of 2 means that the image will take up half the size of the MultiScaleImage&amp;nbsp; control area (50% zoom). &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;ZIndex -- self explains;&amp;nbsp; higher numbers are in front of lower ones. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;A few of the less obvious options for dealing with collections are:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Tags &lt;BR&gt;&lt;/STRONG&gt;If you have used Deep Zoom Composer you might have noticed that composer has a property called "Tag" for each image. As of beta2 tag is not exposed via the MultiScaleSubImage.&amp;nbsp; So, how can you get to this Tag? &lt;/P&gt;
&lt;P&gt;The tags are stored in the metadata.xml&amp;nbsp; file generated by Deep Zoom Composer.&amp;nbsp; &lt;BR&gt;You can easily get to this file using WebClient or HttpWebRequest networking APIs in SL2.&amp;nbsp; It is a trivial two step process:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make call to read XML file.&amp;nbsp; I did it from ImageOpenSucceded to not compete with download traffic for image and to know for sure that when WebClient callback happened I could access the images in the collection. &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;void &lt;/SPAN&gt;msi_ImageOpenSucceeded(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;WebClient &lt;/SPAN&gt;wc = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WebClient&lt;/SPAN&gt;(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc.DownloadStringCompleted += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DownloadStringCompletedEventHandler&lt;/SPAN&gt;(wc_DownloadStringCompleted); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc.DownloadStringAsync(&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;"GeneratedImages/Metadata.xml"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #2b91af"&gt;UriKind&lt;/SPAN&gt;.Relative));&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;} &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Then we read the results.&amp;nbsp;&amp;nbsp;&amp;nbsp; The code is below.&amp;nbsp; I used LINQ to XML -that makes it trivial :) &lt;BR&gt;The only thing worth highlighting from the code is the "map" between tags and MultiScaleSubImages.&amp;nbsp; &lt;BR&gt;metadata.xml has a ZOrder, which is a 1-based index of the position of the image in the collection.&amp;nbsp;&amp;nbsp; Despite its name (ZOrder), this has nothing to do with MultiScaleImage.ZIndex . &lt;BR&gt;&lt;BR&gt;The actual collection is 0 based, so we&amp;nbsp; subtract one to the value read from metadata.xml&amp;nbsp;&amp;nbsp;&amp;nbsp; I have put red, highlighted comments on top the two most relevant lines . &lt;/LI&gt;&lt;/OL&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;wc_DownloadStringCompleted(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;DownloadStringCompletedEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;(e.Cancelled == &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;&amp;amp;&amp;amp; e.Error == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;s = e.Result; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;XDocument &lt;/SPAN&gt;doc = &lt;SPAN style="COLOR: #2b91af"&gt;XDocument&lt;/SPAN&gt;.Parse(s); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;var &lt;/SPAN&gt;images = &lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt;a &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt;doc.Element(&lt;SPAN style="COLOR: #a31515"&gt;"Metadata"&lt;/SPAN&gt;).Descendants(&lt;SPAN style="COLOR: #a31515"&gt;"Image"&lt;/SPAN&gt;)&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt;a; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;foreach &lt;/SPAN&gt;( &lt;SPAN style="COLOR: #2b91af"&gt;XElement &lt;/SPAN&gt;image &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt;images ) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;CollectionImage &lt;/SPAN&gt;ci = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CollectionImage &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Height = (&lt;SPAN style="COLOR: blue"&gt;double&lt;/SPAN&gt;) image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"Height"&lt;/SPAN&gt;), &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Width = (&lt;SPAN style="COLOR: blue"&gt;double&lt;/SPAN&gt;) image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"Width"&lt;/SPAN&gt;),&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#ff0000&gt;&lt;STRONG&gt;//here we read the ZOrder from metadata.xml and subtract one &lt;/STRONG&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZOrder = ((&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt;) image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"ZOrder"&lt;/SPAN&gt;)) -1 , &lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Tag = (&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;) image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"Tag"&lt;/SPAN&gt;), &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Location = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;{ X = (&lt;SPAN style="COLOR: blue"&gt;double&lt;/SPAN&gt;)image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"x"&lt;/SPAN&gt;), Y = (&lt;SPAN style="COLOR: blue"&gt;double&lt;/SPAN&gt;) image.Element(&lt;SPAN style="COLOR: #a31515"&gt;"y"&lt;/SPAN&gt;)} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;//here we map from the SubImages collection based on the ZOrder we read &lt;BR&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ci.Image = msi.SubImages[ci.ZOrder]; &lt;BR&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _images.Add ( ci ) ; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; items.ItemsSource = _images; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;If you look at the code, I created a CollectionImage which aggregates the stuff from metadata.xml and the corresponding MultiScaleSubImage.&amp;nbsp; &lt;BR&gt;This means I could now filter, or do any thing since the data is merged.&amp;nbsp; &lt;A href="http://blog.kirupa.com/?p=212" target=_blank mce_href="http://blog.kirupa.com/?p=212"&gt;Kirupa has an example of using tags to filter&lt;/A&gt; (so I will stop here on that topic and move to Viewports).&amp;nbsp; &lt;BR&gt;&amp;nbsp; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;ViewportOrigin: &lt;BR&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;ViewportOrigin represents the left(x), top(y) corner of your SubImage relative to the MultiScaleImage control.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;The surprise (for me at least) is that:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;They are normalized relative to the viewportWidth of the subimage you are dealing with. &lt;/LI&gt;
&lt;LI&gt;Moving towards the right in the horizontal ( X) direction is actually a negative offset, so is moving towards the bottom. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Got it?? OK! you are done.&amp;nbsp;&amp;nbsp; &lt;BR&gt;If you are like me&amp;nbsp; you might want to see a sample.&amp;nbsp; Here are some below:&amp;nbsp; &lt;BR&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=800 border=2&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=259&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_2.png" target=_blank mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=165 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;This is a DeepZoom composition w/ two images.&amp;nbsp; &lt;BR&gt;Blue is 1200x800&amp;nbsp; ( Aspect ratio = 1.5 ) &lt;BR&gt;Yellow is 600x400 ( AR = 1.5 ) &lt;BR&gt;&lt;BR&gt;At this point ViewportOrigin = 0,0 for both...&amp;nbsp;&amp;nbsp; Looks good to me. &lt;BR&gt;&lt;BR&gt;It is worth mentioning [if you try to make sense as you go ] that the &lt;BR&gt;ViewportWidth for blue == 1.0&amp;nbsp; [takes the whole width available] &lt;BR&gt;ViewportWidth for yellow == 2.0&amp;nbsp; [takes 1/2 the width available to the control] &lt;BR&gt;&lt;BR&gt;The numbers on the images are "approximations".. if you read a coord of say 900,600 that means it is around there, but not quite exact &lt;BR&gt;&lt;BR&gt;Let's now start changing ViewportOrigin. &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=261&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_4.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=164 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_1.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;Here I simply changed viewportOrigin in yellow image. &lt;BR&gt;&lt;BR&gt;My first instinct looking at this one would be&amp;nbsp; 1,0 ... [since it is 600 pixels left of 0,0] &lt;BR&gt;I was wrong!! &lt;BR&gt;This is actually ViewportOrigin =&amp;nbsp; -1, 0.. &lt;BR&gt;Remember, when you move an image to right or bottom, the offsets are negative. &lt;BR&gt;&lt;BR&gt;You want to know what would happen if VO was 1,0?? &lt;BR&gt;The demo is at&amp;nbsp; &lt;A title=http://www.cookingwithxaml.com/recipes/DeepZoomCollection/ href="http://www.cookingwithxaml.com/recipes/DeepZoomCollection/default.html" target=_blank mce_href="http://www.cookingwithxaml.com/recipes/DeepZoomCollection/default.html"&gt;http://www.cookingwithxaml.com/recipes/DeepZoomCollection/default.html&lt;/A&gt; &lt;BR&gt;&lt;BR&gt;You can play with ZIndex, Opacity and ViewportOrigin for each image [their values are databound on the grid]. &lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=262&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_6.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=164 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_2.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;Having explained that the ViewportOrigins offsets (to right,bottom) are negative numbers. &lt;BR&gt;Can you guess what the offset is for the image to the right? &lt;BR&gt;My guess was ( 0, -1) but then&amp;nbsp; I was wrong again!&amp;nbsp;&amp;nbsp; &lt;BR&gt;The ViewportOrigin here is ( 0, -.66666666666) &lt;BR&gt;Why? &lt;BR&gt;&lt;BR&gt;Because the offsets are relative to the Width and in this case it is 600. &lt;BR&gt;So a viewport of (0,-1) would have been lower in the y axis [instead of at 400, it would be at 600] &lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=262&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_8.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=163 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_3.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_3.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;This is 0,-1 and exactly what we expected for this one (after reading line above). &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=262&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=162 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_4.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;I know you have it by now, but just for fun, this is&amp;nbsp; ( -1.5, -.3333)&amp;nbsp; aka ( 900,200) &lt;BR&gt;Notice how half of our yellow image is clipped.&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=262&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_12.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_12.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=165 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_5.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/WorkingwithCollectionsinDeepZoom_11AFF/image_thumb_5.png"&gt;&lt;/A&gt; &lt;/TD&gt;
&lt;TD class="" vAlign=top width=539&gt;This is ViewportOrigin ( 0.5, -.3333 ) ... I figured I should show you some thing with a positive value for Viewport Origin...&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;BR&gt;&amp;nbsp; &lt;BR&gt;Again, you can play with the ugly but hopefully useful sample &lt;A href="http://www.cookingwithxaml.com/recipes/DeepZoomCollection/" target=_blank mce_href="http://www.cookingwithxaml.com/recipes/DeepZoomCollection/"&gt;here&lt;/A&gt;..&amp;nbsp; &lt;BR&gt;Just change the ViewportOrigin, or any other property and see what happens. &lt;BR&gt;You can use the same sample to play with Opacity, ZIndex&amp;nbsp; and ViewportWidth..&amp;nbsp;&amp;nbsp; this will show you the flexibility in collections. &lt;BR&gt;Don't get tricky with the values as there is no validation. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Mapping SubImages to Element Coordinates &lt;/STRONG&gt;&lt;BR&gt;Now that we understand ViewportWidth and ViewportOrigin,&amp;nbsp; we can map from logical coordinates to element coordinates so we can put overlays on our MultiScaleImage.&amp;nbsp; Or do hit testing or any thing similar. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;What I did is put a small pink rectangle in the page and I am going to listen to MouseMove on the MultiScaleImage and then do kind of a "hit testing" to see which Image I am over.&amp;nbsp; I used ZIndex to select only the single image on the front. If you did not use ZIndex you can select multiple. &lt;BR&gt;&lt;BR&gt;So, what does the map look like??&amp;nbsp;&amp;nbsp; The whole code is below commented in detail..&amp;nbsp; I hope that makes it easiest to explain -instead of my rambles-. &lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Gets a rectangle representing the top-most image that the mouse is over
&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="elementPoint"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Mouse Position, in Element Coordinates&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
/// &amp;lt;returns&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Rectangle reprsenting Element Coordinates for the image or 0,0,0,0 if not over an image&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Rect &lt;/SPAN&gt;SubImageHitTestUsingElement(&lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;elementPoint)
{
    &lt;SPAN style="COLOR: #2b91af"&gt;Rect &lt;/SPAN&gt;resultRect = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Rect&lt;/SPAN&gt;(0, 0, 0, 0);
    &lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;zIndex = 0;

    &lt;SPAN style="COLOR: green"&gt;// We loop through all our images. 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;for &lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;int &lt;/SPAN&gt;i = 0; i &amp;lt; _images.Count; i++)
    {
        &lt;SPAN style="COLOR: blue"&gt;try
        &lt;/SPAN&gt;{
            &lt;SPAN style="COLOR: green"&gt;// Selct our MSSI. 
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MultiScaleSubImage &lt;/SPAN&gt;subImage = _images[i].Image;

            &lt;SPAN style="COLOR: green"&gt;// NOTICE the scale is a mutliplication of the size of our image (1 / subImage.ViewportWidth)
            // and the current Zoom level ( 1 / msi.ViewportWidth) 
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;double &lt;/SPAN&gt;scaleBy = 1 / subImage.ViewportWidth * 1 / msi.ViewportWidth;

            &lt;SPAN style="COLOR: green"&gt;// The two lines below convert our image size us from Logical to Element Coords
            // Notice that for Height, we must take into account Aspect ratio. 
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;double &lt;/SPAN&gt;width = scaleBy * &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.msi.ActualWidth;
            &lt;SPAN style="COLOR: blue"&gt;double &lt;/SPAN&gt;height = (scaleBy * &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.msi.ActualWidth * (1 / subImage.AspectRatio));

            &lt;SPAN style="COLOR: green"&gt;// Now we convert our viewportorigin  (logical coords) to Element Coords
            // Reminder, this is top-left ..  Notice that we multiply by -1 since 
            // we saw the negative math for Viewport Origin. 
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;p = msi.LogicalToElementPoint(
                &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(
                     -subImage.ViewportOrigin.X * 1 / subImage.ViewportWidth,
                    - subImage.ViewportOrigin.Y * 1 / subImage.ViewportWidth));
             
            &lt;SPAN style="COLOR: green"&gt;// Now we create a Rectangle in Element Coords. 
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Rect &lt;/SPAN&gt;subImageRect = &lt;SPAN style="COLOR: blue"&gt;new
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Rect&lt;/SPAN&gt;(p.X, p.Y, width, height);

            &lt;SPAN style="COLOR: green"&gt;// here we hitTest, using Contains.. 
            // and we keep track of the front-most element only..                    
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(subImageRect.Contains(elementPoint))
            {
                &lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(subImage.ZIndex &amp;gt;= zIndex)
                {

                    zIndex = subImage.ZIndex;
                    resultRect = subImageRect;                            
                }
            }
        }
        &lt;SPAN style="COLOR: blue"&gt;catch &lt;/SPAN&gt;(&lt;SPAN style="COLOR: #2b91af"&gt;Exception &lt;/SPAN&gt;ex)
        {
            System.Diagnostics.&lt;SPAN style="COLOR: #2b91af"&gt;Debug&lt;/SPAN&gt;.WriteLine(ex.Message); 
        } 
    }
    System.Diagnostics.&lt;SPAN style="COLOR: #2b91af"&gt;Debug&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Done"&lt;/SPAN&gt;);
    &lt;SPAN style="COLOR: blue"&gt;return &lt;/SPAN&gt;resultRect;
} &lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;&lt;BR&gt;I used Element Coords because that is what I was after. If you want logical coords, it should be easy from code above..&amp;nbsp; &lt;BR&gt;Just convert the point to Logical, do the scaling for zoom and hittest against a logical rect... &lt;BR&gt;&lt;BR&gt;Fair enough???&amp;nbsp;&amp;nbsp; The source is [you guessed it] at &lt;A href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/DeepZoomCollections.zip" mce_href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/DeepZoomCollections.zip"&gt;Skydrive&lt;/A&gt;. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;You can see a few tiny issues I did not care much for: &lt;BR&gt;1) My math is rounded so some times you see the 'Rectangle' I created be slightly off (adding some extra pixels should do fine) ... &lt;BR&gt;2) I did the recalculation for rectangle only on mouse move..&amp;nbsp; and I did not do it on Pan... so if you Zoom using Wheel or you pan, it will take for you to move the mouse one more time in order for Rectangle overlay to update. &lt;/P&gt;
&lt;P&gt;That is my part!!&amp;nbsp; Now it is up to you to build some thing really cool using real images and hittesting.. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8645948" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/deepzoom/default.aspx">deepzoom</category></item><item><title>Installing Silverlight no longer requires a browser re-start… woohoo!!!</title><link>http://blogs.msdn.com/jaimer/archive/2008/05/02/installing-silverlight-no-longer-requires-a-browser-re-start-woohoo.aspx</link><pubDate>Sat, 03 May 2008 09:06:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8453741</guid><dc:creator>jaimer</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8453741.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8453741</wfw:commentRss><description>&lt;P&gt;A few weeks ago I noticed changes in browser's behaviors…&amp;nbsp; &lt;/P&gt;
&lt;P&gt;1) My IE&amp;nbsp; 7.0.6000&amp;nbsp; no longer prompts for Click To Activate&amp;nbsp; :) &lt;/P&gt;
&lt;P&gt;2) My firefox 2.0.0.13&amp;nbsp;&amp;nbsp; no longer required a reboot after installing Silverlight …&amp;nbsp; If you had not noticed, using silverlight.js on IE allowed you to instantiate silverlight plugin right after installing , but on other browsers it required a re-start…&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I pinged Piotr, our deployment PM, asking if he was seeing the same and he upped it sharing that he had a way to instantiate silverlight on ANY PLATFORM and ANY browser WITH OUT requiring A RE-START…&amp;nbsp; [call me a geek, but I was happy]..&amp;nbsp;&amp;nbsp; Today, he posted the blog with the magic call: &lt;STRONG&gt;navigator.plugins.refresh () &lt;/STRONG&gt;…&amp;nbsp;&amp;nbsp; &lt;A href="http://blogs.msdn.com/piotrp/archive/2008/05/02/automatically-start-silverlight-on-install.aspx" mce_href="http://blogs.msdn.com/piotrp/archive/2008/05/02/automatically-start-silverlight-on-install.aspx"&gt;Check it out yourself&lt;/A&gt;…&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;BR&gt;I hear the&amp;nbsp; next version of Silverlight.js (when we next release an SDK) will include these changes; in the mean time you can take his advise and use &lt;STRONG&gt;navigator.plugins.refresh () &lt;/STRONG&gt;to get around the re-boot issue and instantiate SL right after installing…&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;[caveat: this does not work if silverlight is being updated, and the plugin was loaded, but that scenario is not common since silverlight auto-updates itself] … &lt;/P&gt;
&lt;P&gt;Thanks &lt;A href="http://blogs.msdn.com/piotrp" mce_href="http://blogs.msdn.com/piotrp"&gt;Piotr&lt;/A&gt;, and welcome to blogging..&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8453741" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>Viewbox for Silverlight2</title><link>http://blogs.msdn.com/jaimer/archive/2008/04/29/viewbox-for-silverlight2.aspx</link><pubDate>Tue, 29 Apr 2008 10:34:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8436710</guid><dc:creator>jaimer</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8436710.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8436710</wfw:commentRss><description>&lt;p&gt;Viewbox is a pretty handy 'container' in WPF..&amp;#160;&amp;#160; It is a decorator that scales its child content to the size available to the viewbox ( if child is smaller it scales it up &amp;gt;1, if child is bigger it scales it down such that it fits based on some stretch direction). &lt;/p&gt;  &lt;p&gt;You can find source code for a sample viewbox &lt;a href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/SL2Samples.zip"&gt;here&lt;/a&gt;.&amp;#160; &lt;br /&gt;    &lt;br /&gt;If you want to see a ugly (yet still useful for those knowing viewbox) harness, there is a &lt;a href="http://www.cookingwithxaml.com/recipes/viewbox/"&gt;sample here&lt;/a&gt;..     &lt;br /&gt;    &lt;br /&gt;Sorry for no docs; the control itself is straight forward.&amp;#160; Please &lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.controls.viewbox.aspx"&gt;check the docs&lt;/a&gt; for WPF viewbox to see how to use it; the SL2 version above mimics WPF.     &lt;br /&gt;    &lt;br /&gt;Please do review the source if you are using it for a real project. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Cheers, &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8436710" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>Some of the Silverlight blogs I read..</title><link>http://blogs.msdn.com/jaimer/archive/2008/04/29/some-of-the-silverlight-blogs-i-read.aspx</link><pubDate>Tue, 29 Apr 2008 10:11:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8432978</guid><dc:creator>jaimer</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8432978.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8432978</wfw:commentRss><description>&lt;p&gt;This one got stuck on my drafts on 4/10&amp;#8230; sorry &amp;#8230;&amp;#160;&amp;#160; (FYI, I am back from my trip; more on that soon ) &amp;#8230; &lt;/p&gt;  &lt;p&gt;- &amp;#8211;-&amp;#160; -&amp;#8212;-&amp;#8212; -- - &lt;/p&gt;  &lt;p&gt;I am out all next 1.5 weeks talking to ISVs in EMEA about WPF and Silverlight&amp;#8230; Should be so much fun that I won&amp;#8217;t have time to blog :(..&amp;#160; in the mean time, &lt;a href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/silverlight.opml.zip"&gt;here is an OPML of the Silverlight blogs&lt;/a&gt; I read&amp;#8230;&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;If your blog is missing or you want to recommend some one else&amp;#8217;s blog, please email me or leave comments&amp;#8230; &lt;/p&gt;  &lt;p&gt;Again, OPML is &lt;a href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/silverlight.opml.zip"&gt;here&lt;/a&gt;. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8432978" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>built-in Styling and generic.xaml</title><link>http://blogs.msdn.com/jaimer/archive/2008/04/08/built-in-styling-and-generic-xaml.aspx</link><pubDate>Tue, 08 Apr 2008 23:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8369956</guid><dc:creator>jaimer</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8369956.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8369956</wfw:commentRss><description>&lt;P&gt;Most people already know (from ScottGu’s blog post for example)&amp;nbsp; that in Silverlight 2 you can override the ControlTemplate for a Control and ‘re-define’ the look of the control.&amp;nbsp; However, I have received a few questions around the use of generic.xaml to accomplish this same task; I will try to share a few thoughts on this to tease you into digging deeper on your own.&amp;nbsp;&amp;nbsp; If you are short on time, skip to &lt;A href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4419&amp;amp;postid=8369956#faq" mce_href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx?SelectedNavItem=Posts&amp;amp;sectionid=4419&amp;amp;postid=8369956#faq"&gt;[FAQs on built-in styles below]&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Some definitions on the recurrent “what is difference between style and template?”&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Style is an object (in Markup or in Code) that sets properties of a control.&amp;nbsp; &lt;BR&gt;All that a style can do is set the value of existing properties on the control.&amp;nbsp; Imagine our control was a Car, a Style could say some thing like “wheelsize=17”, bodycolor=”cherry red”, “windowtreatment=”tinted”, etc..&amp;nbsp; &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;A template actually defines the pieces or parts of the car. For example, a template for a cheap convertible might not have a roof at all :)&amp;nbsp; or a template for a Car can decide if it is two doors or four doors, if it has four wheels or eight, etc.&amp;nbsp; &lt;BR&gt;When I explain it I always tell people, the template defines the skeleton, the Style dresses the pirate ( I like the pirate analogy cause some of them have one eye, or one leg, or one arm, etc. making good use of Templates). &lt;/P&gt;
&lt;P&gt;Where things get interesting is that a Style can set any property in the control, and Template is itself a property, so what you see the tools (like Blend) do most often is when you want to override the Template of a Control, they override the whole style and the Template property with it.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Stay with me… even if the above does not make sense, the rest of the article will help. &lt;/P&gt;
&lt;P&gt;Where generic.xaml comes in is in the “magic” that defines the default look for a control.&amp;nbsp; Let’s imagine we want to create a GelButton ..&amp;nbsp; &lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;public class &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;GelButton &lt;/SPAN&gt;: &lt;SPAN style="COLOR: #2b91af"&gt;Button    
&lt;/SPAN&gt;{

}&lt;BR&gt;&lt;BR&gt;Simple enough, now we want to use it in our Page.xaml user control, we add the namespace and the control.&lt;/PRE&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="StylingSample.Page"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/client/2007" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&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;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="400" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="300" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="clr-namespace:StylingSample"&amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50" &amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Button &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Top"  &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50"/&amp;gt; 
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Cream" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50"&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Button &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Bottom" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50"&amp;gt; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Button&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;    
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;Would you be surprised if the outcome looked like this? &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=159 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb.png" width=64 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I can’t tell you if you should be surprised or not (I am undecided myself), but I can tell you what happened! &lt;BR&gt;&lt;BR&gt;The control by default is lookless. You need to define the look for it. This is accomplished by assigning a valid ControlTemplate to the control&amp;nbsp; [via the Template property in the Control class]. &lt;BR&gt;&lt;/P&gt;
&lt;P&gt;To assign the Template property, you could do some thing like: &lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;public GelButton ()&lt;BR&gt;{ &lt;BR&gt;this&lt;/SPAN&gt;.Template = &lt;SPAN style="COLOR: #2b91af"&gt;XamlReader&lt;/SPAN&gt;.Load (&lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;ControlTemplate xmlns='http://schemas.microsoft.com/client/2007'&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt; &amp;gt;&amp;lt;Grid ..&amp;gt; &amp;lt;/Grid&amp;gt;&amp;lt;/ControlTemplate&amp;gt;"&lt;/SPAN&gt;); &lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;} &lt;/P&gt;
&lt;P&gt;but a better way to do it is to store the control template in a generic.xaml Resource Dictionary and then magically the run-time, will pick it up from there. Your template would be associated to your control via the TargetType attribute when defining the resource.&amp;nbsp; This template would now become what we call the “built-in style”. &lt;/P&gt;
&lt;P&gt;Here are the details on creating a built-in style. &lt;/P&gt;
&lt;P&gt;Generic.xaml is a ResourceDictionary –a property bag for resources – that you include in your assembly, at the root of the project.&amp;nbsp; If you are a WPFer you might be thinking it should be in themes\generic.xaml, I hear that is where it might end up, but for now (Silverlight 2 beta1), it needs to be in the root of the project.&amp;nbsp; The default (empty)&amp;nbsp; resource generic.xaml could look like this:&lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/client/2007" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&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" 
&amp;gt; 
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;For defining the look &amp;amp; feel for our GelButton we need to start with some default template. Long term, this will be a right click inside Blend&amp;nbsp; (like in WPF); temporarily since Blend does not yet support styling,&amp;nbsp; I would recommend is using David Anson’s handy &lt;A href="http://blogs.msdn.com/delay/archive/2008/03/22/improved-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-available-via-clickonce.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/03/22/improved-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-available-via-clickonce.aspx"&gt;Stylebrowser application&lt;/A&gt; to copy the default Style for button and paste it into the resource dictionary. &lt;/P&gt;
&lt;P&gt;[unfortunately the default button template is too verbose, so for practical purposes here I am going to use a much simpler template]. &lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/client/2007" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&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;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="clr-namespace:StylingSample;assembly=StylingSample"
&amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="samples:GelButton"&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&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;="Black" /&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Foreground" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="White" /&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Template"&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ControlTemplate  &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="samples:GelButton"&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Grid &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="RootElement" &amp;gt;
                        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Ellipse &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&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: #a31515"&gt;TemplateBinding &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: red"&gt;Fill&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;}"
                        /&amp;gt; 
                        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentPresenter 
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;}" 
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ContentTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;ContentTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;}" 
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Foreground&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Foreground&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;}" 
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;VerticalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Center" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Center"
                        /&amp;gt;
                    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ControlTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;Let’s dissect the work needed to create this template: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Added a xmlns:samples to the resource dictionary. &lt;BR&gt;Notice the slightly different syntax from the namespaces you add to say a UserControl; in generic.xaml I included the assembly (which is the name of my DLL). &lt;BR&gt;If I had tried &lt;SPAN style="COLOR: blue"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="clr-namespace:StylingSample;&lt;/SPAN&gt; with out the assembly=”StylingSample” it would not work. [trust me, I make that mistake often]. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Next I defined the style and I told it the TargetType I wanted this Style to be applied to; you usually do this when defining a Style so your template can do discovery of the properties and validate these, but when doing this in generic.xaml, the magic that happens on built-in templates uses this information to create a relationship (or I would say bind) between this Style and the type; now when ever the type is instantiated, if no other style is applied, this style will be used as the default style. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;The rest is simple styling stuff.&amp;nbsp; TemplateBinding is probably the most interesting part, this creates a binding between the property we are setting and the actual controls’ property. For example:&amp;nbsp; &amp;lt;ContentPresenter Foreground={TemplateBinding Foreground}" &amp;gt; creates a bind between the content presenter’s foreground and the Foreground in the actual control.&amp;nbsp; This will our UI styleabe from within the tools. Inside Blend or in XAML you can declare a button &amp;lt;GelButton Foreground=”Red” &amp;gt; or a &amp;lt;GelButton Foreground=White&amp;gt; and get flexibility as the template will get the value carried through. F &lt;BR&gt;For more info on all of this you should watch &lt;A href="http://www.scorbs.com/" mce_href="http://www.scorbs.com"&gt;Karen Corby&lt;/A&gt;’s &lt;A href="http://msstudios.vo.llnwd.net/o21/mix08/08_WMVs/T20.wmv" mce_href="http://msstudios.vo.llnwd.net/o21/mix08/08_WMVs/T20.wmv"&gt;MIX presentation&lt;/A&gt; on “Rich,Dynamic UIs” .. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Now, I can run the same code, with changing nothing other than the Resource dictionary I added and I get:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=156 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb_1.png" width=63 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb_1.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Since I did create a Templatebinding for background/Foreground , I can even have some fun..&amp;nbsp; After all, I promised some “meat”.. Need food!! sorry about that it is 1:30 PM .. &lt;/P&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=702 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=468&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="StylingSample.Page"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/client/2007" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&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;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="400" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="300" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="clr-namespace:StylingSample"&amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="50" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0,20,0,0"&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&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;="20.4" 
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;RenderTransformOrigin&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.5,0.5" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="48.8" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Canvas.ZIndex&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="2"&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RadialGradientBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFF5DEB3"/&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFE0B05C" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Offset&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.826"/&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RadialGradientBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt; 
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Ham" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="16" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Canvas.ZIndex&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="1"&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearGradientBrush &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;EndPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.5,1" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;StartPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.5,0"&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFD64141"/&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFE23939" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Offset&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="1"/&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FEDAB6B6" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Offset&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.43299999833106995"/&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearGradientBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Content&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;="16"  &amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RadialGradientBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFF5DEB3"/&amp;gt;
                    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GradientStop &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Color&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="#FFECC06E" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Offset&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="0.991"/&amp;gt;
                &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RadialGradientBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
            &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton.Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;samples&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;GelButton&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;    
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=228&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_6.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=141 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb_2.png" width=131 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Stylingandgeneric.xamlpart1of_14FEE/image_thumb_2.png"&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;So, I just wasted 10 mins of your time and 40 of mine introducing you to generic.xaml and built-in styles.&amp;nbsp; I had promised to answer a few questions, here they are: &lt;/P&gt;&lt;A class="" title=faq name=faq&gt;&lt;/A&gt;[REF: FAQs on built-in styles] 
&lt;P&gt;&lt;STRONG&gt;What are the benefits of built-in styles, why use generic.xaml instead of hardcoding the template? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;It is nice to store all your templates in a resource dictionary that you can easily swap – as opposed to having to do it in code-.&amp;nbsp;&amp;nbsp; Imagine you needed to create three themes for your app, doing it with hardcoded templates would be hard. &lt;BR&gt;Also, If you put your Template in the ResourceDictionary the template can now reference other resources in the dictionary itself. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Why is it that all examples I have seen are not using built-in styles?&amp;nbsp; we are always told to apply the style inline from App.xaml &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Built-in styles are designed for control authors, when you write a control, you provide look &amp;amp; feel.&amp;nbsp; If you look at example above, I had to inherited from Button class.&amp;nbsp; Most samples are purely styling a button, so they take a different approach. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;In the financials demonstrator, you inherited from Button and did nothing other than provide the built-in style, is this a best practice? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I liked that approach (but I come from an enterprise background where we create bloated frameworks that often inherit just to create an abstraction in case some thing changes later) ; the one benefit you get is you can use your button any where with out having to explicitly refer to a style.&amp;nbsp; &lt;BR&gt;The disadvantage of course is that inheriting takes a bit of extra performance and memory; but this is pretty negligible from what I have seen.&amp;nbsp; &lt;BR&gt;&lt;BR&gt;Again, I don’t call it a best practice, more of a personal preference for me.&amp;nbsp; If you look at financials demonstrator now, I ended up adding a property later UseReflection, so now the button does have a reason to be its own class.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Built-in styles sounds like I can change it all in one place? I don’t want to crowd my code with &amp;lt;Button Style=”{StaticResource GelButtonStyle}” &amp;gt;. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;That is right, if you can afford inheriting and the classes are not sealed.&amp;nbsp; That said, after building a few solutions I realized I had a false sense of centralization&amp;nbsp; [yes I made up the term].&amp;nbsp; &lt;BR&gt;The argument is &lt;/P&gt;
&lt;P&gt;1) With built-in styles, I can change the style in one place. It is the same using App.xaml you change the style itself in one place for all.&amp;nbsp; What you are replicating a lot is the name of the style, but the style itself is in one place. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;When can I not use built-in styles?&amp;nbsp; &lt;BR&gt;&lt;/STRONG&gt;if the class was sealed or they had protected the Template property then you would not be able to use this. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Can I just create a generic.xaml and override the System.Windows.Controls templates with out inheriting? &lt;BR&gt;&lt;/STRONG&gt;Not that I know of. It does not sound like a good idea; I tried it just to see if it worked and it did not work for me. &lt;BR&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Is applying a built-in style going to break or affect my state and parts? &lt;BR&gt;&lt;/STRONG&gt;No. As long as your style uses the same names, the code will still pick all that as if it was an inline Style. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;We would not need built-in styles if you allowed TargetType every where, including on regular dictionaries, like WPF does. &lt;BR&gt;&lt;/STRONG&gt;Fair point, these features are all being considered for later versions after 2.0 stay tuned, right now this way works, it is flexible and comprehensive. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Will this approach work with Blend? Will I still be able to style in Blend. &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Yes!&amp;nbsp; Blend works with this already; that is how it picks the look &amp;amp; feel for System.WIndows.Controls today. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Why do styles &amp;amp; Control templates always go together? Can I just do my Control template? &lt;BR&gt;&lt;/STRONG&gt;My personal opinion is that if you need a template and not the style your template might be too stringent or too hard coded; it would be the equivalent of writing a ControlTemplate that does not have any TemplateBinding on it; don’t get me wrong, I am not saying this is wrong, I am just saying 99% of the time, this does not happen. With regards to simply providing the ControlTemplate in generic.xaml,&amp;nbsp; I don’t believe that would work. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;In the financials demonstrator, you named your class Button, for some thing that inherited from Sysetm.Windows.Controls.Button.. Is using the same name required? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Absolutely not. I chose the name because I was going to override all controls, but I ended up changing my mind and that made it more confusing. Sorry about that; the name does not matter (as long as it does not conflict); from experience calling it Button will confuse you, don’t do that. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;If I use the built-in style, does that mean a ‘consumer’ of my button will not be able to style the button later? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;No!&lt;STRONG&gt; &lt;/STRONG&gt;A consumer will still be able to style the button later and as well as override your template. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;-- &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;OK, I need to go eat.&amp;nbsp; This at least answers the questions I had; will try to come back to this at a different time. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8369956" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>Silverlight instantiation on 2.0</title><link>http://blogs.msdn.com/jaimer/archive/2008/04/03/silverlight-instantiation-on-2-0.aspx</link><pubDate>Fri, 04 Apr 2008 02:10:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8355234</guid><dc:creator>jaimer</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8355234.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8355234</wfw:commentRss><description>&lt;p&gt;On my &lt;a href="http://blogs.msdn.com/jaimer/archive/2008/03/31/a-deepzoom-primer-explained-and-coded.aspx"&gt;Deep zoom Post&lt;/a&gt;, I recommended that for Deep Zoom applications you instantiate the control using Silverlight.js to avoid the Click To Activate.&amp;#160;&amp;#160; &lt;br /&gt;    &lt;br /&gt;Some one picked on this and asked why the new default is using OBJECT. Here is what I know (and most of it comes from past emails with Piotr Puszkiewicz).     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;Using the OBJECT tag has a few advantages:&amp;#160; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Customizing the experience is much easier ..&amp;#160; All you do is put your install experience inside the object tag.&amp;#160; For example, the defult puts an anchor with the GetSilverlight image:      &lt;pre class="code"&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;object &lt;/span&gt;&lt;span style="color: red"&gt;data&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;data:application/x-silverlight,&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;&amp;#8230;&amp;gt; &lt;br /&gt;&amp;lt;!&amp;#8212;This is the isntall experience &amp;#8211;-&amp;gt; &lt;/span&gt;&lt;span style="color: blue"&gt;
  &lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;a &lt;/span&gt;&lt;span style="color: red"&gt;href&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;http://go.microsoft.com/fwlink/?LinkID=108182&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;text-decoration: none;&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: #a31515"&gt;img &lt;/span&gt;&lt;span style="color: red"&gt;src&lt;/span&gt;&lt;span style="color: blue"&gt;=&lt;a href="http://go.microsoft.com/fwlink/?LinkId=108181"&gt;http://go.microsoft.com/fwlink/?LinkId=108181&lt;/a&gt; &lt;br /&gt;&lt;/span&gt;&lt;span style="color: red"&gt;      alt&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;Get Microsoft Silverlight&amp;quot; &lt;/span&gt;&lt;span style="color: red"&gt;style&lt;/span&gt;&lt;span style="color: blue"&gt;=&amp;quot;border-style: none&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;a&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;br /&gt;&amp;lt;!&amp;#8212;- end of  install --&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515"&gt;object&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
    &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;/li&gt;

  &lt;li&gt;No javascript dependency. If your page is hosted some where, your might not be allowed to bring javascript but might not have the object tag blocked, so now you can instantiate with no Javascript.&amp;#160; &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;One less file to download &amp;#8211; which is a huge deal for high traffic portals and hosters. 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;Much easier to create the &amp;#8216;embed&amp;#8217; or send to a friend feature if you are sending an object tag.&amp;#160; This one (and #2) are coupled with the fact that XAPs can be loaded across domains. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So why did we default to &amp;lt;OBJECT /&amp;gt; ?? 
  &lt;br /&gt;Well, because Click To Activate is going away.&amp;#160; IE team &lt;a href="http://blogs.msdn.com/ie/archive/2007/11/08/ie-automatic-component-activation-changes-to-ie-activex-update.aspx"&gt;announced it&lt;/a&gt; and given they said it was in april, we are within&amp;#160; 28 days of this happening.. [Should we start a pool?]. 

  &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;For those of us creating samples today, we obviously have a choice for a few more weeks; I will remain partial to silverlight.js; if you want to come, here is how I get my instantiation: &lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;I created a dummy Silverlight 1.0 solution using Blend 2.5 March CTP. 
    &lt;br /&gt;This creates a good default.html that I can reuse. 

    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;I then copied the silverlight.js from &amp;#8220;\program files\microsoft sdks\silverlight\v2.0\tools\ directory to my new solution. 
    &lt;br /&gt;[I did it mostly because I noticed that was the one updated last and I know the install team put it there] 

    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;Now you edit the default.html to: 
    &lt;ol&gt;
      &lt;li&gt;Comment out the &amp;lt;script&amp;gt; include for page.xaml.js 
        &lt;br /&gt;&amp;lt;!--&amp;#160;&amp;#160;&amp;#160; &amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;Page.xaml.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;#8212;&amp;gt; &lt;/li&gt;

      &lt;li&gt;Comment out the var scene = new Page() declaration.&amp;#160;&amp;#160; &lt;br /&gt;//var scene = new SLOn.Page(); &lt;/li&gt;

      &lt;li&gt;Change the source parameter in createSilverlight call to point to your XAP instead of the XAML file 
        &lt;br /&gt;Silverlight.createObjectEx({ 

        &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; source: &lt;span style="color: #a31515"&gt;&amp;quot;ClientBin/hello.xap&amp;quot;&lt;/span&gt;, &lt;/li&gt;

      &lt;li&gt;Comment out the onLoad handler, which refers to the scene we removed in #1. 
        &lt;br /&gt;//&amp;#160; onLoad: Silverlight.createDelegate(scene, scene.handleLoad), 

        &lt;br /&gt;&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;

  &lt;li&gt;An optional step that I usually do is change the control&amp;#8217;s style so it takes 100% 
    &lt;p&gt;#silverlightControlHost { 
      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; height: 100%; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; width: 100%; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;
  &lt;/li&gt;

  &lt;li&gt;Another optional step is adding the style for body and html so there is no padding: 
    &lt;p&gt;html, body { 
      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; height: 100%; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; overflow: auto; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; } 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; body { 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; padding: 0; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; margin: 0; 

      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;
  &lt;/li&gt;

  &lt;li&gt;If you were doing this for production you would probably also want to tweak the onError handler in createSilverlight.. 
    &lt;br /&gt;&lt;/li&gt;

  &lt;li&gt;After that, I copy my default.html and silverlight.js to the web directory where my solution is at, and browse/navigate to it. 
    &lt;br /&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can get my sample default.html and silverlight.js from &lt;a href="http://cookingwithxaml.com/recipes/instantiate/default.zip"&gt;here&lt;/a&gt;.&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&lt;/p&gt;

&lt;p&gt;Disclaimer: this approach is good for developer samples, for a production app please follow the &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F487DF43-1AFB-4F76-82C8-BB5ACBFFBA1B&amp;amp;displaylang=en"&gt;Silverlight Installation Experience Guide&lt;/a&gt;.&amp;#160; &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8355234" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>Open source charting library for Silverlight 2..</title><link>http://blogs.msdn.com/jaimer/archive/2008/04/02/open-source-charting-library-for-silverlight-2.aspx</link><pubDate>Wed, 02 Apr 2008 22:31:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8352189</guid><dc:creator>jaimer</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8352189.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8352189</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://www.visifire.com"&gt;Visifire&lt;/a&gt; has a free, open-source library for 2D and &amp;#8220;3D looking&amp;#8221; charts built using Silverlight 2..&amp;#160; Very cool!!&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="145" alt="image" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="146" alt="image" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_thumb_1.png" width="244" border="0" /&gt;&lt;/a&gt;&amp;#160;&lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="154" alt="image" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_thumb_3.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;a href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_10.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="150" alt="image" src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/OpensourcechartinglibraryforSilverlight_B01A/image_thumb_4.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;    &lt;br /&gt;For me, this is obviously handy when creating demos and showing Silverlight capabilities; for commercial use they also have a commercial license..&amp;#160;&amp;#160;&amp;#160; &lt;/p&gt;  &lt;p&gt;Emailing them to see if they would be interesting on working with us for their charts to be styled in Blend; in the mean time enjoy the charts and play with them.. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8352189" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item><item><title>A deepzoom primer ( explained and coded)..</title><link>http://blogs.msdn.com/jaimer/archive/2008/03/31/a-deepzoom-primer-explained-and-coded.aspx</link><pubDate>Tue, 01 Apr 2008 08:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8347451</guid><dc:creator>jaimer</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8347451.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8347451</wfw:commentRss><description>&lt;P&gt;I had to learn DeepZoom recently and along the way I put together some handy notes .. below are the notes organized in a near step-by-step explanation format.&amp;nbsp; This is a very long post, but I hope it has useful insights for any one wanting to do deepzoom so I recommend you read it all.&amp;nbsp; If you must skip, then the outline will help you.&amp;nbsp; imo, part 3 and 5 are the good stuff.&amp;nbsp; &lt;BR&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Part 1 – The history and brief explanation on how DeepZoom works. &lt;/P&gt;
&lt;P&gt;Part 2 – Constructing a DeepZoom image using Image Composer &lt;/P&gt;
&lt;P&gt;Part 3 – Introduction to the DeepZoom object model – goes way beyond the docs I hope &lt;/P&gt;
&lt;P&gt;Part 4 – Coding a deepZoom ‘host’ user control with Pan &amp;amp; Zoom &lt;/P&gt;
&lt;P&gt;Part 4.1 – Adding a few extra features to our User Control &lt;/P&gt;
&lt;P&gt;Part 5 – Lessons learned on the code, documenting the gotchas&amp;nbsp; **must read even if you know Deep Zoom already &lt;/P&gt;
&lt;P&gt;Part 6 – Give me the code, just a zip file w/ the goodies&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Part 7 – Show me the outcome; what did we build? &lt;/P&gt;
&lt;H1&gt;Part 1 – The History &amp;amp; Math behind DeepZoom&lt;/H1&gt;
&lt;P&gt;A lot of people equate DeepZoom to SeaDragon – they assume SeaDragon was the code name and DeepZoom is the marketing name-. This assumption is not quite right (unless you equate your engine to your car model).&amp;nbsp; &lt;A href="http://labs.live.com/Seadragon.aspx" mce_href="http://labs.live.com/Seadragon.aspx"&gt;Seadragon&lt;/A&gt; is an incubation project resulting from the acquisition of Seadragon Software; the Seadragon team is part of the Live organization and are working on several projects (like Photosynth). DeepZoom is an implementation that exposes some of the SeaDragon technology to Silverlight. &lt;/P&gt;
&lt;P&gt;DeepZoom provides the ability to smoothly present and navigate large amounts of visual information (images) regardless of the size of the size of the data, and optimizing the bandwidth available to download it.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;
&lt;P&gt;&lt;STRONG&gt;How does DeepZoom work? &lt;BR&gt;&lt;/STRONG&gt;&lt;BR&gt;DeepZoom accomplishes its goal by partitioning an image (or a composition of images) into tiles.&amp;nbsp; While tiling the image, the composer also creates a pyramid of lower resolution tiles for the original composition.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The image to the right shows you what a pyramid; the original image is lowest in the pyramid, notice how it is tiled into smaller images, also notice the pyramid creates lower resolution images (also tiled).&amp;nbsp;&amp;nbsp; A few of the docs I read said the tiles are 256x256, but from peeking through the files generated by the composer I am not convinced; I do know from reading through the internal stuff that there is some heavy math involved here, so I trust they tile for right size :). &lt;/P&gt;
&lt;P&gt;All of this tiling is performed at design-time and gets accomplished using the DeepZoom composer. &lt;/P&gt;
&lt;P&gt;At run-time a MultiScaleImage downloads a lower resolution tile of the image first and downloads the other images on demand (as you pan or zoom); DeepZoom make sure the transitions from lower to higher res images are smooth and seamless.&amp;nbsp; &lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=380&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/PYRPSD_3.jpg" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/PYRPSD_3.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=304 alt=PYRPSD src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/PYRPSD_thumb.jpg" width=404 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/PYRPSD_thumb.jpg"&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;Given all this, &lt;STRONG&gt;how is Deepzoom different than say a ScaleTransform (for zoom) on a high resolution image? &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;With a ScaleTransform, usually you would download the whole high res image at once; this delays how quickly the end user gets to see the image when the page or application loads.&amp;nbsp; Some times people apply a trick where you use different resolutions images, since you are not tiled you will likely end up downloading several big images (consuming more network bandwidth) or the download time will continue to be high if the initial downloaded image is not small enough, also the transitions from low to higher res are going to be more noticeable unless your write the transitions yourself. &lt;/P&gt;
&lt;P&gt;DeepZoom and its tiling make it possible to see bits quicker and can optimize for bandwidth.&amp;nbsp; In the worst case scenario where some one looked at every single one of the tiles at the highest resolution, DeepZoom would have an extra overhead of 33% compared to downloading the single highest resolution image at once, but this ‘worst case’ scenario is almost never hit, most of the time DeepZoom can save you from downloading too much.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Another feature in DeepZoom is its ability to create ‘collections’ from the composite image.&amp;nbsp; This provides you the ability to compose a scene ( group of images ), optimize them for speed &amp;amp; download, but still maintain the ‘autonomy’ and identity of the image, you can programmatically manipulate (or position) these images from within the DeepZoom collection (more on collections in part 4). &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;/P&gt;
&lt;H1&gt;Part 2 – Constructing a DeepZoom Image using DeepZoom composer&amp;nbsp; &lt;/H1&gt;
&lt;OL&gt;
&lt;LI&gt;We begin by downloading the "DeepZoom composer" from &lt;A href="http://download.microsoft.com/download/b/3/5/b352676b-9ea1-4ac8-904f-8d14aa60df84/DeepZoomComposer.msi" mce_href="http://download.microsoft.com/download/b/3/5/b352676b-9ea1-4ac8-904f-8d14aa60df84/DeepZoomComposer.msi"&gt;Microsoft Downloads&lt;/A&gt;. &lt;BR&gt;If you want a great reference for the tool, try the &lt;A href="http://blogs.msdn.com/expression/archive/2008/03/05/deep-zoom-composer-user-guide.aspx" mce_href="http://blogs.msdn.com/expression/archive/2008/03/05/deep-zoom-composer-user-guide.aspx"&gt;DeepZoom Composer guide&lt;/A&gt;. In the steps below, I am going to keep it to the minimum steps needed and some of the gotchas when using the tool. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;After installing the DeepZoom Composer, we launch it.&amp;nbsp; &lt;BR&gt;Trivia facts: Composer is a WPF application, like most of the other Expression products. Also, codename was Mermaid (you can see this from the export window). &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Under the File Menu, select "New Project" 
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=675 border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=396&gt;
&lt;OL&gt;
&lt;OL&gt;
&lt;LI&gt;Select a location to store the project. &lt;BR&gt;I recommend some thing with a short path like c:\users\jaimer\. The composer has some usability issues that make working with long paths a little hard; and the composer will append to your path later when you export. &lt;/LI&gt;
&lt;LI&gt;I called it "EasterEggHunt" as that is what my project will be. &lt;/LI&gt;&lt;/OL&gt;&lt;/OL&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=277&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=147 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb.png" width=244 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb.png"&gt;&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI&gt;
&lt;LI&gt;Now click "Add Image" to import a few images. &lt;BR&gt;You can import multiple images at once.&amp;nbsp; In my case, I am importing 3 images: bummysmall.jpg, eggs.jpg, and world2.jpg). These are in the inputimages directory if your are following along with the source. &lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_4.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=445 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_1.png" width=624 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_1.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;BR&gt;This added all the images we are going to use in the composer.&amp;nbsp; All images must be added at design-time. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Click "Compose"&amp;nbsp; on the Center toolbar to compose the DeepZoom image. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Double click the world image to add it to the 'stage' or design surface. &lt;/LI&gt;
&lt;LI&gt;Click Fit To Screen to maximize our space. &lt;/LI&gt;
&lt;LI&gt;Click on the eggs image&amp;nbsp; to add it to the stage. &lt;/LI&gt;
&lt;LI&gt;Zoom many times into the image at a place where you want to drop some easter eggs. 
&lt;OL&gt;
&lt;LI&gt;Hint:&amp;nbsp; the Usual short cuts of Ctrl+ and Ctrl-&amp;nbsp; do work for zooming. Unfortunately Pan(h) and Select(v) don't work. &lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;
&lt;LI&gt;Shrink the easter eggs into a small size -- don't worry, with DeepZoom we will be able to Zoom a lot at run-time to find them and see them. &lt;/LI&gt;
&lt;LI&gt;Drop the easter eggs where you want to. He is an example of mine, I dropped them in Mexico. Notice I am quite zoomed into the map and the eggs are small. &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_6.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_6.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=388 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_2.png" width=583 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_2.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Repeat the steps in 11 for the bunny picture.&amp;nbsp; In my case,&amp;nbsp; I did it in Seattle area. &lt;BR&gt;Note: unfortunately I could not figure how to drag same image twice into stage area.&amp;nbsp; The work around I used is to make a copy of the image with different name, and add it to the image gallery ( Step 4). &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Click Ctrl-0 to see our DeepZoom Image with out the zooms.&amp;nbsp; You sized it right if you can't easily see the eggs and bunny in the map. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;CLick "Export" in the main toolbar.&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Here we enter the settings for output. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Leave the "generate collection" unchecked for now. &lt;BR&gt;What Generate Collection does is exports the DeepZoom Image with metadata and at run-time the images can be accessed via the MultiScaleImage.SubImages&amp;nbsp; property.&amp;nbsp;&amp;nbsp; If you can get to these images, you can move them around the composed image ( for layout ) you can also tweak their Opacity. &lt;BR&gt;The reason I am leaving them unchecked is beause there seems to be a bug (at least on my machine) where if I click Generate Collections my images at run-time show at an offset of where they are supposed to be.&amp;nbsp;&amp;nbsp; I have reported it to the DZC team and they are investigating. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Enter a Name&amp;nbsp; ( "Easter" on the export Dialog). &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;I leave the Output path untouched. &lt;BR&gt;This is where having entered a short path in Step 2 above would pay up because their Path dialog does not Wrap and it is fairly small. [Kirupa already said this is improving for next version]. If you opt to change the path, be attentive when you export again, it seems to reset to its default value. &lt;BR&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_8.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_8.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=340 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_3.png" width=589 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_3.png"&gt;&lt;/A&gt; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Now, assuming your output looks similar to mine above, (Create Collection unchecked) Click Export and we are done when it says Export Completed. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;BR&gt;&lt;/P&gt;
&lt;H1&gt;Part 3 - DeepZoom Object Model &lt;BR&gt;&lt;/H1&gt;
&lt;P&gt;Once you have a DeepZoom image, you will need an instance of the MultiScaleImage class in your silverlight application to load that image.&amp;nbsp; Instantiating the MultiScaleImage class can be done from XAML &lt;/P&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;MultiScaleImage &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="DeepZoom" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Source&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="easter/info.bin" /&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;P&gt;or from code: &lt;/P&gt;
&lt;P&gt;MultiScaleImage DeepZoom = new MultiScaleImage () ; &lt;/P&gt;
&lt;P&gt;DeepZoom.Source = new Uri ( “easter/info.bin”) ; &lt;/P&gt;
&lt;P&gt;Before&amp;nbsp; going through the DeepZoom API it makes sense to understand the terminology used: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Logical Coordinates – is a normalized value (0 to 1) representing a coordinate in the image itself (not the control) &lt;/LI&gt;
&lt;LI&gt;Element Coordinates – is the actual control coordinates. For example in a MultiScaleImage of Width=800, Height =400, when the mouse is at the center, the element coordinates are 400,400.&amp;nbsp; These coordinates are not normalized. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now, we navigate through the interesting properties and methods in MultiScaleImage&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Source – refers to the Image source; usually info.bin when not using collections or items.bin&amp;nbsp; if using collections.&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;SubImages – when using collections, this is a reference to all the images in a composed DeepZoom Image. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;ViewportWidth – Specifies the width of the parts of the image to be displayed. The value is in Logical coordinates. &lt;BR&gt;For example:&amp;nbsp; &lt;BR&gt;Width=2 means image is zoomed out and only takes half the space available.&amp;nbsp; &lt;BR&gt;To zoom in, a viewport &amp;lt; 1 is required.&amp;nbsp; ViewportWidth of 0.5 is a 200% zoom. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;ViewportOrigin – the Top,Left corner for the parts of the image to be displayed.&amp;nbsp; This is returned in Logical coordinates.&amp;nbsp; For example, imagine I am panning by 10% each time and I pan twice to the right while zoomed in at 100% (so no zoom), my ViewportOrigin.X will be 0.2. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;UseSprings – gets or set whether DeepZoom animates the transitions ( like ZoomAboutLogicalPoint, updates to ViewportOrigin, etc. ). &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The interesting methods are: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ElementToLogicalPoint – takes a coordinate of the control, and gives you a logical ( normalized coordinate). &lt;BR&gt;For example, mouse at Center (400,400) with ViewportWidth=1 and you call ElementToLogical ( ) will return (0.5, 0.5) &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;LogicalToElementPoint – takes a logical coordinate (normalized) and returns a point in the MultiScaleImage control where that logical point corresponds to. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;ZoomAboutLogicalPoint – implements the Zoom.&amp;nbsp; The two parameters are the new zoom multiplier - as an increment from current zoom factor in the image - and the Logical point at which to zoom around.&amp;nbsp; &lt;BR&gt;Example of the incremental zoom would be to ZoomAboutLogicalPoint&amp;nbsp; ( 1.5, 0.5, 0.5) .. I will be zoomed in to 1.5 times;&amp;nbsp; if I repeat this operation with same values I am zoomed in at 1.5 * 1.5&amp;nbsp; which is 2.25 times from size where I started. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In my opinion, surprisingly missing from the API were: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The original width and height of the DeepZoomImage&amp;nbsp; (so that I can translate normalized logical coords to physical on the image). &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Zoom – to tell you the current total Zoom level; this one you can get around by keeping track of any zooms you implement. Another possible workaround is that Zoom appears to be 1/ViewportWidth; I can’t think of the scenario where this does not hold, if there is please let me know and again just keep track of your zooms if that happens. &lt;/LI&gt;&lt;/UL&gt;
&lt;H1&gt;Part 4 – Coding a&amp;nbsp; DeepZoom Host User Control &lt;/H1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;P&gt;The goal here is to code a sample&amp;nbsp; reusable control just to illustrate the points; along the way we will of course implement enough features for our Easter Egg Hunt.&amp;nbsp; [Update: Sorry about belatedness, I started this on 3/22 but had a trip that prevented me from playing around, so I am late from easter] &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Inside Visual Studio 2008, create a new Silverlight Application; I called it DeepZoomSample. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Build the application so the Clientbin directory is created. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Copy the output from the DeepZoom Composer to the Clientbin directory of our Silverlight application. &lt;BR&gt;In my case, I called the output “Easter” so I can go into the output directory from composer and just copy that whole directory to my Silverlight Application’s ClientBin. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Now that we have our image, we can edit the XAML in Page.Xaml, to show the image. &lt;BR&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="DeepZoomSample.Page"
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="http://schemas.microsoft.com/client/2007" 
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&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" 
    &amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Grid &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="LayoutRoot" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Background&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="White"&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;MultiScaleImage &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="DeepZoom" &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;Source&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="easter/info.bin" /&amp;gt; 
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Grid&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UserControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;If you run the application now, you will see the image loads&amp;nbsp; but there is no functionality: zoom and pan have not been implemented.&amp;nbsp; &lt;BR&gt;For zoom, we need to use the mouse wheel, but Silverlight has no native support for it. A good work around is to use Peter Blois’ MouseWheelHelper. This class uses HTML Bridge to listen to the mouse wheel event in the browser and exposes the events to managed code. &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Add a new code file to your project, I called it MouseWheelHelper. &lt;/LI&gt;
&lt;LI&gt;Copy Peter’s code below into the MouseWheelHelper file. &lt;BR&gt;
&lt;DIV style="OVERFLOW: auto; HEIGHT: 300px"&gt;
&lt;P&gt;using System; &lt;BR&gt;using System.Windows; &lt;BR&gt;using System.Windows.Controls; &lt;BR&gt;using System.Windows.Documents; &lt;BR&gt;using System.Windows.Ink; &lt;BR&gt;using System.Windows.Input; &lt;BR&gt;using System.Windows.Media; &lt;BR&gt;using System.Windows.Media.Animation; &lt;BR&gt;using System.Windows.Shapes; &lt;BR&gt;using System.Windows.Browser; &lt;/P&gt;
&lt;P&gt;namespace DeepZoomSample &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this code came from Peter Blois,&amp;nbsp; &lt;A href="http://www.blois.us/blog" mce_href="http://www.blois.us/blog"&gt;http://www.blois.us/blog&lt;/A&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Code ported by Pete blois from Javascript version at &lt;A href="http://adomas.org/javascript-mouse-wheel/" mce_href="http://adomas.org/javascript-mouse-wheel/"&gt;http://adomas.org/javascript-mouse-wheel/&lt;/A&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MouseWheelEventArgs : EventArgs &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private double delta; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool handled = false; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public MouseWheelEventArgs(double delta) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.delta = delta; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public double Delta &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return this.delta; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Use handled to prevent the default browser behavior! &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public bool Handled &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return this.handled; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { this.handled = value; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public class MouseWheelHelper &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public event EventHandler&amp;lt;MouseWheelEventArgs&amp;gt; Moved; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static Worker worker; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private bool isMouseOver = false; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public MouseWheelHelper(FrameworkElement element) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (MouseWheelHelper.worker == null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseWheelHelper.worker = new Worker(); &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseWheelHelper.worker.Moved += this.HandleMouseWheel; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; element.MouseEnter += this.HandleMouseEnter; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; element.MouseLeave += this.HandleMouseLeave; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; element.MouseMove += this.HandleMouseMove; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HandleMouseWheel(object sender, MouseWheelEventArgs args) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (this.isMouseOver) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Moved(this, args); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HandleMouseEnter(object sender, EventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.isMouseOver = true; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HandleMouseLeave(object sender, EventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.isMouseOver = false; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HandleMouseMove(object sender, EventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.isMouseOver = true; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private class Worker &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public event EventHandler&amp;lt;MouseWheelEventArgs&amp;gt; Moved; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Worker() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (HtmlPage.IsEnabled) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HtmlPage.Window.AttachEvent("DOMMouseScroll", this.HandleMouseWheel); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HtmlPage.Window.AttachEvent("onmousewheel", this.HandleMouseWheel); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; HtmlPage.Document.AttachEvent("onmousewheel", this.HandleMouseWheel); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void HandleMouseWheel(object sender, HtmlEventArgs args) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; double delta = 0; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ScriptObject eventObj = args.EventObject; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (eventObj.GetProperty("wheelDelta") != null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delta = ((double)eventObj.GetProperty("wheelDelta")) / 120; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (HtmlPage.Window.GetProperty("opera") != null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delta = -delta; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if (eventObj.GetProperty("detail") != null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delta = -((double)eventObj.GetProperty("detail")) / 3; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (HtmlPage.BrowserInformation.UserAgent.IndexOf("Macintosh") != -1) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; delta = delta * 3; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (delta != 0 &amp;amp;&amp;amp; this.Moved != null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseWheelEventArgs wheelArgs = new MouseWheelEventArgs(delta); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Moved(this, wheelArgs); &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (wheelArgs.Handled) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; args.PreventDefault(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;}&lt;/P&gt;&lt;BR&gt;&lt;/DIV&gt;&lt;BR&gt;&lt;BR&gt;MouseWheelHelper fires a Moved Event whenever the Wheel moves. The EventArgs is a MouseWheelEventArgs, which has the delta property. Delta is a normalized property (0 to 1), for now all we look at is whether it is greater than 0 or not. &lt;BR&gt;If Delta is greater than 0, then the wheel has rotated away from the user; if Delta is a negative number, then the wheel has rotated toward the user. &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Before we handle the Moved event, let’s add a ZoomFactor property to our control, this will be the increment/decrement on a wheel operation. The default value is 1.3, which is a 30% increment.&amp;nbsp; Nothing scientific behind this number, I am pretty much just ‘copying’ what I see every other sample do. I think the number works OK. &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Verdana color=#333333&gt; &lt;/FONT&gt;protected double &lt;/SPAN&gt;_defaultZoom = 1.3; 
       &lt;SPAN style="COLOR: blue"&gt;public double &lt;/SPAN&gt;DefaultZoomFactor
       {
           &lt;SPAN style="COLOR: blue"&gt;get
           &lt;/SPAN&gt;{
               &lt;SPAN style="COLOR: blue"&gt;return &lt;/SPAN&gt;_defaultZoom; 
           }
           &lt;SPAN style="COLOR: blue"&gt;set
           &lt;/SPAN&gt;{
               _defaultZoom = &lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;; 
           } 
       }&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;We also add a CurrentTotalZoom property, this will be a cached version of overall zoom level (since we can’t query this from the MultiScaleImage API.&amp;nbsp; I also added a MaxZoomIn and MaxZoomOut to prevent the image from going too far in (is there such a thing?) or too far out. Too Far out did matter as the image can disapper if you go too far.&amp;nbsp; In my case I picked my Maximum values arbitrarily. &lt;BR&gt;
&lt;DIV style="OVERFLOW: auto; HEIGHT: 300px"&gt;
&lt;P&gt;&lt;BR&gt;private double _currentTotalZoom = 1.0; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public double CurrentTotalZoom &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _currentTotalZoom; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _currentTotalZoom = value; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private double _maxZoomIn = 5000; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected double MaxZoomIn &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _maxZoomIn; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _maxZoomIn = value; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private double _maxZoomOut = 0.001; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected double MaxZoomOut &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get { return _maxZoomOut; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set { _maxZoomOut = value; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/P&gt;&lt;/DIV&gt;&lt;PRE class=code&gt;&lt;FONT color=#0000ff&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now, we can add a DoZoom function to our class, this will be called when there is a Zoom operation.&amp;nbsp;&amp;nbsp; The parameters for it are: the new Zoom level RELATIVE to where the image is at,&amp;nbsp; and&amp;nbsp; a point in Element Coordinates since most likely we will be zooming around the mouse, and we get Element coordiantes out of that. &lt;PRE class=code&gt;&lt;FONT color=#808080&gt;&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
      /// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Performs a Zoom operation relative to where Image is at. 
      &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Example, call DoZoom twice with a Zoom of 1.25 will lead to an image that is zoomed at 
      &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;1.25 after first time and ( 1.25 * 1.25 for second time, which is a 1.56
      &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
      /// &amp;lt;param name="relativeZoom"&amp;gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;new zoom level; this is a RELATIVE value not absolute.&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;
      /// &amp;lt;param name="elementPoint"&amp;gt;&amp;lt;/param&amp;gt;
      &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DoZoom(&lt;SPAN style="COLOR: blue"&gt;double &lt;/SPAN&gt;relativeZoom , &lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;elementPoint)
      {
          &lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(  _currentTotalZoom * relativeZoom &amp;lt; MaxZoomOut ||
                _currentTotalZoom * relativeZoom &amp;gt; MaxZoomIn) 
              &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;; 
 
          &lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;p = DeepZoom.ElementToLogicalPoint(elementPoint);
          DeepZoom.ZoomAboutLogicalPoint(relativeZoom, p.X, p.Y);
          &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Zoom = relativeZoom;
          _currentTotalZoom *= relativeZoom; 
                } &lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now we are ready to handle the MouseWheelHelper.Moved event.&amp;nbsp;&amp;nbsp; We will do it in three parts:&amp;nbsp; 
&lt;OL&gt;
&lt;LI&gt;We will subscribe to MouseMove event in the MultiScaleImage, so we can keep track of where the mouse is; we need this because MouseWheelHelper.Moved does not give us a MousePosition, and there is no way to query MousePosition in Silverlight2 outside of a Mouse EventHandler. &lt;BR&gt;&lt;BR&gt;// inside the Loaded event for the user control &lt;BR&gt;//{ &lt;BR&gt;DeepZoom.MouseMove += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseEventHandler&lt;/SPAN&gt;(DeepZoom_MouseMove); &lt;BR&gt;_lastMousePosition = new Point ( DeepZoom.ActualWidth /2 , DeepZoom.ActualHeight /2); &lt;BR&gt;//} &lt;BR&gt;&amp;nbsp; &lt;BR&gt;protected Point _lastMousePosition; &lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_MouseMove(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _lastMousePosition = e.GetPosition(DeepZoom); &lt;BR&gt;} &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now we instantiate a MouseWheelHelper and subscribe to Moved event &lt;BR&gt;&lt;BR&gt;// inside the Loaded Event for UserControl &lt;BR&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseWheelHelper &lt;/SPAN&gt;mousewheelhelper = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseWheelHelper&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;); &lt;BR&gt;mousewheelhelper.Moved += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EventHandler&lt;/SPAN&gt;&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseWheelEventArgs&lt;/SPAN&gt;&amp;gt;(OnMouseWheelMoved); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;We add the OnMouseWheelMoved function to the UserControl class.. &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;OnMouseWheelMoved(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseWheelEventArgs &lt;/SPAN&gt;e)
{   
&lt;SPAN style="COLOR: green"&gt;   // e.Delta &amp;gt; 0 == wheel moved away, zoom in 
&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;   if &lt;/SPAN&gt;(e.Delta &amp;gt; 0)
   {
      DoZoom( DefaultZoomFactor, _lastMousePosition);
   }
&lt;SPAN style="COLOR: blue"&gt;   else
&lt;/SPAN&gt;   {
&lt;SPAN style="COLOR: green"&gt;      // Zoom out 
&lt;/SPAN&gt;      DoZoom( 1/ DefaultZoomFactor, _lastMousePosition);
   } 
}&lt;BR&gt; &lt;BR&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;NOTE: If you compare the source above with the code in the sample source, they are slightly different. &lt;BR&gt;In the sample source there is two approaches to handling Zoom, and there is a boolean flag called _useRelatives that controls this. if you set _useRelatives to true, it will zoom based in relation to a last zoom; I think this makes it more complicated but for some reason most samples I have seen of DeepZoom use this calculation.&amp;nbsp; I think the behavior is the same than the approach I took, but the math is simpler with the approach in the steps above.&amp;nbsp;&amp;nbsp; I did add both in case I find later that there was a scenario addressed by the _useRelatives approach. &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;
&lt;LI&gt;At this point we should be able to run the application and get Zoom to work (in and out) around the mouse location.&amp;nbsp; Compile the app and run it to make sure we are making progress. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;To Pan, we need to detect the MouseLeftButtonDown and MouseLeftButtonUp,&amp;nbsp; the assumption is we will pan when the mouse is down, and pan in the direction of the Mouse movement and then stop panning when the mouse is up. &lt;BR&gt;
&lt;OL&gt;
&lt;LI&gt;Let’s add a handler for MouseLeftButtonDown, we add the listener in the UserControl’s Loaded event.&amp;nbsp; This handler will set a variable called _isDragging&amp;nbsp; to flag that the mouse is down; we will use this flag on the MouseMove handler. &lt;BR&gt;&lt;BR&gt;// inside the Loaded function, we add code behind our MouseWheelHelper code added earlier.. &lt;BR&gt;DeepZoom.MouseLeftButtonDown += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseButtonEventHandler&lt;/SPAN&gt;(DeepZoom_MouseLeftButtonDown); &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;The handler looks like this: &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;protected bool &lt;/SPAN&gt;_isDragging = &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;;
&lt;SPAN style="COLOR: blue"&gt;protected &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;_lastDragViewportOrigin; 
&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_MouseLeftButtonDown(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseButtonEventArgs &lt;/SPAN&gt;e)
{
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;._lastDragViewportOrigin = DeepZoom.ViewportOrigin;
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;._lastMousePosition = e.GetPosition(DeepZoom);
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;._isDragging = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;; 
           
}&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now we subscribe to MouseLeftButtonUp, inside Loaded function&amp;nbsp; and we add the handler function for it. &lt;BR&gt;&lt;BR&gt;//&amp;nbsp; The one liner below goes in the Page_Loaded event handler &lt;BR&gt;DeepZoom.MouseLeftButtonUp += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseButtonEventHandler&lt;/SPAN&gt;(DeepZoom_MouseLeftButtonUp); &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_MouseLeftButtonUp(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseButtonEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; this&lt;/SPAN&gt;._isDragging = &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;; &lt;BR&gt;} &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now we tweak the code inside MouseMove&amp;nbsp; to Change the ViewportOrigin to perform the Pan operation. &lt;BR&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_MouseMove(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseEventArgs &lt;/SPAN&gt;e)
{
&lt;SPAN style="COLOR: blue"&gt;  if &lt;/SPAN&gt;(_isDragging)
  {
&lt;SPAN style="COLOR: #2b91af"&gt;&lt;FONT color=#333333&gt;   &lt;/FONT&gt;Point &lt;/SPAN&gt;newViewport = _lastDragViewportOrigin;
   &lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;currentMousePosition = e.GetPosition(DeepZoom);
   newViewport.X += (_lastMousePosition.X - currentMousePosition.X) &lt;BR&gt;/ &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ActualWidth * &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportWidth;
   newViewport.Y += (_lastMousePosition.Y - currentMousePosition.Y) &lt;BR&gt;/ &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ActualWidth * &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportWidth;
   &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin = newViewport;
   _lastDragViewportOrigin = newViewport; 
  }
  // NOTE: it is important this be after the isDragging check … &lt;BR&gt;  // since this updates last position, which is used to compare for dragging. 
 _lastMousePosition = e.GetPosition(DeepZoom);
}&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;We should also detect the MouseLeave event, and if we are in the middle of a Pan, we need to reset the _isDragging flag. &lt;BR&gt;&lt;BR&gt;// inside the UserControl Loaded handler DeepZoom.MouseLeave += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MouseEventHandler&lt;/SPAN&gt;(DeepZoom_MouseLeave);&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;void &lt;/SPAN&gt;DeepZoom_MouseLeave(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;MouseEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;._isDragging = &lt;SPAN style="COLOR: blue"&gt;false&lt;/SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.Cursor = &lt;SPAN style="COLOR: #2b91af"&gt;Cursors&lt;/SPAN&gt;.Arrow;&amp;nbsp; &lt;BR&gt;}&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;
&lt;LI&gt;&amp;nbsp; That is it for the basics and the ‘hard stuff’ … with not too many lines of code, we have Zoom &amp;amp; Pan in our host.&amp;nbsp; Along the way we added a few properties we can reuse to create UI around our DeepZoom image. &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;H1&gt;Part 4.1 Adding more UI to navigate in a DeepZoom Control. &lt;BR&gt;&lt;/H1&gt;
&lt;P&gt;In the last sections I took it slow and walked through the code to explain what we were working on.&amp;nbsp; Going forward below will pick up the pace a bit, and the original code will be tweaked to get into a host control with a bit more navigation and troubleshooting advise.&amp;nbsp; &lt;BR&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width="100%" border=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top&gt;We begin by adding a Navigation wheel to the UserControl.xaml.&amp;nbsp; The wheel has four repeat buttons with arrows pointing east,west,north, south; these buttons will be used to pan in the respective direction. &lt;BR&gt;&lt;BR&gt;At the center of the wheel, there is a regular button, which takes you home ( to where there is no Zoom, no panning, etc. ) &lt;/TD&gt;
&lt;TD class="" vAlign=top width=200&gt;&lt;BR&gt;&lt;A href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_10.png" mce_href="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_10.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=98 alt=image src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_4.png" width=100 border=0 mce_src="http://blogs.msdn.com/blogfiles/jaimer/WindowsLiveWriter/Deepzoomprimerpart12_A83/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;OL&gt;
&lt;LI&gt;Implementing Panning is done by changing the viewportOrigin. We have a choice of Panning relative to control size and relative to ImageSize. Let me explain: &lt;BR&gt;&lt;BR&gt;If the controls ViewPortWidth is 1.0 – and we pan by a Logical increment of 0.1&amp;nbsp; we are panning 10 percent on a direction. This % seems reasonable. &lt;BR&gt;If however we are zoomed in 500% ( viewportWidth = 0.2 ) and we do a Pan of 0.1 (logical)&amp;nbsp; then we are going to pan by a lot ( 50% of what is visible).&amp;nbsp; So we need to scale our original 0.1 increment by the ViewportWidth.&amp;nbsp; Don’t you think? &lt;BR&gt;&lt;BR&gt;Here is what I did: 
&lt;OL&gt;
&lt;LI&gt;Added a Property of type double called&amp;nbsp; PanPercent.&amp;nbsp;&amp;nbsp; This property holds the increment. You can set it from XAML; default is 0.1&amp;nbsp; ( aka 10% ) &lt;/LI&gt;
&lt;LI&gt;Added a property of type bool called UseViewportScaleOnPan.&amp;nbsp; If this is true, we will pan by&amp;nbsp; PanPercent * ViewportWidth; if this is false we pan by PanPercent. &lt;BR&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;
&lt;LI&gt;Now we are ready for Panning. We add event handlers for all our Pan RepeatButtons: &lt;BR&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PanRight.Click += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(PanRight_Click);
&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PanLeft.Click += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(PanLeft_Click);
&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Home.Click += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(Home_Click);
&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PanBottom.Click += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(PanBottom_Click);
&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.PanTop.Click += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(PanTop_Click);&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Each of the event handlers calls the Pan function with their respective direction: &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;Pan(&lt;SPAN style="COLOR: #2b91af"&gt;PanDirection &lt;/SPAN&gt;direction)
{
&lt;SPAN style="COLOR: blue"&gt;double &lt;/SPAN&gt;percent = PanPercent; 
            
&lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;( UseViewportScaleOnPan ) 
    percent *= &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportWidth; 
&lt;SPAN style="COLOR: blue"&gt;switch &lt;/SPAN&gt;(direction)
{               
&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#333333&gt;   &lt;/FONT&gt;case &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PanDirection&lt;/SPAN&gt;.East:
&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#333333&gt;      &lt;/FONT&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin =
         &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X - &lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;.Min(percent, &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X),
      &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y);
         &lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;; 
&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#333333&gt;   &lt;/FONT&gt;case &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PanDirection&lt;/SPAN&gt;.West:
       &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin =
           &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X + &lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;.Min(percent, (1.0 - &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X)),
            &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y);
                    &lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;; 
&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#333333&gt;    &lt;/FONT&gt;case &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PanDirection&lt;/SPAN&gt;.South :
         &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin =
          &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X ,
           &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y + &lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;.Min( percent, 1.0 - &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y));
        &lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;; 
     &lt;SPAN style="COLOR: blue"&gt;case &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PanDirection&lt;/SPAN&gt;.North :
          &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin =
             &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.X,
             &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y - &lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;.Min( percent, &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin.Y));
          &lt;SPAN style="COLOR: blue"&gt;break&lt;/SPAN&gt;; 
     } &lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;LI&gt;Panning to Home is a combination of setting the ViewportOrigin to 0,0 and setting the ViewportWidth to 1 &lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;Home_Click(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs &lt;/SPAN&gt;e) { &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportOrigin = &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;(0, 0); &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.DeepZoom.ViewportWidth = 1; } &lt;BR&gt;&lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Next thing is to implement Zoom in and Zoom Out; these are also trivial, the only decision to make is where to Zoom, I needed two approaches: &lt;BR&gt;When Zooming using keyboard,&amp;nbsp; Ctrl+ Ctrl- (on Windows)&amp;nbsp; I wanted to Zoom at the mousePosition.&amp;nbsp; &lt;BR&gt;When zooming using the magnifying glass icons I added to the UI, I can not use the mousePosition – as I knew the mouse was where the magnifying glass – so I zoomed around the center of the control. &lt;BR&gt;&lt;BR&gt;Let’s begin with simple ZoomIn using Click from magnifying glass: &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;void &lt;/SPAN&gt;btnZoomIn_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ZoomIn( &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;( DeepZoom.ActualWidth / 2 , DeepZoom.ActualHeight / 2));&amp;nbsp; &lt;BR&gt;} &lt;BR&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt;
/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;Zooms in around an ELEMENT Coordinate..  
&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt;I technically did not need this function to abstract and could have called DoZoom directly 
&lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt;
/// &amp;lt;param name="p"&amp;gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;ZoomIn( &lt;SPAN style="COLOR: #2b91af"&gt;Point &lt;/SPAN&gt;p )
{
    &lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(_useRelatives)
        DoRelativeZoom(Zoom / DefaultZoomFactor, p, &lt;SPAN style="COLOR: #2b91af"&gt;ZoomDirection&lt;/SPAN&gt;.In);
    &lt;SPAN style="COLOR: blue"&gt;else
        &lt;/SPAN&gt;DoZoom(DefaultZoomFactor, p );
} &lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;When zooming from Keyboard.&amp;nbsp; The “gotcha” was that the DeepZoomImage is a FrameworkElement and it does not receive focus (in Silverlight Focus is at Control class), so what I did was listen for Keyboard event in the Grid that is the top container in my Host UserControl.&amp;nbsp; &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.LayoutRoot.KeyUp += &lt;SPAN style="COLOR: blue"&gt;new &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;KeyEventHandler&lt;/SPAN&gt;(DeepZoom_KeyUp);&lt;BR&gt;&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Another surprise was that + (by pressing Shift+9) on my machine turned out to be a keycode, not a standard key.&amp;nbsp; I am not a keyboard expert in Silverlight (yet) but from what I read, keycodes can be different across platform so I added code to check in case I am running in the Mac. I checked using the Environment.OSVersion property.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Please double check this code, as I was pretty lazy about what running on Windows or Mac means.&amp;nbsp; &lt;/LI&gt;
&lt;LI&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;public bool &lt;/SPAN&gt;RunningOnWindows &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;get &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt;( &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;Environment&lt;/SPAN&gt;.OSVersion.Platform == &lt;SPAN style="COLOR: #2b91af"&gt;PlatformID&lt;/SPAN&gt;.Win32NT || &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;Environment&lt;/SPAN&gt;.OSVersion.Platform == &lt;SPAN style="COLOR: #2b91af"&gt;PlatformID&lt;/SPAN&gt;.Win32S);&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Now we do the Zoom, note that I am not too confident on my Mac KeyCodes; I got this by sniffing on my Mini but I have a regular,ergonomic Microsoft keyboard on&amp;nbsp; that mini so double check with your keyboard just in case. &lt;SPAN style="COLOR: blue"&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_KeyUp(&lt;SPAN style="COLOR: blue"&gt;object &lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;KeyEventArgs &lt;/SPAN&gt;e)
{
            
&lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;(e.Handled == &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;)
&lt;SPAN style="COLOR: blue"&gt;&lt;FONT color=#333333&gt;   &lt;/FONT&gt;return&lt;/SPAN&gt;;

&lt;SPAN style="COLOR: blue"&gt;if &lt;/SPAN&gt;( ( RunningOnWindows &amp;amp;&amp;amp; ((&lt;SPAN style="COLOR: #2b91af"&gt;Keyboard&lt;/SPAN&gt;.Modifiers &amp;amp; &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) == &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) &amp;amp;&amp;amp;
     (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Add || (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Unknown &amp;amp;&amp;amp; e.PlatformKeyCode == 0xBB)))  ||
     ( RunningOnMac &amp;amp;&amp;amp; ((&lt;SPAN style="COLOR: #2b91af"&gt;Keyboard&lt;/SPAN&gt;.Modifiers &amp;amp; &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) == &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) &amp;amp;&amp;amp;
     (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Add || (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Unknown &amp;amp;&amp;amp; e.PlatformKeyCode == 0x18 )))
                 
    )
    {
       ZoomIn( _lastMousePosition); 

    }
    &lt;SPAN style="COLOR: blue"&gt;else if &lt;/SPAN&gt;( 
      (RunningOnWindows &amp;amp;&amp;amp; ((&lt;SPAN style="COLOR: #2b91af"&gt;Keyboard&lt;/SPAN&gt;.Modifiers &amp;amp; &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) == &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) &amp;amp;&amp;amp;
      (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Add || (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Unknown &amp;amp;&amp;amp; e.PlatformKeyCode == 0xBD)))||
      ( RunningOnMac &amp;amp;&amp;amp; ((&lt;SPAN style="COLOR: #2b91af"&gt;Keyboard&lt;/SPAN&gt;.Modifiers &amp;amp; &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) == &lt;SPAN style="COLOR: #2b91af"&gt;ModifierKeys&lt;/SPAN&gt;.Control) &amp;amp;&amp;amp;
      (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Add || (e.Key == &lt;SPAN style="COLOR: #2b91af"&gt;Key&lt;/SPAN&gt;.Unknown &amp;amp;&amp;amp; e.PlatformKeyCode == 0x1B )))
     )
   {
      ZoomOut( _lastMousePosition );
   }            
             
   e.Handled = &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;
 }&lt;/PRE&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;At&amp;nbsp; that point our app would be functionally complete but I want to share a few more findings from my learning so let me share&amp;nbsp; the DebugSpew, it can be handy for you too. &lt;BR&gt;&lt;A href="http://11011.net/software/vspaste" mce_href="http://11011.net/software/vspaste"&gt;&lt;/A&gt;
&lt;OL&gt;
&lt;LI&gt;When I wrote my first deepZoom app, I took the usual approach of databinding to it so I can reverse engineer it and found a few issues; since I am traveling I have not discussed them w/ DeepZoom folks in depth for now take these as “gotchas in beta1” and will try to get some one from DeepZoom team to confirm if these are ‘final’ behaviors (feel free to leave feedback here or at the expression blog) letting them know your preferences. 
&lt;UL&gt;
&lt;LI&gt;Databinding to MultiScaleImage was a bit flaky.&amp;nbsp;&amp;nbsp; ViewportWidth and ViewportOrigin did not fire notifications for me.&amp;nbsp; The explanation I have seen is that&amp;nbsp; because DeepZoom animates with springs, binding to these properties was not recommended.&amp;nbsp; These values will change every frame during a transition.&amp;nbsp;&amp;nbsp; The recommended workaround was to subscribe to the MotionFinished event.&amp;nbsp; This fires at the end of a transition, so gives me a nice way to pull the value.&amp;nbsp; In my case (for debug/learning deepZoom), the workaround&amp;nbsp; was very acceptable so I implemented it. &lt;BR&gt;&lt;BR&gt;// in my loaded event for the page &lt;BR&gt;DeepZoom.MotionFinished += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventHandler&lt;/SPAN&gt;(DeepZoom_MotionFinished); &lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;DeepZoom_MotionFinished(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt;sender, &lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs &lt;/SPAN&gt;e) &lt;BR&gt;{ &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp; if&lt;/SPAN&gt;(DebugSpew.DataContext != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;MultiScaleImageDummyDataWrapper &lt;/SPAN&gt;dw = DebugSpew.DataContext &lt;SPAN style="COLOR: blue"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MultiScaleImageDummyDataWrapper&lt;/SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt;(dw != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PullData(&lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt;dw, &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt;DeepZoom); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MouseLogicalPosition = DeepZoom.ElementToLogicalPoint(_lastMousePosition); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&amp;nbsp; } &lt;PRE class=code&gt;&lt;SPAN style="COLOR: blue"&gt;void &lt;/SPAN&gt;PullData(&lt;SPAN style="COLOR: blue"&gt;ref &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MultiScaleImageDummyDataWrapper &lt;/SPAN&gt;data, &lt;SPAN style="COLOR: blue"&gt;ref &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MultiScaleImage &lt;/SPAN&gt;msi)
{
            data.ViewportWidth = msi.ViewportWidth;
            data.ViewportOrigin = msi.ViewportOrigin;
            data.AspectRatio = msi.AspectRatio;
            data.UseSprings = msi.UseSprings; 
             
} &lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;Databinding to the other properties (that are not animated per frame) in MultiScaleImage also gave me a bit of trouble [some times the control would not show up]. My advise is to not data bind for now.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Once I had the databinding worked out, I added a handler to pull data from the MouseMove so I could show coordinates when Mouse is moving, I wanted them in logical and element coordinates, so I did the translation and I added an extra&amp;nbsp; call from MotionFinished to translate the point again as the logical Coordinate changes when the Viewport changes. &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;H1&gt;Part 5 – Lessons learned &lt;/H1&gt;
&lt;P&gt;Overall I was quite impressed with DeepZoom. it is pretty cool stuff; I wish I had some cool pictures for a better application, but I did not try since&amp;nbsp; I knew I could not top memorabilia. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;
&lt;P&gt;My personal advise:&amp;nbsp; do not databind to DeepZoom for now. Pull to it on Motion Finished. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;No keyboard input goes into DeepZoom (since it is a FrameworkElement). In order to have keyboard input you must have a Control that has focus; since keyboard events bubble you can handle Keyboard input at a higher level (e.gl LayoutRoot, just check to see if it has not been handled previously). &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;On my real app –which can’t be shared as it was a customer’s app –.&amp;nbsp; I ran into an issue when using Collections. My images were showing up in the wrong place.&amp;nbsp; I reported it already and they are investigating –during the shower, where I do my best thinking- I came with the theory that is the resolution independence in WPF ( 96 to 72 DPI conversion).&amp;nbsp; I have not confirmed. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;I did not discuss collections in the post, so will try it here. Collections are cool because it gives you access to your Subimages so you can&amp;nbsp; manipulate them.&amp;nbsp; Move them around, scale them, animate position and Opacity.&amp;nbsp;&amp;nbsp; For now, beta1 has only one Collection; I think it would be cool to have multiple collections so you can aggregate.&amp;nbsp; This can kind of be simulated via logic, but would be nice if it was in the control.&amp;nbsp; If you simulate it, the advise I was given is do not simulate it by overlaying two MultiScaleImage controls one on top of the other, there are a few known issues with interactions on overlays (though to be honest I tried it and did not run into issues). &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;UseSprings= true is pretty cool, but pending how quick you want to do your panning/zooming, turning it off can make your app appear more responsive. I would not turn UseSprings off for a consumer facing app, but I would consider doing it for an internal app.. For example, I am doing a Heatmap with lots of data in it, for analytical purposes. Since it is drill through I am considering it. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;When panning, make sure you handle MouseLeave on your control. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Handling mouse wheel is not available out of the box is trivial but Peter Blois has a great solution. Do not&amp;nbsp; write the code to handle wheel. Peter’s code works great so far. Check his blog for updates too, he has a nice abstraction now to the same API. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If you skipped section 3, check it out. Understanding the object model is critical and takes 5 mins. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If you are writing a DeepZoom application, I recommend you use the old instantiation via silverlight.js … Click To Activate will eventually go away in IE, but in the mean time it is pretty annoying for an app that is so visual and so focused on mouse navigation.&amp;nbsp; &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If subscribing to MultiScaleImage.OpenImageSucceded make sure you do it from your constructor right after initializeComponent.&amp;nbsp; I tried to do it of&amp;nbsp; UserControl.Loaded and when doing a load on a page with image cached that is too late. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If possible try to ‘hold’ any operations until OpenImageSucceded has fired ( no pans, zooms before that). I saw weird results if I try to access properties on MultiScaleImage before this event; in particular if you access the SubImages collection before ImageOpenSucceded, then I would get an empty collection and when ImageOpenSucceeded was fired, the collection would not be overridden; so advise for collections is don’t touch SubImages before the OpenImageSucceeded fires. &lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;H1&gt;Part 6 – Source &lt;/H1&gt;
&lt;P&gt;Is at &lt;A title=http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/DeepZoomSample.zip href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/DeepZoomSample.zip" mce_href="http://cid-123ec1ed6c72a14a.skydrive.live.com/self.aspx/Public/DeepZoomSample.zip"&gt;Skydrive&lt;/A&gt;&lt;/P&gt;
&lt;H1&gt;Part 7 – Show me the app. &lt;/H1&gt;
&lt;P&gt;You can see it &lt;A href="http://www.cookingwithxaml.com/meals/deepzoomsample/default.html" mce_href="http://www.cookingwithxaml.com/meals/deepzoomsample/default.html"&gt;here&lt;/A&gt;;&amp;nbsp; it is not visually impressive but I think it shows a bit of what you can do with DeepZoom and most important it is functional code you can quickly refactor and reuse. If I missed a common deepZoom task let me know. &lt;BR&gt;&amp;nbsp; &lt;BR&gt;I added two extra “easter eggs” beyond the bunny and&amp;nbsp; the eggs above in the walk through. &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;One is for&amp;nbsp; the NCAA basketball team for my college, which won yesterday and made it to the Final Four tournament .&amp;nbsp; (Hint, the four finalists are:&amp;nbsp; Kansas, Memphis, UCLA and North Carolina. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;The other one is a bitmap with dates &amp;amp; locations for my upcoming Europe trip (Germany, Austria)..&amp;nbsp; If you are in the area and available the nights I am in the area, ping me and we can get together to discuss any thing .NET client related (e.g. WPF, Silverlight, and ASPX). &lt;/LI&gt;&lt;/OL&gt;
&lt;H1&gt;Part 8 -- Thanks&lt;/H1&gt;
&lt;P&gt;Thanks to &lt;A href="http://systim.spaces.live.com/" mce_href="http://systim.spaces.live.com/"&gt;Tim Aidlin&lt;/A&gt; who chose the colors and gave me cooler icons for the map; I butchered them a bit when I turned them into controls so don’t hold it against him, he is a gifted designer –you can see his real work on the MIX website and any thing else MIX08 branded. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8347451" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/expression/default.aspx">expression</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/deepzoom/default.aspx">deepzoom</category></item><item><title>Microsoft's "client" strategy for next few years became real at MIX08 ( and is incredibly exciting if you ask me) ..</title><link>http://blogs.msdn.com/jaimer/archive/2008/03/17/microsoft-s-client-strategy-for-next-few-years-became-real-at-mix08-and-is-incredibly-exciting-if-you-ask-me.aspx</link><pubDate>Mon, 17 Mar 2008 11:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8282116</guid><dc:creator>jaimer</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/jaimer/comments/8282116.aspx</comments><wfw:commentRss>http://blogs.msdn.com/jaimer/commentrss.aspx?PostID=8282116</wfw:commentRss><description>&lt;P&gt;Below are my scribbles during my flight back from MIX.&amp;nbsp;&amp;nbsp; &lt;BR&gt;I considered not publishing this because it feels 'too positive' (or too marketing-like)..&amp;nbsp; if you don't like those, please skip (no harm). &lt;BR&gt;I am sharing to see if any one has feedback. &amp;nbsp; I also want to share for people to understand my current thinking - it will explain future blog posts-. that said, don't unsubscribe to the RSS, I won't have many posts like this one. &lt;BR&gt;&amp;nbsp;&lt;BR&gt;If you only have 3 mins, skip to the "Why I am excited section"..&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;-------------------------&lt;/P&gt;
&lt;P&gt;As I fly back from MIX I am thinking of my daughter's upcoming second birthday ( she was born a few weeks after the very first MIX). &lt;BR&gt;Every day I am amazed at how fast she has developed in just two years. This week, I realized another amazing transformation that has happened in same timeframe: Microsoft's client technologies have evolved significantly. At MIX08, Microsoft communicated a very coherent vision for a comprehensive all-inclusive application platform. Microsoft backed up the vision with some pretty impressive customer applications.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The message after Day 1 keynote was: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;From Ray Ozzie: Microsoft is looking strongly at a 'Connected' world ( Enterprise, Consumer, Devices, Entertainment). We are position quite well to address such broad challenge. 
&lt;LI&gt;From Scott Guthrie: Microsoft has quickly become a very strong competitor in the RIA space; we are tackling it from all angles: 
&lt;UL&gt;
&lt;LI&gt;Continued innovation to maintain leadership on video quality and to to maintain lowest cost of ownership to video content providers.&amp;nbsp; 
&lt;LI&gt;Innovation around other consumer technologies (e.g. DeepZoom) that are included in the Silverlight platform. 
&lt;LI&gt;Tooling for developers and designers. 
&lt;LI&gt;A comprehensive, extensible, performant platform to address the needs of most RIA scenarios and a client continuum for existing Windows desktop customers; if you need a desktop application you can leverage the same skills&amp;nbsp; (.NET, XAML) and same tools ( Blend, Visual Studio), etc.&amp;nbsp; You can even share the codebase with a few tweaks.. 
&lt;LI&gt;Strong commitment to cross platform and cross browser,&amp;nbsp; now emphasized by adding Windows mobile and Symbian OS into the equation (via the Nokia announcement). &lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;You could be thinking this is "blue koolaid", but&amp;nbsp; we backed it up with strong partner scenarios. Among the evidence: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;NBC Olympics is trusting Microsoft Silverlight with a once every four years.&amp;nbsp; This is their most aggressive online broadcast project ever. 
&lt;UL&gt;
&lt;LI&gt;The app looked great too.&amp;nbsp; I don't think this was transparent, but the app was coded using Silverlight 2.&amp;nbsp; I am a virtual part of that team and can tell you the bits were real; it was working code and you should expect to see some of it &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Hard Rock Cafe showed &lt;A href="http://memorabilia.hardrock.com/" target=_blank mce_href="http://memorabilia.hardrock.com"&gt;Memorabilia&lt;/A&gt;, an amazing showcase for Microsoft's DeepZoom technology.&amp;nbsp; I am a big fan of DeepZoom, I think is going to revolutionize how we navigate content and how we interact with displays ( screens, surface, phones).&amp;nbsp; &lt;BR&gt;
&lt;LI&gt;AOL showed their &lt;A href="http://ria.mail.aol.com/" target=_blank mce_href="http://ria.mail.aol.com/"&gt;new email client&lt;/A&gt; written in Silverlight 2.&amp;nbsp; They showed impressive styling capabilities for personalization; they also showed seamless advertisement&amp;nbsp; integration and kept raging on the performance improvements they are seeing. I could be wrong because I am not intimate with this project but it sounded like some of the improvements are via caching on the isolated storage provided by Silverlight (so it goes beyond standards-based) web. 
&lt;UL&gt;
&lt;LI&gt;The client looked pretty good and I kept thinking if they have a Silverlight 2 client, why not make a WPF client and get out of the browser? &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Aston Martin showed several amazing applications: a Silverlight application and a WPF application (interacting with XNA).&amp;nbsp; Beyond their cars being amazingly cool, the demos stood by themselves on the technical aspects clearly demonstrating the on-going need (in some scenarios) for desktop applications ( 3D, hardware acceleration, access to devices, etc.) 
&lt;LI&gt;Cirque Du Soleil had a casual and entertaining demonstration of the very complex recruiting and staffing process they go through.&amp;nbsp; I think the biggest highlight of their application is the reuse of the XAML across channels; they used the same XAML and same business objects on their off-line desktop application and their web based application.&amp;nbsp;&amp;nbsp; 
&lt;UL&gt;
&lt;LI&gt;I was a virtual contributor on the Cirque application so I am hoping to get to do another post with some of the details; it was a very interesting show case of "why smartclient". &lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;There were some WPF demonstrations of their performance improvements around effects.&amp;nbsp; I was standing next to one of our marketing folks when they showcased it; she was not that impressed, looked at me with a "this is geeky stuff, is not it?"&amp;nbsp; and all I could say was "extensibility at this level is very complex and incredibly powerful, this is big for some ISVs and Enterprises". &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That was the executive message.. &lt;STRONG&gt;Why does this excite me so much?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This new convergence on the client stack with XAML + .NET is incredibly powerful; this is one of those 1 + 1 = 3 catalysts. &lt;/P&gt;
&lt;P&gt;Here are just a few of my reasons ( in random order): &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I spend my time in the Enterprise, where there is still a countless number of requirements that I think is ONLY addressed by smart client applications (which is different from off-line RIA), I think .NET and Visual Studio have a strong positioning in that space;&amp;nbsp; with all the new improvements to WPF ( you should see Rob Relyea's MIX talk) I think WPF adoption will continue to grow, and now we can extend or complement those smart clients with web applications with out compromising on performance, experience, or security.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;
&lt;LI&gt;This possible reuse for cross platform is going to excite those ISVs that have been holding back in migrating from MFC or Windows Forms to WPF;&amp;nbsp; I think it is now confirmed that the future (for .net developers)&amp;nbsp; is in XAML.&amp;nbsp; This is going to lead to faster adoption of .NET 3.x, it will lead to a larger partner ecosystem ( aka component vendors), more trained developers, more books, more content, etc.&amp;nbsp; It is a good cycle that feeds itself. &lt;BR&gt;
&lt;LI&gt;I think the Silverlight platform has enough 'advantages' to continue bringing new customers/scenarios, we are making great progress on the media (video) space, with DeepZoom we are getting a niche on a 'large data navigation space', etc.&amp;nbsp; As Scott mentioned we are above &amp;gt; 1.5 million of Silverlight installs per day; that number will continue to go up with Silverlight 2. &lt;BR&gt;A case in point is the Move networks announcement from MIX, which I forgot to include on the highlights above. &lt;BR&gt;
&lt;LI&gt;Silverlight is also going to allow a lot of existing web developers to greatly improve their apps.&amp;nbsp; I know plenty of people who do asp .net development and have tried web technologies like Java, Flash, Flex, etc. and have not embraced these other technologies because they did not like the development environment, languages, performance, did not have the skills, etc.; with Silverlight we are giving .NET (server-side) web developers the option to embrace a richer (client-side) web experience with out having to learn new skills, we are also giving them a flexible sandbox ( e.g. isolated storage, x-domain calls, File Access, etc.) that helps them extend their reach to the desktop with out compromising on security. &lt;BR&gt;
&lt;LI&gt;I like the Microsoft offering because it has a solid foundation in .NET; you get best of breed tools, incredible flexibility around languages ( C#, VB, JScript, Ruby, IronPython, etc.),&amp;nbsp; comprehensive libraries ( e.g. Web services stack, or LINQ for data access,);&amp;nbsp; as I look at other platforms out there, I am not sure they have the raw power, developer flexibility, architecture, same performance, same language capabilities, etc.&amp;nbsp; &lt;BR&gt;I have to wonder, will competitors be able to keep up as a comprehensive platform? will they need a major re-design that is going to slow them down? &lt;BR&gt;
&lt;LI&gt;I like XAML and the WPF concepts as a declarative UI platform but I think there is more to these than it being mark-up; the platform was designed with markup in mind and the platform supports it well. I go back to my point above where I look at competing platforms and have to wonder about their foundations and ability to 'evolve' to a 100% declarative model. I think WPF has foundations (for example the property system) that you need to have in order to get to a pure and clean declarative model.&amp;nbsp;&amp;nbsp; &lt;BR&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I know there are challenges to overcome, but I see no major blockers and I do think time is on our side. &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Ubiquity is likely the current 'concern' people will raise; you will hear Flash has ~90% ubiquity and Silverlight is just getting started;&amp;nbsp; I respect that, but I am optimistic because Flash and Silverlight co-exist quite well (they are not mutually exclusive like Windows and Mac OS were); all it takes is for a user to go to a site that needs Silverlight for it to be installed.&amp;nbsp;&amp;nbsp; These are tiny/free plug-ins we are installing so I expect the installs to continue moving fast..&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That sums up my excitement post MIX. In a few words, I think Silverlight's cross-platform opportunity is going to be the catalyst or accelerator for both RIA and Desktop applications written using .NET and XAML; I am excited about what will come in the next 12 to 18 months. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8282116" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/jaimer/archive/tags/Windows+Presentation+Foundation/default.aspx">Windows Presentation Foundation</category><category domain="http://blogs.msdn.com/jaimer/archive/tags/silverlight/default.aspx">silverlight</category></item></channel></rss>