<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jeff Wilcox &#187; Silverlight Toolkit</title>
	<atom:link href="http://www.jeff.wilcox.name/topics/dev/silverlight-toolkit/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeff.wilcox.name</link>
	<description>Silverlight, rich client apps and web development</description>
	<lastBuildDate>Wed, 18 Aug 2010 01:33:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Updated Silverlight Unit Test Framework bits for Windows Phone and Silverlight 3</title>
		<link>http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/</link>
		<comments>http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/#comments</comments>
		<pubDate>Thu, 27 May 2010 21:02:52 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/</guid>
		<description><![CDATA[Here's the same unit test framework from the April 2010 Silverlight Toolkit, built for Windows Phone and SL3 developers only.]]></description>
			<content:encoded><![CDATA[<p>Here are updated quasi-official unit test framework bits for Silverlight 3 and Windows Phone developers. These are <strong>not</strong> intended for Silverlight 4 developers, since the same framework built for SL4 is included in the <a href="http://silverlight.codeplex.com/">April 2010 Silverlight Toolkit</a>.</p>
<p>This brings the <a href="http://www.jeff.wilcox.name/2010/05/new-2010-test-framework/">new features</a> from the Silverlight 4 version to developers who have a business reason to continue with Silverlight 3 development for the time being:</p>
<ul>
<li>Updated user interface</li>
<li>Integrated “tag expression” support for selecting subsets of tests to run</li>
<li>Performance improvements</li>
<li>Removal of dependencies on XLinq and System.Windows.Browser assemblies</li>
</ul>
<p>These are also the bits you want for Windows Phone testing.</p>
<h4>Why wasn’t there one for Silverlight 3 already?</h4>
<p>Since the April 2010 toolkit release was targeted for Silverlight 4 developers only, these bits were not released for version 3 (though were built from the same source).</p>
<h4>Why doesn’t the April 2010 toolkit work for Windows Phone development &amp; testing?</h4>
<p>The Windows Phone development environment is based on a version of Silverlight 3 today, and so that means that you need to use Silverlight 3 binaries and class libraries when re-using Silverlight apps and code – <em>not</em> Silverlight 4.</p>
<p>These bits work well for phone developers and replace the older bits I had posted to my <a href="http://www.jeffatmix.com/">MIX talk site</a>.</p>
<h4>Download the binaries</h4>
<p>[<a href="http://media.jeff.wilcox.name/blog/ut/SL3_UTF_May.zip"><strong>Silverlight 3 binaries for the Silverlight Unit Test Framework</strong></a>, Zip 452KB]    <br />You may need to ‘unlock’ the binaries for security reasons once downloading and extracting the assemblies from the .Zip. To do this, right-click on the file and select the ‘Unlock’ button.</p>
<p>These binaries are strong named as before, but are <em>not</em> Authenticode signed, so they are not official. This helps work around some Windows Phone signing issues I’ve heard reports of.</p>
<p>Hope this helps,   <br />Jeff</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/05/sl3-utf-bits/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>How about a Zune-style ChildWindow?</title>
		<link>http://www.jeff.wilcox.name/2010/05/my-childwindow-design/</link>
		<comments>http://www.jeff.wilcox.name/2010/05/my-childwindow-design/#comments</comments>
		<pubDate>Fri, 21 May 2010 21:25:39 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/05/my-childwindow-design/</guid>
		<description><![CDATA[Today I am sharing my ChildWindow style that resembles the Zune software user interface and has a nice transition. Enjoy!]]></description>
			<content:encoded><![CDATA[<p>Today I’m sharing my new ChildWindow style. It is a differentiated child window designed in that it doesn’t have a close button, has a completely different animation in and out, and I thought I was worth sharing. I’ve included a runtime app so you can run it and <a href="http://media.jeff.wilcox.name/blog/cw/index.html">see for yourself</a>.</p>
<h3>My ChildWindow style</h3>
<p><a href="http://media.jeff.wilcox.name/blog/cw/index.html"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="mycw" border="0" alt="mycw" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/mycw.png" width="680" height="359" /></a>     <br /><em>Click on the window above to open a simple Silverlight 4 application that demonstrates the transitions and interactivity. <a href="http://media.jeff.wilcox.name/blog/cw/ChildWindowTheme.zip">Project download</a>.</em></p>
<p>Some things to call out:</p>
<ul>
<li>I don’t include a Close button in the window chrome.</li>
<li>I hook up to the OnKeyDown event in my sample implementation. I always try and do this with my ChildWindows so that the escape (ESC) key can be treated as a cancelation of the dialog. Personal preference but a usability win I believe.</li>
<li>I like a light overlay color instead of a darkening experience, and went for that look.</li>
<li>My actual implementation uses a value converter to capitalize the title. I’ve removed this from my template for the time being.</li>
</ul>
<h3>The story on my evolving, unnamed theme, and how it relates to “Cosmopolitan”</h3>
<p>There’s an excellent <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/9329bdf4-3be7-4347-b1cd-b2c5d4e5a293">“Cosmopolitan” Silverlight project template</a> + theme available that makes building good-looking interfaces a snap, and I’d highly recommend it if you’re looking to modernize the look of a new Silverlight project. I believe it pulls from “codename Metro” design ideas. It just works and as a VS template it rocks!</p>
<p>I’ve built an alternative, but similar theme, over time that I use on many of my projects, and it also pulls from the inspiration of the clean, consistent <a href="http://www.zune.net/en-US/products/software/default.htm">Zune software</a> design principals.</p>
<p>Now that the “Cosmopolitan” theme is out there, I’ve been taking the time to compare and contrast my similar theme with this, and see where I can make changes. Yeah, the things I do in my free time are baffling…</p>
<p>This is a good exercise because design is a two-way street, comparing and contrasting design decisions and implementations: I’ve learned that I should have been including validation templates in my theme (oops, haven’t used that feature enough). And I’ve shared some minor feedback on parts of the “Cosmopolitan” theme’s implementation details with its designers.</p>
<p>In the future I’ll present the complete theme for many controls, but until that develops, I’m going to continue to share small styles and templates, along with my comments along the way. Previously I blogged my <a href="http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/">context menu style</a>.</p>
<p>If you’re wondering “why should I use ChildWindow?” &#8211; I used to wonder the same thing. But I’m using <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.childwindow(VS.95).aspx">ChildWindow</a> more now than ever. I’ve discovered the importance of the nice integration with Visual Studio (there’s an item template for child windows), and out-of-browser applications have many uses for a rich modal-style window for sharing information at runtime.</p>
<p>I’ve completely replaced the MessageBox in my out-of-browser applications to instead use a child window designed to replace the message box functionality, offering a consistent visual design even when a message box-like experience is needed. I even use extension methods to add methods to MessageBox to instead use my styled child window.</p>
<h3>Other ChildWindow styles</h3>
<p>Here’s the standard ChildWindow style and control template that is built into the Silverlight SDK. I’m displaying a password entry form adapted from an app I was experimenting with:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="cw1" border="0" alt="cw1" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/cw1.png" width="685" height="239" /> </p>
<p>Here is the same window with the “Cosmopolitan” theme’s style applied:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="cwcosmo" border="0" alt="cwcosmo" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/cwcosmo.png" width="685" height="274" /> </p>
<h3>Note: There’s a bug in ChildWindow implicit styling support</h3>
<p>While working on creating themes, I did discover that there’s an unfortunate bug in Silverlight 4 where the implicit styles for ChildWindow are not picked up in certain XAML scenarios. Namely, if you use the handy item template in Visual Studio, the implicit style won’t be picked up.</p>
<p>Oddly, at times Visual Studio will show the proper implicit style, but at runtime it will revert to the standard control default style. Here’s a small screenshot – this is out-of-the-box “Cosmopolitan” theme with a ChildWindow item template.</p>
<h4>At design time it looks fine:</h4>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="dt" border="0" alt="dt" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/dt.png" width="685" height="454" /> </p>
<h4>At runtime:</h4>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="runtime_style_not_applied_bug" border="0" alt="runtime_style_not_applied_bug" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/runtime_style_not_applied_bug.png" width="685" height="231" /> </p>
<p>It appears that this item template format, where the XAML file of the child window’s root is the child window, doesn’t allow the style that was implicitly defined to be picked up.</p>
<p>No worries. To workaround this, add a Style attribute to the root of the file and a static resource to ChildWindow name. If you’re working with “Cosmopolitan”, then here are the steps:</p>
<ul>
<li>Open the Assets/SDKStyles.xaml file</li>
<li>Navigate to the implicit style for ChildWindow around line 2,440</li>
<li>Add an x:Key to make the style explicit instead of implicit. x:Key=”ChildWindowStyle”</li>
<li>Add this line after the (now explicit) style:</li>
</ul>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:839e9ba9-7b8c-4d91-9a85-d509a86d8e22" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Style TargetType="controls:ChildWindow" BasedOn="{StaticResource ChildWindowStyle}" /&gt;</pre>
</div>
<ul>
<li>Open your ChildWindow XAML file (mine is called Password.xaml) and add the attribute Style=”{StaticResource ChildWindowStyle}” to the root element</li>
</ul>
<h4>And here’s it at runtime now with our fix/workaround:</h4>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="cwcosmo" border="0" alt="cwcosmo" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/cwcosmo.png" width="685" height="274" /></p>
<p>Note that whenever defining implicit styles myself, I always start explicit, then provide the implicit in the file using BasedOn.</p>
<h4>Download my sample project including the style</h4>
<p>[<a href="http://media.jeff.wilcox.name/blog/cw/ChildWindowTheme.zip">ChildWindowTheme.zip</a>, 71 KB] Includes the theme in App.xaml.</p>
<h3>“My yet-to-be-named Zune-inspired theme” components</h3>
<ul>
<li>ChildWindow (this post)</li>
<li><a href="http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/">ContextMenu</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/05/my-childwindow-design/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Using Silverlight 4 features to create a Zune-like context menu</title>
		<link>http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/</link>
		<comments>http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/#comments</comments>
		<pubDate>Sat, 15 May 2010 19:25:12 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/</guid>
		<description><![CDATA[A customized Silverlight 4 ContextMenu control that resembles the crisp, simple look of the Zune software's context menu.]]></description>
			<content:encoded><![CDATA[<p>Trying to create a modern, clean and crisp user interface is a challenge – and it’s something that Zune has done rather well in both their software and hardware experiences.</p>
<p>I took a few minutes to experiment with new Silverlight 4 features, including the new <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> (April 2010 release) that includes a context menu control, to re-style/re-template the menu to look similar to a few other menus.</p>
<p>Here’s a quick look at some common context menu visuals – clearly there is some room for artistry in creating a consistent experience with your app.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ContextMenus" border="0" alt="ContextMenus" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/ContextMenus.png" width="680" height="330" /> </p>
<p>The center context menu, with the Windows look, is what the default Silverlight Toolkit context menu looks most similar to.</p>
<h3>New features used</h3>
<ul>
<li>Right-click input event, added to the platform in Silverlight 4</li>
<li>Context menu control from the Silverlight Toolkit</li>
<li>Implicit styles support</li>
<li>Local fonts</li>
</ul>
<h3>Consider checking out ‘Cosmopolitan’, too</h3>
<p>There’s a theme that resembles the modern “codename Metro” design style, similar to that of the Zune user interface, that is available for Silverlight 4. <a href="http://timheuer.com/blog/archive/2010/05/03/new-silverlight-4-themes-available-for-download.aspx">More information is available on Tim’s blog</a>.</p>
<h3>What a context menu looks like in XAML</h3>
<p>You need an xmlns for the input assembly in the Silverlight Toolkit. Then you setup the ContextMenuService, a ContextMenu instance, plus multiple MenuItem and Separator instances.</p>
<p>A MenuItem can optionally have an icon, though I believe the trend these days is moving away from the icon-heavy menu and toolbar world into a clean &amp; crisp text-only experience… so I prefer a styled context menu that doesn’t optimize for icons.</p>
<p>The XMLNS for the context menu assembly is:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:9c30beb8-bc99-4dd4-9b26-528b0155f629" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">xmlns:controlsInputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit"</pre>
</div>
<p>You can directly wire up to the Click event, or use Commands. Here’s a sample context menu within a data template:</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:f1699113-aaec-4a27-8290-b5a8687024a8" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;ListBox.ItemTemplate&gt;
    &lt;DataTemplate&gt;
        &lt;ContentPresenter Content="{Binding}"&gt;
            &lt;controlsInputToolkit:ContextMenuService.ContextMenu&gt;
                &lt;controlsInputToolkit:ContextMenu&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Play" Click="OnMenuItemClick"/&gt;

                    &lt;controlsInputToolkit:Separator/&gt;

                    &lt;controlsInputToolkit:MenuItem Header="Download" Click="OnMenuItemClick"/&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Buy" Click="OnMenuItemClick"/&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Add to cart" Click="OnMenuItemClick"/&gt;

                    &lt;controlsInputToolkit:Separator/&gt;

                    &lt;controlsInputToolkit:MenuItem Header="Add to playlist" Click="OnMenuItemClick"/&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Add to burn list" Click="OnMenuItemClick"/&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Add to now playing" Click="OnMenuItemClick"/&gt;
                    &lt;controlsInputToolkit:MenuItem Header="Mark as favorite" Click="OnMenuItemClick"/&gt;

                    &lt;controlsInputToolkit:Separator/&gt;

                    &lt;controlsInputToolkit:MenuItem Header="Send" Click="OnMenuItemClick"/&gt;

                &lt;/controlsInputToolkit:ContextMenu&gt;
            &lt;/controlsInputToolkit:ContextMenuService.ContextMenu&gt;
        &lt;/ContentPresenter&gt;
    &lt;/DataTemplate&gt;
&lt;/ListBox.ItemTemplate&gt;</pre>
</div>
<p>And here’s what it looks like:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="DefaultContextMenu" border="0" alt="DefaultContextMenu" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/DefaultContextMenu.png" width="188" height="242" /> </p>
<p>To use the ContextMenu, make sure your project includes references to <em>both</em> the toolkit’s System.Windows.Controls.Input.Toolkit.dll as well as the SDK’s System.Windows.Controls.dll.</p>
<p>Now I’d like to make this look more Zune-like.</p>
<h3>Using implicit styles</h3>
<p>So there are multiple ways to have a style (predefined look, settings and template) on your object:</p>
<ol>
<li>Default style key – the default template and style that the creator of the control had in mind. No work required.</li>
<li>Implicit styles defined in Resources – in Silverlight 4, a Style defined by a user, but without an x:Key property, will automatically apply to all scoped controls of that type.</li>
<li>Static resource styles defined in Resources – the standard experience up until now, having a Style with an x:Key, then setting the Style=”{StaticResource MyKeyName}” on any and all controls that want to use that style.</li>
<li>Setting properties directly on an object.</li>
</ol>
<p>So here is a standard, simple style for a Button, with the key:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:dc290aa0-a366-4943-89ce-8a6771e556a1" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;UserControl.Resources&gt;
    &lt;Style TargetType="Button" x:Key="MyButtonStyle"&gt;
        &lt;Setter Property="Background" Value="Blue"/&gt;
    &lt;/Style&gt;
&lt;/UserControl.Resources&gt;</pre>
</div>
<p>Here’s how you reference it:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:1c329b9f-9e83-41e4-9883-2927dfdb6c1e" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Button Style="{StaticResource MyButtonStyle}" Content="OK"/&gt;</pre>
</div>
<p>And now let’s make that into an implicit style for Silverlight 4. Just remove the x:Key:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:86e3e09e-40ad-4ef7-a8cb-6ad12d9df35a" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;UserControl.Resources&gt;
    &lt;Style TargetType="Button"&gt;
        &lt;Setter Property="Background" Value="Blue"/&gt;
    &lt;/Style&gt;
&lt;/UserControl.Resources&gt;</pre>
</div>
<p>And here’s how you reference that style – you don’t – it’s implicit:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:87648dd1-5f46-4050-af9d-07bf7335c0a9" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Button Content="OK"/&gt;</pre>
</div>
<p><em>Small caveat, fyi:</em> there is a bug with implicit styles not necessarily being applied within data templates. To work around this, I had to move to explicit styles (adding an x:Key to the style, then setting the Style property in the DataTemplate’s XAML to the static resource’s key).</p>
<h3>Local fonts</h3>
<p>I also used a feature of Silverlight 4 that lets me pick up and use local fonts on the machine. I’m using the ‘Segoe UI’ font, a key part of the Windows 7 user experience and visual identity.</p>
<p>However I also define fallback fonts, just like you would in HTML:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:a62b7fd6-6547-4165-9612-f4a9141b6a58" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Setter Property="FontFamily" Value="Segoe UI, Tahoma, Arial"/&gt;</pre>
</div>
<h3>My Zune-like context menu</h3>
<p>Here are the templates I ended up creating using Expression Blend.</p>
<p>To achieve the fade-in effect, I faked a little and used a Loaded event trigger, so the first time any particular context menu is shown, it will quickly fade – but subsequent presentations of the same instance will not fade, for a faster, more performant feel.</p>
<h4>ContextMenu Style</h4>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:d0a111a7-b70d-4f8b-b81a-abad98ad685e" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Style TargetType="controlsInputToolkit:ContextMenu" x:Key="ZuneLikeContextMenu"&gt;
    &lt;Setter Property="Background" Value="#FFFFFFFF"/&gt;
    &lt;Setter Property="BorderThickness" Value="0,1,0,1"/&gt;
    &lt;Setter Property="BorderBrush" Value="#0D000000"/&gt;
    &lt;Setter Property="Padding" Value="0,4,0,4"/&gt;
    &lt;Setter Property="Template"&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType="controlsInputToolkit:ContextMenu"&gt;
                &lt;Border
                    x:Name="Menu"
                    Opacity="0"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Background="{TemplateBinding Background}"
                    CornerRadius="0"&gt;
                    &lt;Border.Effect&gt;
                        &lt;DropShadowEffect
                            ShadowDepth="0" Opacity="0.6" BlurRadius="22"/&gt;
                    &lt;/Border.Effect&gt;
                    &lt;Border.Triggers&gt;
                        &lt;EventTrigger RoutedEvent="Rectangle.Loaded"&gt;
                            &lt;BeginStoryboard&gt;
                                &lt;Storyboard&gt;
                                    &lt;DoubleAnimation
                                        Duration="0:0:0.2"
                                        To="1"
                                        Storyboard.TargetProperty="Opacity"
                                        Storyboard.TargetName="Menu"/&gt;
                                &lt;/Storyboard&gt;
                            &lt;/BeginStoryboard&gt;
                        &lt;/EventTrigger&gt;
                    &lt;/Border.Triggers&gt;
                    &lt;Grid&gt;
                        &lt;ItemsPresenter Margin="{TemplateBinding Padding}"/&gt;
                    &lt;/Grid&gt;
                &lt;/Border&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;</pre>
</div>
<h4>Separator Style</h4>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:010d1470-b3e8-4932-8394-67b1a78e20ce" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Style TargetType="controlsInputToolkit:Separator" x:Key="ZuneLikeSeparator"&gt;
    &lt;Setter Property="Background" Value="LightGray"/&gt;
    &lt;Setter Property="IsTabStop" Value="False"/&gt;
    &lt;Setter Property="Margin" Value="6,2,6,2"/&gt;
    &lt;Setter Property="Template"&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType="controlsInputToolkit:Separator"&gt;
                &lt;Border
                    BorderThickness="{TemplateBinding BorderThickness}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    Background="{TemplateBinding Background}"
                    Height="1"/&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;</pre>
</div>
<h4>MenuItem Style</h4>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:d0da5a04-eff4-4c6b-b93e-b68154f08dad" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Style TargetType="controlsInputToolkit:MenuItem" x:Key="ZuneLikeMenuItem"&gt;
    &lt;Setter Property="Background" Value="Transparent"/&gt;
    &lt;Setter Property="FontSize" Value="14"/&gt;
    &lt;Setter Property="FontFamily" Value="Segoe UI, Tahoma, Arial"/&gt;
    &lt;Setter Property="BorderBrush" Value="Transparent"/&gt;
    &lt;Setter Property="BorderThickness" Value="0"/&gt;
    &lt;Setter Property="Padding" Value="8,2,10,2"/&gt;
    &lt;Setter Property="Template"&gt;
        &lt;Setter.Value&gt;
            &lt;ControlTemplate TargetType="controlsInputToolkit:MenuItem"&gt;
                &lt;Grid&gt;
                    &lt;VisualStateManager.VisualStateGroups&gt;
                        &lt;VisualStateGroup x:Name="CommonStates"&gt;
                            &lt;VisualState x:Name="Normal"/&gt;
                            &lt;VisualState x:Name="Disabled"&gt;
                                &lt;Storyboard&gt;
                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Opacity" To="0.5"/&gt;
                                &lt;/Storyboard&gt;
                            &lt;/VisualState&gt;
                        &lt;/VisualStateGroup&gt;
                        &lt;VisualStateGroup x:Name="FocusStates"&gt;
                            &lt;VisualState x:Name="Unfocused"/&gt;
                            &lt;VisualState x:Name="Focused"&gt;
                                &lt;Storyboard&gt;
                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="Bg" Storyboard.TargetProperty="Opacity" To="1"/&gt;
                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="IconPresenter" Storyboard.TargetProperty="Opacity" To="1"/&gt;
                                    &lt;DoubleAnimation Duration="0" Storyboard.TargetName="Presenter" Storyboard.TargetProperty="Opacity" To="1"/&gt;
                                &lt;/Storyboard&gt;
                            &lt;/VisualState&gt;
                        &lt;/VisualStateGroup&gt;
                    &lt;/VisualStateManager.VisualStateGroups&gt;
                    &lt;Rectangle
                        RadiusX="0"
                        RadiusY="0"
                        Fill="{TemplateBinding Background}"
                        Stroke="{TemplateBinding BorderBrush}"
                        StrokeThickness="{TemplateBinding BorderThickness}"/&gt;
                    &lt;Rectangle
                        x:Name="Bg"
                        RadiusX="0"
                        RadiusY="0"
                        StrokeThickness="0"
                        Opacity="0"
                        Fill="#11000000"/&gt;
                    &lt;Grid Margin="{TemplateBinding Padding}"&gt;
                        &lt;Grid.ColumnDefinitions&gt;
                            &lt;ColumnDefinition
                                Width="Auto"/&gt;
                            &lt;ColumnDefinition Width="2"/&gt;
                            &lt;ColumnDefinition Width="*"/&gt;
                            &lt;ColumnDefinition Width="17"/&gt;
                        &lt;/Grid.ColumnDefinitions&gt;
                        &lt;ContentPresenter
                            x:Name="IconPresenter"
                            Content="{TemplateBinding Icon}"
                            Margin="1"
                            Opacity=".7"
                            VerticalAlignment="Center"/&gt;
                        &lt;ContentPresenter
                            x:Name="Presenter"
                            MinWidth="120"
                            Opacity=".7"
                            Content="{TemplateBinding Header}"
                            ContentTemplate="{TemplateBinding HeaderTemplate}"
                            Grid.Column="2"/&gt;
                    &lt;/Grid&gt;
                &lt;/Grid&gt;
            &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
    &lt;/Setter&gt;
&lt;/Style&gt;</pre>
</div>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/ZuneLikeContextMenuImplicitStyles.xaml_.txt"><strong>ZuneLikeContextMenuImplicitStyles.xaml.txt</strong></a><strong>:</strong> XAML. Download all three in one file. The file contains both implicit styles plus defined style names.</p>
<p>Here’s a comparison, a screenshot of the Zune menu on the left, and my Silverlight 4 context menu on the right:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FinalContextMenus" border="0" alt="FinalContextMenus" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/FinalContextMenus.png" width="400" height="240" /> </p>
<p>Hope this helps you create some nice modern-looking Silverlight apps!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/05/zunelike-contextmenu-style/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Silverlight Unit Test Framework: New version in the April 2010 Silverlight Toolkit</title>
		<link>http://www.jeff.wilcox.name/2010/05/new-2010-test-framework/</link>
		<comments>http://www.jeff.wilcox.name/2010/05/new-2010-test-framework/#comments</comments>
		<pubDate>Mon, 03 May 2010 22:26:06 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/05/new-2010-test-framework/</guid>
		<description><![CDATA[The latest release of the Silverlight Toolkit contains the new Silverlight Unit Test Framework, with a new modern user interface, out-of-browser support, and performance improvements.]]></description>
			<content:encoded><![CDATA[<p>In April we released a new version of the <a href="http://silverlight.codeplex.com/releases/view/43528">Silverlight Toolkit</a> for targeting Microsoft Silverlight 4. This release contains a new version of the Silverlight Unit Test Framework. Key improvements come in user interface, Silverlight 4 support, and performance.</p>
<h3>Rich, modern user interface</h3>
<p>The user interface no longer uses the antiquated HTML DOM bridge for displaying results, but now is a data bound, rich Silverlight application itself.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="NewTestFramework" border="0" alt="NewTestFramework" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/NewTestFramework.png" width="685" height="579" /></p>
<p>Rich results information is available, and a tree view control allows you to select results to be included in a test report that can be copied to the clipboard. Failures are automatically selected.</p>
<p>The results pane includes information about the tests that ran, as well as detailed information for failures.</p>
<p>Descriptive text helps identify negative tests, known test issues and bugs, and other important metadata that was not always exposed in the previous test framework.</p>
<h4>Integrated tag expression support</h4>
<p>The startup experience now allows you to enter a tag expression to select which tests to run, or not to run. You can add the Tag(“”) attribute to any test methods or classes to define your own tags. Also, the full and short names of tests and classes implicitly become test tags, as well as priorities.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TagExpressionsEditor" border="0" alt="TagExpressionsEditor" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/05/TagExpressionsEditor.png" width="685" height="375" /> </p>
<p>This means that you can define tags such as:</p>
<table border="0" cellspacing="0" cellpadding="2" width="600">
<tbody>
<tr>
<td valign="top" width="152">!MyTest1</td>
<td valign="top" width="448">Run all tests except for the method named MyTest1</td>
</tr>
<tr>
<td valign="top" width="152">MyTest1+MyTest2</td>
<td valign="top" width="448">Run the MyTest1 and MyTest2 test methods</td>
</tr>
</tbody>
</table>
<h3>Out of Browser support</h3>
<p>The framework now supports running out-of-browser. Paired with the new Silverlight 4 Tools for Visual Studio 2010, you can press F5 to run a test project you have marked as an out-of-browser.</p>
<p>This also opens up an opportunity to do testing of elevated apps that make use of AutomationFactory and other advanced features on Windows.</p>
<h3>Simplified dependencies</h3>
<p>The test framework removed dependencies on System.Windows.Browser (from the platform) and System.Xml.Linq (XLinq, from the SDK).</p>
<h3>Building blocks for Windows Phone testing support</h3>
<p>This version also contains the full source to the phone testing interface, which is significantly different in visual design and experience to coincide with the Windows Phone device size.</p>
<p>However, the story for phone testing is still developing: in the meantime binaries designed for phone use can be found at <a href="http://jeffatmix.com/">http://jeffatmix.com/</a> </p>
<h3>New location for binaries</h3>
<p>Since the new rich user interface contains a number of controls, the traditional design-time integration system conflicts and presents some issues.</p>
<p>As a result, we had to move the binaries from the Bin directory of the toolkit installation folder into a new Testing directory.</p>
<p>So the two test framework assemblies (Microsoft.Silverlight.Testing and Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight) have moved.</p>
<p>This location change could cause existing applications that reference the test assemblies to fail to compile due to the &quot;missing&quot; references.</p>
<p>If that happens, please delete the two broken references and create references to these assemblies in their new location. Everything else should continue to work as expected.</p>
<h3>Simplified test project template</h3>
<p>In alignment with the test project changes in Visual Studio 2010, which are more simplified, the unit test project template for Silverlight no longer includes a README.TXT file.</p>
<h3>Known issues</h3>
<h5>Test service</h5>
<p>I’ve received reports from a number of people about issues with the test service automation support. Some of the NDA/preview users of the framework reported issues that were corrected, but there may still be some bugs out there. I’m working to investigate and post a fix if and when I know more.</p>
<p>In the meantime I know that <a href="http://statlight.net/">StatLight</a>, a third party system, has been updated for the April release and is working well for automation.</p>
<h5>Test panel and visuals</h5>
<p>Please beware that some of your tests may need to be updated to use the new framework if your application, utility functions, or tests ever used the Application.Current.RootVisual (against the recommended pattern for interface testing).</p>
<p>The root visual is now the test framework application runner itself, and the tests run within the same TestPanel as before. Controls added to the test panel will not be located at the 0, 0 screen position, but likely near the bottom of the screen instead.</p>
<p>Hope this helps. To get started, download and install the April toolkit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/05/new-2010-test-framework/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		</item>
		<item>
		<title>No March 2010 release of the Silverlight Toolkit</title>
		<link>http://www.jeff.wilcox.name/2010/03/no-march-release/</link>
		<comments>http://www.jeff.wilcox.name/2010/03/no-march-release/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 00:08:04 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/03/no-march-release/</guid>
		<description><![CDATA[I’ve received a number of emails and questions from developers about the next release of the Silverlight Toolkit and wanted to take a moment to address the lack of a March release. Although we had previously talked about a March 2010 release to coincide with the Silverlight 4 RC at MIX, we have decided not [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve received a number of emails and questions from developers about the next release of the Silverlight Toolkit and wanted to take a moment to address the lack of a March release.
<p>Although we had previously talked about a March 2010 release to coincide with the Silverlight 4 RC at MIX, we have decided not to ship an interim release for the RC, since the final release of Silverlight 4 is coming next month.</p>
<p>This is a good thing for developers, the time we save by not releasing goes toward a better release overall when Silverlight 4 is final.</p>
<p>In the meantime, the release of the toolkit in November, for Silverlight 3, still works great on Silverlight 4 RC.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/03/no-march-release/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight Toolkit and the Windows Phone: WrapPanel, and a few others</title>
		<link>http://www.jeff.wilcox.name/2010/03/toolkit-and-the-windows-phone/</link>
		<comments>http://www.jeff.wilcox.name/2010/03/toolkit-and-the-windows-phone/#comments</comments>
		<pubDate>Sun, 21 Mar 2010 20:27:34 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/03/toolkit-and-the-windows-phone/</guid>
		<description><![CDATA[Are you looking for WrapPanel for your Windows Phone application? Look no further. The Silverlight Toolkit has several controls that work pretty well on the Windows Phone. I wanted to provide my own informal look at how it’s working with Silverlight for Windows Phone today. Note that this information is only current as of today, [...]]]></description>
			<content:encoded><![CDATA[<p>Are you looking for WrapPanel for your Windows Phone application? Look no further. The Silverlight Toolkit has several controls that work pretty well on the Windows Phone.</p>
<p><a href="http://silverlight.codeplex.com/"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="WrapPanel" border="0" alt="WrapPanel" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/03/WrapPanel.png" width="454" height="338" /></a> </p>
<p>I wanted to provide my own informal look at how it’s working with Silverlight for Windows Phone today.</p>
<p>Note that this information is only current as of today, 3/21, when used with the MIX-related CTP of the tools and emulator, and the November 2009 Silverlight Toolkit. A lot could change, and this is <strong>not exhaustive</strong>.</p>
<p>I’m also including some controls that are found in the Silverlight SDK today. I present these in order of how much I have used the components while building apps.</p>
<h3>WrapPanel and DockPanel</h3>
<p>Found in the Silverlight Toolkit, System.Windows.Controls.Toolkit.dll (SWC.Toolkit).</p>
<p>Work great.</p>
<p>If you just need the WrapPanel, and don’t want to include the entire toolkit assembly, you can just paste these source files into your application project instead (license: <a href="http://opensource.org/licenses/ms-pl.html">Ms-PL</a>):</p>
<ul>
<li><a href="http://silverlight.codeplex.com/sourcecontrol/network/Show?projectName=Silverlight&amp;changeSetId=35261#636618">OrientedSize.cs</a></li>
<li><a href="http://silverlight.codeplex.com/sourcecontrol/network/Show?projectName=Silverlight&amp;changeSetId=35261#638862">WrapPanel.cs</a></li>
</ul>
<h3>Charting and Data Visualization</h3>
<p>There is a known issue with LINQ that prevents the controls today from working perfectly. A small, targeted fix has been made in the charting codebase and a future release will work well on the device.</p>
<p>Re-templating and styling the control is very important, and required, for working on the phone in an acceptable manner. I hope to share any decent templates I can come up with.</p>
<h3>HeaderedItemsControl, HeaderedContentControl</h3>
<p>Work great. Split between System.Windows.Controls (SWC) and SWC.Toolkit.</p>
<h3>TreeView</h3>
<p>SWC. Functional; requires massive re-templating and styling. Font sizes are much too small, and the theme and visuals do not appear code-name “Metro” compatible.</p>
<h3>AutoCompleteBox</h3>
<p>Found in the System.Windows.Controls.Input SDK library of the Silverlight 3 SDK.</p>
<p>Works OK, not ready for general development use.</p>
<p>Drop-down appears well. Major features all work. However, touching an entry in the drop down only performs selection. A second touch is required to verify the choice, effectively requiring a double-tap in use.</p>
<h3>Calendar, DatePicker</h3>
<p>SWC. Limited functionality, too small visually. Not designed for touch – not enough space to reliably click on a date. Require massive re-templating. Do not resemble the same experience as the date picker built into the Windows Phone operating system.</p>
<h3>GridSplitter</h3>
<p>Works, but may pose difficult to use on a device: requires much larger padding and custom templates to make the touch area visible and useful.</p>
<h3>Not yet checked</h3>
<p>DataGrid, DataPager, ChildWindow, Label, NumericUpDown, DomainUpDown, DataForm, Rating, TimePicker, TimeUpDown, GlobalCalendar, TransitioningContentControl, TreeMap, BusyIndicator, Viewbox, Expander, Accordion, drag and drop features, and many more.</p>
<p>We’re also still developing a story for the toolkit’s phone story moving forward. As there is a lot of momentum around the phone in the company, it’s very likely that some set of phone tools, samples, and toolkits come out.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/03/toolkit-and-the-windows-phone/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Unit Testing Silverlight &amp; Windows Phone Applications &#8211; talk now online</title>
		<link>http://www.jeff.wilcox.name/2010/03/mix10-testing-talk-online/</link>
		<comments>http://www.jeff.wilcox.name/2010/03/mix10-testing-talk-online/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 22:07:26 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[MIX]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/03/mix10-testing-talk-online/</guid>
		<description><![CDATA[My MIX 10 talk, an introduction to unit testing on Silverlight and the Windows Phone, is now online for streaming and download. Thank you to everyone who attended. An early preview set of bits are online at http://jeffatmix.com/ – and the next release of the Silverlight Toolkit when Silverlight 4 ships will contain support for [...]]]></description>
			<content:encoded><![CDATA[<p>My <a href="http://live.visitmix.com/MIX10/Sessions/CL59">MIX 10 talk</a>, an introduction to unit testing on Silverlight and the Windows Phone, <a href="http://live.visitmix.com/MIX10/Sessions/CL59">is now online</a> for streaming and download. Thank you to everyone who attended.</p>
<p>An early preview set of bits are online at <a href="http://jeffatmix.com/">http://jeffatmix.com/</a> – and the next release of the Silverlight Toolkit when Silverlight 4 ships will contain support for the phone officially. Stay tuned for more.</p>
<p><a href="http://www.jeff.wilcox.name/2010/03/mix10-testing-talk-online/"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="SilverlightUnitTestFrameworkforWindowsPhone[1]" border="0" alt="SilverlightUnitTestFrameworkforWindowsPhone[1]" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/03/SilverlightUnitTestFrameworkforWindowsPhone1_thumb.jpg" width="360" height="480" /></a> </p>
<p>Over the next few weeks, I’ll be blogging plenty on these subjects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/03/mix10-testing-talk-online/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ready to test those Silverlight and Windows Phone 7 Series apps?</title>
		<link>http://www.jeff.wilcox.name/2010/03/mix10-cl59-intro/</link>
		<comments>http://www.jeff.wilcox.name/2010/03/mix10-cl59-intro/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 02:54:33 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[MIX]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/03/mix10-cl59-intro/</guid>
		<description><![CDATA[At MIX 10 this year, Tues. 3/16 at 2pm: Learn from Jeff Wilcox how to create and maintain Silverlight and Windows Phone 7 Series applications using the Silverlight Unit Test Framework.]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="Mix10_LoveTheWeb_blk_240" border="0" alt="Mix10_LoveTheWeb_blk_240" align="right" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/03/Mix10_LoveTheWeb_blk_240.jpg" width="240" height="320" /> That’s right, my MIX 10 session’s been announced! Come learn about testing those apps.</p>
<p><a href="http://live.visitmix.com/MIX10/Sessions/CL59"><strong>UNIT TESTING SILVERLIGHT AND WINDOWS PHONE APPLICATIONS</strong></a>    <br />Jeff Wilcox in Lagoon B (Mandalay Bay)    <br />Tuesday, March 16, 2010 2:05 PM (30 minutes)</p>
<p>Session materials, slides and code will be posted after the session at <a href="http://jeffatmix.com/">http://jeffatmix.com/</a>.</p>
<p>Synposis from <a href="http://live.visitmix.com/MIX10/Sessions/CL59">http://live.visitmix.com/MIX10/Sessions/CL59</a>:</p>
<blockquote><p>Learn how to create and maintain Silverlight and Windows Phone 7 Series applications using the Silverlight Unit Test Framework. See what tools are available to easily validate controls and application interfaces, add automatic testing to builds, and gain a solid understanding of test principles to deliver great experiences for your clients and customers.</p>
</blockquote>
<p><em>What’ll be new at MIX for testing?</em></p>
<ul>
<li>Support for testing those Windows Phone 7 Series apps!</li>
<li>New release of the Silverlight Unit Test Framework, with a modern user interface, Out of Browser support, and more.</li>
</ul>
<p>Hope to see you all in Vegas! And if not – these sessions always make it online super quick. Let me know if there’s anything in particular you want covered in the talk.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/03/mix10-cl59-intro/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Column guides for Visual Studio 2010: An extension</title>
		<link>http://www.jeff.wilcox.name/2010/02/visualstudio2010guides/</link>
		<comments>http://www.jeff.wilcox.name/2010/02/visualstudio2010guides/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 20:44:38 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/02/visualstudio2010guides/</guid>
		<description><![CDATA[On the Silverlight team, I use this Visual Studio 2010 extension to keep my comments looking pretty.]]></description>
			<content:encoded><![CDATA[<p>Here’s a helpful editing tool I’ve been using on the Silverlight team while coding. I’ve authored this simple Visual Studio 2010 extension that re-introduces column guidelines within the editor surface. The feature was <a href="http://blogs.msdn.com/saraford/archive/2004/11/15/257953.aspx">undocumented</a> in previous versions and isn’t in the new WPF-powered editor without a custom extension.</p>
<p><em>Note: Turns out Paul Harrington </em><a href="http://visualstudiogallery.msdn.microsoft.com/en-us/0fbf2878-e678-4577-9fdb-9030389b338c"><em>already wrote one</em></a><em>. Since I’m at least throwing my source out in public, I figure this blog post may still have some value. If you’re looking for a more baked solution, with some level of extensibility available, I’d recommend his. I’m not planning on building in a UI or offering this in the online extension guide for VS at this time since his works well.</em></p>
<h2>Download the extension</h2>
<p><a href="http://media.jeff.wilcox.name/blog/vs2010guides/JeffWilcox.VisualStudioGuides.vsix">VisualStudioGuides.vsix</a> [111 KB, Visual Studio Extension Package, Signed]</p>
<p><a href="http://media.jeff.wilcox.name/blog/vs2010guides/JeffWilcox.VisualStudioGuides.vsix"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="RedGuides" border="0" alt="RedGuides" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/RedGuides.png" width="685" height="496" /></a>     <br /><em>I’ve set the guides to be red in this screenshot to make it clear what the feature offers. In practice, the guides are typically very lightly colored, a dotted line, and quite small, so it doesn’t get in your way.</em></p>
<p>This works with all non-express SKUs of Visual Studio 2010 RC.</p>
<h3>Why use guides?</h3>
<p>On the Silverlight Toolkit team we always have had a high level of “engineering excellence”: like all developers, we love a good hearty discussion about code guidelines and style.</p>
<p>One thing we’re clear on is that comments should never extend beyond the 80th character of a line, though we don’t mind source code extending beyond that guide. Hyper-compressed code often ends up looking messy, but having comments always within your viewport, or when printing, is a help.</p>
<p>I’ve heard that the Common Language Runtime team here used to have a preference of no code running beyond 110 characters in a line. So perhaps a good default set of guides is 80 at a minimum, and 110 if you like that idea.</p>
<p>Here’s what the unsupported guides looked like in a previous Visual Studio version; this same dotted-line, lightly-colored behavior is present in my implementation.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VS2008" border="0" alt="VS2008" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/VS2008.png" width="685" height="294" /> </p>
<h3>How the guides are set</h3>
<p>Just as the old unsupported feature works, the registry contains these guide settings. There is a single string key that contains an RGB color definition, followed by any number of guides (integer column counts).</p>
<p>The format for the color is pretty self-explanatory.</p>
<p><strong>In my implementation, if you don’t have any registry key set, it defaults to column 80 and gray.</strong></p>
<p>If you want to easily add that decent default, save this text into a .reg file and execute it:</p>
<blockquote><p>Windows Registry Editor Version 5.00 </p>
<p>[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\Text Editor]      <br />&quot;Guides&quot;=&quot;RGB(220,220,220) 80&quot;</p>
</blockquote>
<p>If the tool does not find a guide in the 10.0 folder, then it will also look in the 9.0 folder (used for Visual Studio 2008).</p>
<h3>Source</h3>
<p><a href="http://media.jeff.wilcox.name/blog/vs2010guides/JeffWilcox.VisualStudioGuides.zip">Extension source and project for RC</a> [Zip, 51K]</p>
<p>Since the source is <a href="http://opensource.org/licenses/ms-pl.html">Ms-PL</a> (Microsoft Public License), feel free to use it to learn more about the extension features. The starting point for me writing this was actually the Text Adornment project starting template included with the <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=4659f71d-4e58-4dcd-b755-127539e21147">Visual Studio 2010 RC SDK</a> – you need the SDK to author extensions.</p>
<h4>Installing the extension</h4>
<p>The VSIX format is super easy to use: it’s really just a zip/package file. Just open the .vsix, read the terms, and click Install.</p>
<p><a href="http://media.jeff.wilcox.name/blog/vs2010guides/JeffWilcox.VisualStudioGuides.vsix"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Visual Studio Extension Installer" border="0" alt="Visual Studio Extension Installer" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/VisualStudioExtensionInstaller.png" width="492" height="376" /></a> </p>
<h4>Managing Extensions</h4>
<p>The improved extension system in 2010 is great: just go to Tools | Extension Manager, and you can uninstall, disable, and even find new extensions in the integrated online extension browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/02/visualstudio2010guides/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>AutoCompleteBox: Now with 100% more WPF</title>
		<link>http://www.jeff.wilcox.name/2010/02/wpfautocompletebox/</link>
		<comments>http://www.jeff.wilcox.name/2010/02/wpfautocompletebox/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 20:11:04 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/02/wpfautocompletebox/</guid>
		<description><![CDATA[The AutoCompleteBox control I originally developed for the Silverlight Toolkit is now inside of the WPF Toolkit.]]></description>
			<content:encoded><![CDATA[<p>Thanks to the work of the WPF Toolkit team (and especially <a href="http://blogs.msdn.com/patrickdanino/">Patrick Danino</a>), the February 2010 release of the WPF Toolkit includes as new components <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.autocompletebox(VS.95).aspx">AutoCompleteBox</a>, plus Accordion and Rating as well.</p>
<p><a href="http://wpf.codeplex.com/releases/view/40535"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="AutoCompleteBoxWpf" border="0" alt="AutoCompleteBoxWpf" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/AutoCompleteBoxWpf.png" width="618" height="664" /></a>     <br /><em>A WPF app that is running one of the AutoCompleteBox samples borrowed from the Silverlight Toolkit samples project, showing major airport names in a drop-down.</em></p>
<h3><a href="http://wpf.codeplex.com/releases/view/40535">Download the WPF Toolkit (February 2010 Release)</a></h3>
<h4>Resources</h4>
<ul>
<li><a href="http://www.bing.com/search?cp=1252&amp;FORM=FREESS&amp;q=autocompletebox&amp;q1=site%3Awww.jeff.wilcox.name">All of my AutoCompleteBox-related blog posts</a></li>
<li>Posts about this release: <a href="http://blogs.msdn.com/delay/archive/2010/02/22/this-is-what-happens-when-two-toolkits-fall-in-love-the-february-2010-release-of-the-wpf-toolkit-is-now-available.aspx">David Anson’s</a>, <a href="http://blogs.msdn.com/patrickdanino/archive/2010/02/22/wpf-toolkit-released.aspx">Patrick Danino’s</a></li>
</ul>
<p><em>And a quick aside… </em>when we began our <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> journey a few years ago, we became immediate advocates within the organization for compatibility with WPF, often building our controls to cross-compile, even if we didn’t have an immediate shipping plan for the WPF builds. <a href="http://blogs.msdn.com/delay/">David</a> sort of led the way here by offering his own unofficial <a href="http://blogs.msdn.com/delay/archive/2009/11/30/two-birds-squared-silverlight-wpf-data-visualization-development-release-3-and-a-datavisualizationdemos-update.aspx">gray market versions</a> of his charting and data visualization controls for WPF.</p>
<p>It’s nice to see things get out there in a more official mechanism, I know of many people enjoying the new-and-improved WPF Toolkit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/02/wpfautocompletebox/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Helpful Silverlight Snippets</title>
		<link>http://www.jeff.wilcox.name/2010/02/silverlight-snippets/</link>
		<comments>http://www.jeff.wilcox.name/2010/02/silverlight-snippets/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 21:56:33 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2010/02/silverlight-snippets/</guid>
		<description><![CDATA[Here are a few of the Visual Studio C# code snippets that we use on the Silverlight team when building controls and apps. Download a zip (7 KB) of them all and extract them into your Snippets folder, which is in your Documents folder: Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets\. These also work with [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few of the Visual Studio C# code snippets that we use on the Silverlight team when building controls and apps.</p>
<p><a href="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/Snippets.zip">Download a zip</a> (7 KB) of them all and extract them into your Snippets folder, which is in your Documents folder: <strong>Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets\</strong>. These also work with Visual Studio 2008.</p>
<h3>To use a snippet</h3>
<p>Inside the code editor, start typing the name of the snippet (such as dp, for a standard dependency property declaration section with a change handler). You should see it in the Intellisense drop-down.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ISDropdown" border="0" alt="ISDropdown" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ISDropdown.png" width="685" height="253" />&#160;</p>
<p>Press tab to accept the value.</p>
<p>If there are editing helpers for the snippet, use tab to move through the fields as you fill them out.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="ISCompletion" border="0" alt="ISCompletion" src="http://www.jeff.wilcox.name/wp-content/uploads/2010/02/ISCompletion.png" width="509" height="229" /> </p>
<p>Press Enter when you are finished. This should drop you right into the triple-slash comment field to fill that out.</p>
<h3>Included snippets</h3>
<table border="0" cellspacing="0" cellpadding="2" width="680">
<tbody>
<tr>
<td valign="top" width="183"><strong>Name</strong></td>
<td valign="top" width="497"><strong>Description</strong></td>
</tr>
<tr>
<td valign="top" width="183">dp</td>
<td valign="top" width="497">A standard dependency property with a property changed handler</td>
</tr>
<tr>
<td valign="top" width="183">dp_attached</td>
<td valign="top" width="497">An attached property declaration</td>
</tr>
<tr>
<td valign="top" width="183">dp_nohandler</td>
<td valign="top" width="497">A dependency property without a change handler</td>
</tr>
<tr>
<td valign="top" width="183">dp_value</td>
<td valign="top" width="497">A value type dependency property with change handler</td>
</tr>
<tr>
<td valign="top" width="183">dp_value_nohandler</td>
<td valign="top" width="497">A value type dependency property without a change handler</td>
</tr>
<tr>
<td valign="top" width="183">inot</td>
<td valign="top" width="497">An INotifyPropertyChanged implementation</td>
</tr>
<tr>
<td valign="top" width="183">test</td>
<td valign="top" width="497">A simple unit test method, descriptive comment, and description attribute</td>
</tr>
<tr>
<td valign="top" width="183">testa</td>
<td valign="top" width="497">An asynchronous unit test method</td>
</tr>
</tbody>
</table>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2010/02/silverlight-snippets/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Walkthrough: The power of the November 2009 Silverlight Toolkit testing tools</title>
		<link>http://www.jeff.wilcox.name/2009/11/november-walkthrough/</link>
		<comments>http://www.jeff.wilcox.name/2009/11/november-walkthrough/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 23:02:09 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/11/november-walkthrough/</guid>
		<description><![CDATA[The November 2009 Silverlight Toolkit is essentially a tools and infrastructure release on top of the October 2009 release (where we first introduced Visual Studio 2010 support). It also adds a Silverlight 4 Beta version. New infrastructure &#38; test tools ship in the Silverlight Toolkit There is a lot in the release that is joining [...]]]></description>
			<content:encoded><![CDATA[<p>The November 2009 Silverlight Toolkit is essentially a tools and infrastructure release on top of the October 2009 release (where we first introduced Visual Studio 2010 support). It also adds a Silverlight 4 Beta version.</p>
<h2>New infrastructure &amp; test tools ship in the Silverlight Toolkit</h2>
<p>There is a lot in the release that is joining publicly for the first time, based on some of the internal tools and utilities that we use in building and testing the Silverlight Toolkit, plus things we’d like to have as typical Silverlight developers.</p>
<p>These tools join in the Experimental quality band, and over the next few posts, I’ll dig into the details. This post is a literal walkthrough of how you could go about seeing all the utilities in the meantime.</p>
<p>One important thing to call out is that, as an initial release, there are definitely some rough edges: the test tools are centered around Microsoft Build (msbuild) integration, instead of Visual Studio integration; there’s no add-in or nice right-click project support to use these tools today.</p>
<p>We’ll be collecting feedback along the way and making changes in future releases. Until then, hopefully some of you will find the infrastructure useful, if only to peak behind the curtain. We’re also shipping the full source to these tools, you’ll find an Infrastructure.zip file inside the toolkit install folder.</p>
<h4>What we’ll do in this walkthrough</h4>
<p>This walkthrough uses Silverlight 4, though the instructions are virtually identical if you’re using Silverlight 3.</p>
<ul>
<li>Install the Silverlight Toolkit</li>
<li>Create a new Silverlight class library with a simple business object</li>
<li>Add a Silverlight Unit Test Application using the new templates found in the Silverlight Toolkit</li>
<li>Run the tests in Visual Studio</li>
<li>Run the tests from the command line in various browsers</li>
<li>Collect block-level code coverage information for the build</li>
</ul>
<p>This is screen-shot heavy, as future posts will dig into the details. I appreciate your patience!</p>
<p>Requirements:</p>
<ul>
<li>Latest Silverlight Toolkit</li>
<li>For test automation:</li>
</ul>
<ul>
<li>MSBuild on the machine</li>
</ul>
<li>For code coverage:</li>
<ul>
<li>Visual Studio 2010 Beta 2 Ultimate</li>
</ul>
<h2>Installing the tools</h2>
<p>When you install either Silverlight Toolkit drop from November, you’ll see that there’s a new feature listed in the setup: the Tools &amp; Templates feature. It’s selected by default, and adds Visual Studio templates, installs the tools, and prepares the tools if your machine has the proper dependencies on it.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="SetupNewFeature" border="0" alt="SetupNewFeature" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/SetupNewFeature.png" width="541" height="430" /> </p>
<h2>Create a Silverlight Class Library</h2>
<p>Open Visual Studio 2010 Beta 2, after installing the toolkit. Create a new <strong>Silverlight Class Library</strong> project, we’ll store a simple business object in it.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioNewSilverlightClassLibraryProject" border="0" alt="VisualStudioNewSilverlightClassLibraryProject" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioNewSilverlightClassLibraryProject.png" width="685" height="480" /> </p>
<p>Whichever flavor of Silverlight you use, remember to use the same flavor while creating future projects in the same solution!</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioSelectSilverlightVersion" border="0" alt="VisualStudioSelectSilverlightVersion" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioSelectSilverlightVersion.png" width="685" height="231" /></p>
<p>Create a new Person.cs type, with a few properties and a method. Here’s the source:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:bc34624e-1aaa-4618-a4cc-6c9dad4c3107" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">using System;

namespace MyApplication
{
    public class Person
    {
        public string First { get; set; }
        public string Last { get; set; }

        public string FullName { get { return First + " " + Last; } }

        public bool MightBe(string substring)
        {
            return FullName.Contains(substring);
        }
    }
}</pre>
</div>
<h2>Add a Silverlight Unit Test Application</h2>
<p>Right-click on the solution in the Solution Explorer and select Add New Project. Under the Visual C# (and also Visual Basic) languages node, select the Silverlight subgroup. You’ll see a <strong>Silverlight Unit Test Application</strong> project template.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioUnitTestTemplate" border="0" alt="VisualStudioUnitTestTemplate" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioUnitTestTemplate.png" width="685" height="446" /></p>
<p>You now have two projects:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioTestAppAndClassLibrarySolutionExplorer" border="0" alt="VisualStudioTestAppAndClassLibrarySolutionExplorer" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioTestAppAndClassLibrarySolutionExplorer.png" width="283" height="385" /></p>
<p>Next up, we want to add a reference to the class library, so that the unit tests can access the library. Right-click on the new test project and then select the Add Reference option. Under the Project tab, choose the class library you created earlier.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioAddReference" border="0" alt="VisualStudioAddReference" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioAddReference.png" width="593" height="478" /></p>
<p>Now, let’s add some unit tests. Clear out the content in the created Tests.cs file and drop this in:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:a7e8d8fd-b4cb-4725-bb1a-cd35db6190c2" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">using Microsoft.VisualStudio.TestTools.UnitTesting;
using MyApplication;

namespace PersonTestProject {
    [TestClass]
    public class Tests
    {
        [TestMethod]
        public void TestCtor()
        {
            Person p = new Person();
        }

        [TestMethod]
        public void TestSetName()
        {
            Person p = new Person { First = "Scott", Last = "Guthrie" };
            Assert.AreNotEqual(p.First, p.Last);
        }

        [TestMethod]
        public void TestGetFullName()
        {
            Person p = new Person { First = "Steve", Last = "Ballmer" };
            StringAssert.Equals("Steve Ballmer", p.FullName);
        }
    }
}</pre>
</div>
<p>The tests are pretty simple, and exercise various simple PMEs on the type.</p>
<h2>Run the unit tests from Visual Studio</h2>
<p>Right-click on the test project and select Set as StartUp Project from the menu. Then, press F5 or click the Run button to begin execution.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioSetAsStartupProject" border="0" alt="VisualStudioSetAsStartupProject" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioSetAsStartupProject.png" width="530" height="605" /> </p>
<p> The default web browser will open up, the tests will run, and the window will stay open. When you are satisfied, close the browser. You’ve just run some simple tests!</p>
<h2>Running unit tests from the Visual Studio command line</h2>
<p>More interesting is being able to automate the tests: through MSBuild, we’ve added a task that can control the browser and save out the log file(s) from the unit tests when they run.</p>
<p>To do this, you need a few things:</p>
<ul>
<li>The Visual Studio command prompt open.</li>
<li>The full path to the test project.</li>
</ul>
<h4>Open the command prompt</h4>
<p>Personally, I always pin the Visual Studio 2008 tools command prompt next to my Visual Studio taskbar icons.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TaskbarCmdPrompt" border="0" alt="TaskbarCmdPrompt" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/TaskbarCmdPrompt.png" width="685" height="71" /> </p>
<p>You can start it from the Start Menu, under the tools for the Visual Studio version you are using.</p>
<p>Alternatively, make sure MSBuild is in your path.</p>
<p>Or, start a command prompt and then move to your 32-bit Program Files, then ‘Visual Studio 9.0’, then VC. Run ‘vcvarsall.bat x86’</p>
<p><strong>Note</strong>: all these command prompts should be 32-bit, even on a x64 machine. Silverlight is a 32-bit world today.</p>
<h4>Move to the test project</h4>
<p>To get the full path to the test project, I just right-click on the test project in Visual Studio, then Open Folder in Windows Explorer. I copy the path from the resulting Explorer dialog’s crumb navigation bar.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioOpenWindowsExplorerForProjectLocation" border="0" alt="VisualStudioOpenWindowsExplorerForProjectLocation" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioOpenWindowsExplorerForProjectLocation.png" width="685" height="428" /> </p>
<p>Now, inside the command prompt window, move to that path:</p>
<blockquote>
<p>pushd (PASTE PATH HERE) &lt;enter&gt;</p>
</blockquote>
<p>To run the unit tests in the default browser, simply type </p>
<blockquote>
<p><strong>msbuild /t:test</strong> </p>
</blockquote>
<p>and press Enter.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CommandLineMsbuildTest" border="0" alt="CommandLineMsbuildTest" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CommandLineMsbuildTest.png" width="685" height="120" /></p>
<p>You’ll see the browser open, quickly run some tests, and then close. Here’s what it looks like, captured in the middle of the 5-second test run:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TestRunningInInternetExplorer" border="0" alt="TestRunningInInternetExplorer" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/TestRunningInInternetExplorer.png" width="685" height="345" /></p>
<p>And afterwards, you’ll see that Msbuild reports success, and you can read the test to see that 3 passing tests were reported, out of 3 total tests.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CommandLineMsbuildTestWithResults" border="0" alt="CommandLineMsbuildTestWithResults" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CommandLineMsbuildTestWithResults.png" width="685" height="433" /></p>
<h3>Running tests in Google Chrome</h3>
<p>It’s easy! Just set the browser property to Chrome.</p>
<blockquote>
<p><strong><font color="#808080">msbuild /t:test </font>/p:browser=chrome</strong></p>
</blockquote>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CommandLineMsbuildTestChrome" border="0" alt="CommandLineMsbuildTestChrome" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CommandLineMsbuildTestChrome.png" width="685" height="67" />&#160;</p>
<p>And just like that, Chrome opens up and runs the tests.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TestRunningInChrome" border="0" alt="TestRunningInChrome" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/TestRunningInChrome.png" width="685" height="428" /></p>
<h3>Running tests in Mozilla Firefox</h3>
<p>Just set the browser to Firefox.</p>
<blockquote>
<p><strong><font color="#808080">msbuild /t:test </font>/p:browser=firefox</strong></p>
</blockquote>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TestRunningInFirefox" border="0" alt="TestRunningInFirefox" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/TestRunningInFirefox.png" width="685" height="428" /></p>
<h3>Tag Expressions</h3>
<p>A nice feature to help select a subset of tests is the Tag Expression syntax. By specifying a tag expression at the command prompt, you can include and exclude tests that are marked with the Tag attribute found in Microsoft.Silverlight.Testing.</p>
<p>Also, tags <strong>implicitly exist for all test method names,</strong> short and full.</p>
<p>So, let’s run the test called <strong>TestSetName</strong> from our project.</p>
<blockquote>
<p><strong><font color="#808080">msbuild /t:test </font>/p:tagexpression=TestSetName</strong></p>
</blockquote>
<p>You may briefly see indication in the test UI in the browser that a ‘Tag expression’ is in use.</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="TestRunningInInternetExplorerWithTagExpression" border="0" alt="TestRunningInInternetExplorerWithTagExpression" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/TestRunningInInternetExplorerWithTagExpression.png" width="685" height="344" /></p>
<p>And the build results show that just one test ran:</p>
<p>&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CommandLineMsbuildTestWithTagExpressionResults" border="0" alt="CommandLineMsbuildTestWithTagExpressionResults" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CommandLineMsbuildTestWithTagExpressionResults.png" width="685" height="433" /> </p>
<p>If you want to run all tests <strong>except that one</strong>, use this tag expression:</p>
<blockquote>
<p><strong><font color="#808080">msbuild /t:test </font>/p:tagexpression=!TestSetName</strong></p>
</blockquote>
<p>Cool, and easy!</p>
<h3>Test results files</h3>
<p>Another nice feature of running the tests through MSBuild is that you’ll see test result files (end in *.trx) inside the same folder as the test page for the application.</p>
<p>Similar and conformant to the Visual Studio *.trx format, you can parse and work with this data to understand execution times, results, and read other information. Unfortunately, you cannot open these files in Visual Studio 2010 Beta 2, but they do open in Visual Studio 2008. Note that there isn’t any real test integration with VS here: this is just an informative display. </p>
<p>Here’s a directory with several test result files (plus some coverage stuff we’ll get to later):</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="LookingInTheBinariesFolderAfterTestsRun" border="0" alt="LookingInTheBinariesFolderAfterTestsRun" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/LookingInTheBinariesFolderAfterTestsRun.png" width="685" height="502" /></p>
<p>You can open up the TestResults trx file and see what kind of information is in it:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="LookingAtTheTrxFile" border="0" alt="LookingAtTheTrxFile" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/LookingAtTheTrxFile.png" width="685" height="524" /></p>
<p>And here’s the results file opened in Visual Studio:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudio2008TestResultsTrxFile" border="0" alt="VisualStudio2008TestResultsTrxFile" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudio2008TestResultsTrxFile.png" width="685" height="312" />&#160;</p>
<h2>Preparing for Code Coverage</h2>
<p>Ripe for a Visual Studio add-in, this process requires us modifying the test project’s .csproj file some. Instructions are the same for Visual Studio.</p>
<p>We need to <strong>manually select the assembly to be instrumented </strong>by setting a property. The assembly to be instrumented must not be signed, and not have a strong name. In this example, the assembly is <strong>SilverlightClassLibrary3</strong>.</p>
<p>To make changes to the test project, to specify this, first unload the project by right-clicking on the test project and selecting the Unload option: </p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioUnloadProject" border="0" alt="VisualStudioUnloadProject" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioUnloadProject.png" width="503" height="621" /></p>
<p>Then, right-click the project file that is ‘(unavailable) and select ‘Edit’. </p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioEditProject" border="0" alt="VisualStudioEditProject" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioEditProject.png" width="492" height="214" /></p>
<p>Now you’ll see the XML data for the project. Scroll down in the template to where there is a commented out ItemGroup, and some comments about the code coverage support. Remove the comments from the ItemGroup: </p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioEditingTestProjectFileOriginal" border="0" alt="VisualStudioEditingTestProjectFileOriginal" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioEditingTestProjectFileOriginal.png" width="685" height="435" /></p>
<p>And now, change the Include statement from SilverlightClassLibrary1 to whatever your assembly to instrument is called. In our example here, it is called SilverlightClassLibrary3.</p>
<p>&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioEditingTestProjectFile2" border="0" alt="VisualStudioEditingTestProjectFile2" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioEditingTestProjectFile2.png" width="685" height="435" /> </p>
<p> Now, that’s it. Let’s close the file and then right-click the project again and select Reload Project:</p>
<p>&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="VisualStudioReloadTestProject" border="0" alt="VisualStudioReloadTestProject" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioReloadTestProject.png" width="502" height="400" /> </p>
<p> Now we’re ready to go!</p>
<h2>Running Silverlight Code Coverage</h2>
<p>Just like the msbuild /t:test from above, we have a similar target named <strong>CoverageTest</strong> and <strong>CoverageView</strong>. CoverageTest collects the data, while CoverageView collects the coverage data and then shows the results in an application that explores the hit and not hit portions of your source code.</p>
<p>Let’s collect coverage!</p>
<p><strong>Note:</strong> This is assuming that you have a high-level SKU of Visual Studio 2010 Beta 2 installed. The coverage tools depend on the Static Analysis Tools that ship in the beta. You will receive an error if you run this on a machine without those tools. We’ll look for a better experience in the future.</p>
<p>Remember, the same properties from above – browser and tag expression – still can apply and work in the coverage targets.</p>
<blockquote>
<p><strong><font color="#808080">msbuild </font>/t:coveragetest</strong></p>
</blockquote>
<p>Here is what it will look like if everything line up. Unfortunately, the coverage experience is a very early preview and very flaky in some situations due to the dependency on beta components. We also haven’t had I admit enough time to iron out all the issues customers may experience.</p>
<p>You see the Instrumentation messages come out, then the RunTests target, then the coverage data is merged and things should be successful. </p>
<p>&#160;<img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CommandLineMsbuildCoverageTestResults" border="0" alt="CommandLineMsbuildCoverageTestResults" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CommandLineMsbuildCoverageTestResults.png" width="685" height="433" /></p>
<p>If that worked, it is safe to assume that the view target will also work. It will re-run all the tests and instrument again as well.</p>
<blockquote>
<p><strong><font color="#808080">msbuild </font>/t:coverageview</strong></p>
</blockquote>
<p>Now you’ll see the viewer popup, that lets you drill into types and methods to see what is hit (cyan) or not hit (red), to spot code that your tests are missing:</p>
<h3><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="LookingAtCodeCoverage" border="0" alt="LookingAtCodeCoverage" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/LookingAtCodeCoverage.png" width="685" height="428" /></h3>
<p>You’ll find a Coverage.xml file in the same directory where the test results go. This is the data that is used by the viewer application. You’ll see in the XML file a set of ‘visited’ blocks, and other information, in the file:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="CoverageXmlFile" border="0" alt="CoverageXmlFile" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/CoverageXmlFile.png" width="685" height="435" /> </p>
<p>More to come soon!</p>
<h3>Download the Silverlight Toolkit November 2009 Release Today</h3>
<p><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Toolkit32[2][2][2]" border="0" alt="Toolkit32[2][2][2]" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/Toolkit32222.png" width="685" height="88" /></a> </p>
<p>The Silverlight Toolkit is a collection of Silverlight controls, components and utilities that help make Silverlight development a little easier, more fun, and add value outside the regular Silverlight release cycle.</p>
<p>The sixth release of the Silverlight Toolkit, the November 2009 release targets Silverlight 3. There is also a release available that targets the new Silverlight 4 Beta for developers.</p>
<p>Resources of note:</p>
<ul>
<li><a href="http://silverlight.codeplex.com/">Learn more about the Silverlight Toolkit</a> </li>
<li><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><strong>Download the November 2009 Release</strong></a> </li>
<li><a href="http://silverlight.net/getstarted/">Get started with Silverlight development</a> </li>
<li>Participate in the <a href="http://silverlight.net/forums/35.aspx">controls community at Silverlight.net</a> </li>
<li>Check out questions and answers on Stack Overflow using the <a href="http://stackoverflow.com/questions/tagged/silverlight-toolkit">‘silverlight-toolkit’ tag</a> </li>
<li>The <a href="http://silverlight.codeplex.com/WorkItem/List.aspx">Issue Tracker</a> can be used to report issues, add to the feature wish list, and vote on the work to be done by the Microsoft team </li>
</ul>
<p><em>Hope you enjoy our new release!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2009/11/november-walkthrough/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
		<item>
		<title>Taking the Silverlight Control Browser sample Out-of-Browser &#8230; plus a tutorial</title>
		<link>http://www.jeff.wilcox.name/2009/11/out-of-browser-tutorial/</link>
		<comments>http://www.jeff.wilcox.name/2009/11/out-of-browser-tutorial/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 00:47:17 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/11/out-of-browser-tutorial/</guid>
		<description><![CDATA[The Silverlight Controls Browser sample app can now be taken out-of-browser. Here's info on that, plus how to get it done in your own apps.]]></description>
			<content:encoded><![CDATA[<p>We’ve enabled <a href="http://msdn.microsoft.com/en-us/library/dd550721(VS.95).aspx">Out of Browser support</a> for the Silverlight Control Browser application for the Silverlight Toolkit. That was reason enough for me to blog a little bit about that, and offer an overall guide to how to hook up to the proper events and respond to install state changes. Near the end of the post, I’ve even come up with a more attractive update notification that I hope I can move the samples app to in the future – message boxes are so <em>n – 14</em> years ago.</p>
<p>The <a href="http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html">Silverlight Control Browser</a> is a one-stop resource for learning about the core controls in Silverlight, the controls in the Silverlight SDK (like DataGrid), and of course the value-add controls and features that are found in the extra <a href="http://silverlight.codeplex.com/">Silverlight Toolkit download</a>.</p>
<p>By installing the app on your machine, you can learn about the controls even when offline. Perfect for those long holiday flights that are coming up this next month, when your airline doesn’t provide wireless Internet. <em>(Aside: I recently flew Delta and the wireless in-flight Internet rocked. Big time. I’ve never had a flight home to Seattle go by so quickly)</em></p>
<p>Another scenario: the infamous hipster coffee shops in Seattle whose wifi routers go down and never come up again. This morning I was in such a coffee shop without Internet, but was still able to fire up the sample app and grab a screen shot for the new <strong><a href="http://www.jeff.wilcox.name/2009/11/busy-indicator-control/">BusyIndicator control that’s in the Silverlight Toolkit now</a></strong>.</p>
<p><em><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BusyIndicatorSample" border="0" alt="BusyIndicatorSample" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/BusyIndicatorSample1.png" width="685" height="419" />&#160;</em></p>
<h4>Any interest in an Out of Browser Helper Control?</h4>
<p>One thing I’ve been wondering if whether an ‘OutOfBrowserHelper’ control would be a useful, and quick, control for us to turn around inside the Silverlight Toolkit: something that has a very small scope, specific purpose, and will save developers time.</p>
<p>I’m imaging that this would wrap up the update logic, potentially offer the Install button, and other core services. I don’t know how practical it is, but I’d be interested in thoughts out there. Later in this post I talk about what all you need to do to enable the right Out of Browser update pattern in your apps.</p>
<p>I’ve created a <a href="http://silverlight.codeplex.com/WorkItem/View.aspx?WorkItemId=4708"><strong>Wishlist Feature request on the Silverlight Toolkit issue tracker</strong></a> to see if anyone else thinks it would be interesting… </p>
<p>A well-designed app that looks great in the browser looks great outside of it, too. What I like most about the Silverlight Out of Browser feature, compared to others, is that you don’t need to install anything else: no special runtime, no User Account Control permission, etc – since those apps run in the same security sandbox that Silverlight apps do while hosted in the Silverlight plugin.</p>
<p>This post is specific to that nice, simple Out of Browser support in Silverlight 3. For the hardcode developers out there, and some very interesting scenarios, Silverlight 4 adds a special elevated trust mode. That mode is outside the scope of this post.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="OutOfBrowser" border="0" alt="OutOfBrowser" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/OutOfBrowser.png" width="685" height="483" /></p>
<h3>Enabling Out of Browser for your own applications</h3>
<p>A key feature in Silverlight 3, it takes about half an hour to enable Out of Browser if you’re a developer and looking to create your own graphics for the experience. Your users will notice that you have no design talent, but that is half the fun. Also, this is why “battleship gray” is so prevalent in Windows today.</p>
<p>If you have graphic assets from your designers, you can add the feature in about 2 minutes.</p>
<p>Here’s the technical set of hoops you need to do to define the Out of Browser metadata for your app.</p>
<h4>Using Visual Studio 2008 or Visual Studio 2010 Beta 2</h4>
<ul>
<li>First off, once you have the Silverlight Tools installed, just right-click on the project file in the Solution Explorer.</li>
<li>Then, navigate to the Silvelright tab.</li>
<li>Check the ‘Enable running application out of the browser’ option. This option will not be available if the ‘Reduce XAP size by using application library caching’ option is checked, fyi.</li>
<li>Click the ‘Out-of-Browser Settings’ button.</li>
</ul>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="VisualStudioOutOfBrowser" border="0" alt="VisualStudioOutOfBrowser" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/VisualStudioOutOfBrowser.png" width="685" height="526" /> </p>
<p>This window will then allow you to set the Out of Browser information, such as a nice quick blurb about the app, the application title, and other basics. This data is all stored in the .\Properties\OutOfBrowserSettings.xml in your project directory structure.</p>
<p>You’ll need to have those icons ready at this point.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="OutOfBrowserSettings" border="0" alt="OutOfBrowserSettings" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/OutOfBrowserSettings.png" width="552" height="667" /> </p>
<p>Click OK, and that is it: your application can now be taken out of the browser!</p>
<h4>OutOfBrowserSettings.xml</h4>
<p>This file should be placed inside your Properties folder of the Silverlight application project. Visual Studio will create it for you when you enable the experience, and in fact the Silverlight Tools even offer tooling to easily modify these properties. If you author it by hand, the file is of build type ‘None’, and hooked up inside the .csproj or VB project through these properties:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:16096c81-6d25-4020-ba6c-f0d9b49a70ff" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">    &lt;EnableOutOfBrowser&gt;true&lt;/EnableOutOfBrowser&gt;
    &lt;OutOfBrowserSettingsFile&gt;Properties\OutOfBrowserSettings.xml&lt;/OutOfBrowserSettingsFile&gt;</pre>
</div>
<p>Here’s what it looks like for the Silverlight Toolkit. We’ve defined the expected 16&#215;16, 32&#215;32, 48&#215;48, and 128&#215;128 brand icons. The icons are included in the project and marked as ‘Content’ in the Visual Studio properties dialog, so that they are in the Xap at the end of the build process.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:40457d6f-4a75-4e73-b5b2-29cbc8011750" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;OutOfBrowserSettings ShortName="Silverlight Controls Browser" EnableGPUAcceleration="True" ShowInstallMenuItem="True"&gt;
  &lt;OutOfBrowserSettings.Blurb&gt;Sample explorer for the controls and features found in the Silverlight Toolkit and Silverlight SDK.&lt;/OutOfBrowserSettings.Blurb&gt;
  &lt;OutOfBrowserSettings.WindowSettings&gt;
    &lt;WindowSettings Title="Silverlight Controls Browser" /&gt;
  &lt;/OutOfBrowserSettings.WindowSettings&gt;
  &lt;OutOfBrowserSettings.Icons&gt;
    &lt;Icon Size="16,16"&gt;Toolkit16.png&lt;/Icon&gt;
    &lt;Icon Size="32,32"&gt;Toolkit32.png&lt;/Icon&gt;
    &lt;Icon Size="48,48"&gt;Toolkit48.png&lt;/Icon&gt;
    &lt;Icon Size="128,128"&gt;Toolkit128.png&lt;/Icon&gt;
  &lt;/OutOfBrowserSettings.Icons&gt;
&lt;/OutOfBrowserSettings&gt;</pre>
</div>
<h4>Other options</h4>
<p>There are several additional Out of Browser options to chose from. The Silverlight 4 Beta also adds the elevated trust option here.</p>
<p><strong>Use GPU Acceleration: </strong>Check this to enable acceleration if your application will benefit from this.</p>
<p><strong>Show install menu:</strong> By default selected, this adds the option to Install the app (and take it Out of Browser) to the right-click menu for your Silverlight application.</p>
<p>If you decide not to show the install menu, you’ll need to implement your own user interface to show an Install button or other experience.</p>
<p>The one included in the Silverlight Toolkit sample app is a good example – implemented in Welcome.xaml and Welcome.xaml.cs, it is aware of the state of the running application and whether to offer the install option or not.&#160;&#160; </p>
<h4>Implementing all the necessary things to make Out of Browser shine</h4>
<p>Tim Heuer offers important information about making the <a href="http://timheuer.com/blog/tags/out-of-browser/default.aspx">Out of Browser experience world-class</a>. For instance, you need to actually have you app asynchronously check for updates, and offer information about the availability of any updates.</p>
<ul>
<li>You need to call CheckAndDownloadAsync and react to that in your user interface</li>
<li>You should check the InstallState if you want to offer different user interfaces depending on the Out of Browser state</li>
</ul>
<p>Tim also has a <a href="http://timheuer.com/blog/archive/2009/08/12/silverlight-out-of-browser-force-install-pattern.aspx">recommended pattern</a> for effectively forcing an app to only be available Out of Browser, similar to the experience you might find with <a href="http://www.tweetdeck.com/beta/">other popular apps</a> that live outside of the browser.</p>
<p>Here’s the App.xaml.cs file from the Silverlight Toolkit controls sample browser, to give you an idea of what we do. We’re only showing a MessageBox when an update becomes available, but you can make the experience a little richer if needed (see father down the post for that).</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:c6437c92-f507-4946-9901-96fcbf4d1225" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Windows;
using System.Collections.Generic;
using System.Linq;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// System.Windows.Controls samples application.
    /// &lt;/summary&gt;
    public partial class App : Application
    {
        /// &lt;summary&gt;
        /// Initializes a new instance of the App class.
        /// &lt;/summary&gt;
        public App()
        {
            if (App.Current.InstallState == InstallState.Installed)
            {
                App.Current.CheckAndDownloadUpdateCompleted += OnCheckAndDownloadUpdateCompleted;
                App.Current.CheckAndDownloadUpdateAsync();
            }

            Startup += delegate
            {
                RootVisual = new SampleBrowser(SampleTreeItems);
            };
            InitializeComponent();
        }

        /// &lt;summary&gt;
        /// Checks for the update completed event.
        /// &lt;/summary&gt;
        /// &lt;param name="sender"&gt;The source object.&lt;/param&gt;
        /// &lt;param name="e"&gt;The event arguments.&lt;/param&gt;
        private void OnCheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
        {
            if (e.UpdateAvailable)
            {
                MessageBox.Show("An application update has been downloaded and "
                              + "will be available the next time you start the "
                              + "sample application.");
            }
            else if (e.Error != null)
            {
                MessageBox.Show("While checking for an application update, the "
                              + "following message was encountered:"
                              + Environment.NewLine
                              + Environment.NewLine
                              + e.Error.Message);
            }
        }
    }
}</pre>
</div>
<h4>Offering a button experience for taking the app Out of Browser</h4>
<p>Although you could just offer the experience in the right-click context menu of your Silverlight app in the browser, that’s not a very well-advertised and visual feature. For the samples app, we expose a button to “Install” the app on the machine.</p>
<p>We want to be able to update that offering UI in real-time, so once the user takes the app out of browser, the Install button is no longer visible.</p>
<p>We do this by subscribing in the Welcome.xaml.cs page to the OnInstallStateChanged event of the Application:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:2b2db57e-de3c-4e26-a9c3-a13dd7a7d79b" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">// Make sure that we are connected to the installation state change
// at least once.
Application.Current.InstallStateChanged += OnInstallStateChanged;</pre>
</div>
<p>And our Button has an event handler attached to start the actual install. The install call needs to happen in a user-initiated action: you can’t just call it whenever you like, but instead it needs to be placed somewhere in response to the user making a conscious installation decision:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:07209058-bef5-4c81-b174-8bf3bf534ba3" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">/// &lt;summary&gt;
/// Installs the application.
/// &lt;/summary&gt;
/// &lt;param name="sender"&gt;The source object.&lt;/param&gt;
/// &lt;param name="e"&gt;The event arguments.&lt;/param&gt;
[SuppressMessage("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode", Justification = "Event connected in XAML.")]
private void InstallSamplesClick(object sender, RoutedEventArgs e)
{
    Application.Current.Install();
}</pre>
</div>
<p>When they click that button, they’ll see the Consent Experience for the app. The clear and concise consent dialog is powered by Silverlight, but you’re able to customize the graphic displayed with your own designer brand asset: </p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="OutOfBrowserPrompt" border="0" alt="OutOfBrowserPrompt" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/OutOfBrowserPrompt.png" width="498" height="233" /></p>
<p>And then we are able to react to that by manually changing text, enabled status, visibility, etc. I’m sure a data binding expert would be able to make this example a little more attractive looking, but the code works!</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:5c394a85-644f-4ff5-b729-6eea2e7b75fc" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">/// &lt;summary&gt;
/// Shows or hides the installation button.
/// &lt;/summary&gt;
/// &lt;param name="sender"&gt;The source object.&lt;/param&gt;
/// &lt;param name="e"&gt;The event data.&lt;/param&gt;
private void OnInstallStateChanged(object sender, EventArgs e)
{
    switch (App.Current.InstallState)
    {
        case InstallState.Installing:
            InstallButton.Visibility = Visibility.Visible;
            InstallButton.IsEnabled = false;
            InstallButton.Content = "Installing...";
            break;

        case InstallState.Installed:
            InstallButton.Visibility = Visibility.Collapsed;
            InstallText.Text = "The samples have been installed on this computer.";
            break;

        case InstallState.NotInstalled:
            InstallButton.Visibility = Visibility.Visible;
            InstallButton.IsEnabled = true;
            break;

        case InstallState.InstallFailed:
            InstallButton.Visibility = Visibility.Collapsed;
            InstallText.Text = "The Out of Browser installation failed.";
            break;
    }

    InstallApplicationPanel.Visibility = App.Current.IsRunningOutOfBrowser ? Visibility.Collapsed : Visibility.Visible;
}</pre>
</div>
<h4>A smoother notification method</h4>
<p>Since most users aren’t going to immediately want to close the app they are working with, when an update becomes available, you’ll realize that the MessageBox.Show(…) route for the notification is jarring and rather inappropriate.</p>
<p>If you instead embed that information inside of your user interface, it can be simple “FYI” that is not as abrupt.</p>
<p>Here’s a simple use: if your root visual for the app contains a DockPanel, you could have a collapsed user interface element for displaying important messages, such as the availablility of an update.</p>
<p>Here’s what my UI might look like when a new version is available:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="UpdateNotification" border="0" alt="UpdateNotification" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/UpdateNotification.png" width="682" height="403" /> </p>
<p>This user interface is accomplished with the toolkit’s DockPanel control, plus a little code behind. Here is the main application XAML:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:ecbee8b9-234f-42a9-b91d-d92e8abe7b19" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;controlsToolkit:DockPanel Background="White"&gt;
    &lt;!-- Out of Browser Notification --&gt;
    &lt;Border Height="32"
            BorderBrush="#b4a555"
            BorderThickness="1"
            x:Name="OutOfBrowserNotification"
            Visibility="Collapsed"
            controlsToolkit:DockPanel.Dock="Top"&gt;
        &lt;Grid&gt;
            &lt;Grid.Background&gt;
                &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                    &lt;GradientStop Color="#fff6bd" Offset="0" /&gt;
                    &lt;GradientStop Color="#ffec82" Offset="1" /&gt;
                &lt;/LinearGradientBrush&gt;
            &lt;/Grid.Background&gt;
            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition /&gt;
                &lt;ColumnDefinition Width="24" /&gt;
            &lt;/Grid.ColumnDefinitions&gt;
            &lt;StackPanel Orientation="Horizontal"&gt;
                &lt;TextBlock FontWeight="Bold"
                           VerticalAlignment="Center"
                           Text="Update Notification:"
                           Margin="5" /&gt;
                &lt;TextBlock VerticalAlignment="Center"&gt;The next time you use
                    this app, you'll be on the hot new version.
                &lt;/TextBlock&gt;
            &lt;/StackPanel&gt;
            &lt;TextBlock Grid.Column="1"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       FontWeight="Bold"
                       Text="X"
                       Padding="6"
                       MouseLeftButtonDown="OnCloseUpdateNotification"
                       /&gt;
        &lt;/Grid&gt;
    &lt;/Border&gt;

    &lt;Grid x:Name="LayoutRoot"&gt;
        &lt;Button Content="Your Application Goes Here"
                Opacity=".4"/&gt;
    &lt;/Grid&gt;
&lt;/controlsToolkit:DockPanel&gt;</pre>
</div>
<p>So, except when an update is available, the top notification section would not even be taking up any space. So here’s the code that responds to the application’s CheckAndDownloadUpdateCompleted event:</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:3c12dc57-b4f3-4445-a24b-499d795f01d0" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">private void OnCheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
{
    if (e != null &#038;&#038; e.UpdateAvailable)
    {
        OutOfBrowserNotification.Visibility = System.Windows.Visibility.Visible;
    }
}</pre>
</div>
<p>Behind the scenes, I’ve wired up a fake close button, so users can dismiss the window at their leisure:</p>
<p><div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:63e23869-b24c-4376-b9cd-5ff693533b60" class="wlWriterEditableSmartContent">
<pre class="c-sharp" name="code">private void OnCloseUpdateNotification(object sender, MouseButtonEventArgs e)
{
    OutOfBrowserNotification.Visibility = System.Windows.Visibility.Collapsed;
}</pre>
</div>
<p>For more information about the Silverlight Out of Browser feature, please check out the official <a href="http://msdn.microsoft.com/en-us/library/dd550721(VS.95).aspx">MSDN Library documentation, “Out-of-Browser Support”</a>.</p>
<h4>Out of Browser and Application Library Caching: Mutually Exclusive</h4>
<p>You may have also read that we’re <a href="http://www.jeff.wilcox.name/2009/11/app-library-caching-nov-2009/">finally shipping the application library cache support files</a> in the November 2009 release of the Silverlight Toolkit. Unfortunately, we haven’t enabled library cache support for the samples application, because we feel the value provided by Out of Browser trumps the cached library scenario.</p>
<p>When you setup Out of Browser support, you cannot enable Application Library Caching. The Visual Studio project properties are good about enforcing this.</p>
<p>The reason is that the Out of Browser experience requires that the entire Xap be self-contained, and when you enable application library caching for a project, it drops a bunch of .Zip files (zipped up versions of those dependent libraries) alongside the main app’s .Xap file. When Out of Browser, you may not always be able to download or grab those files.</p>
<h4>Consider a Splash Screen if you have a large app that is Out-of-Browser enabled</h4>
<p>I created a custom splash screen experience for the controls sample app that is hosted up on Silverlight.net, since the application is several megs. Your grandmother’s probably not interested in the control browser app, so don’t worry about those 14.4k modem users. My grandmother isn’t even interested, and she knows I work on this stuff!</p>
<p>The splash screen for the Silverlight Toolkit consists of a Silverlight Toolkit brand logo, a ton of TextBlocks, and I’m also using the native Grid to center the entire experience within the plugin. There’s a little JavaScript to update the text block with the percents, and the rest of the cycling animation is powered by several Storyboards that start when the page is initally loaded.</p>
<p>This is a good alternative to application library caching in some situations. Do remember to keep the splash screen small – users are much more interested in your app. Hopefully.</p>
<h3>Download the Silverlight Toolkit November 2009 Release Today</h3>
<p><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Toolkit32" border="0" alt="Toolkit32" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/Toolkit32.png" width="685" height="88" /></a> </p>
<p>The Silverlight Toolkit is a collection of Silverlight controls, components and utilities that help make Silverlight development a little easier, more fun, and add value outside the regular Silverlight release cycle.</p>
<p>The sixth release of the Silverlight Toolkit, the November 2009 release targets Silverlight 3. There is also a release available that targets the new Silverlight 4 Beta for developers.</p>
<p>Resources of note:</p>
<ul>
<li><a href="http://silverlight.codeplex.com/">Learn more about the Silverlight Toolkit</a> </li>
<li><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><strong>Download the November 2009 Release</strong></a> </li>
<li><a href="http://silverlight.net/getstarted/">Get started with Silverlight development</a> </li>
<li>Participate in the <a href="http://silverlight.net/forums/35.aspx">controls community at Silverlight.net</a> </li>
<li>Check out questions and answers on Stack Overflow using the <a href="http://stackoverflow.com/questions/tagged/silverlight-toolkit">‘silverlight-toolkit’ tag</a> </li>
<li>The <a href="http://silverlight.codeplex.com/WorkItem/List.aspx">Issue Tracker</a> can be used to report issues, add to the feature wish list, and vote on the work to be done by the Microsoft team </li>
</ul>
<p><em>Hope you enjoy our new release!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2009/11/out-of-browser-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BusyIndicator: David Poll&#8217;s ActivityControl is now in the Silverlight Toolkit November 2009 Release</title>
		<link>http://www.jeff.wilcox.name/2009/11/busy-indicator-control/</link>
		<comments>http://www.jeff.wilcox.name/2009/11/busy-indicator-control/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 23:37:02 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/11/busy-indicator-control/</guid>
		<description><![CDATA[BusyIndicator is a new control included in the November 2009 release of the Silverlight Toolkit.]]></description>
			<content:encoded><![CDATA[<p>Microsoft Program Manager <a href="http://www.davidpoll.com/">David Poll</a> is passionate about improving rich Internet application experiences involving data, and he previously blogged about his nice ActivityControl (<a href="http://www.davidpoll.com/?p=4">here</a> and <a href="http://www.davidpoll.com/2009/09/14/update-2-displaying-background-activity-in-a-silverlight-ria-application/">here</a>). The control is designer to provide a visual hint to users when an asynchronous update operation is going on – the type that can’t be interrupted.</p>
<p>It’s important to provide the user feedback that the UI is not hung, or crashed, but is in fact processing. This fills that void, and is really easy to get going with.</p>
<p>After some initial meetings with David, it became clear that the control would make a nice addition to the portfolio of valuable controls that are inside of the <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a>, so thanks to everyone who came together to get this added to the November release.</p>
<h3>Quick guide to using the control</h3>
<h4>IsBusy</h4>
<p>The key dependency property on the BusyIndicator control is the IsBusy bool property. It’s easy to data bind to your data model, or programmatically toggle on and off.</p>
<p>When toggled to true, the actual content of the BusyIndicator control (which itself is a ContentControl) will no longer be enabled.</p>
<h4>Place your content inside the control</h4>
<p>In the most simple use case, just place your content inside the control and bind to the model. When IsBusy is set to true, you’ll see the waiting user interface appear.</p>
<p>Your controls that are wrapped by the BusyIndicator control will not be enabled during the busy time, preventing the user from inadvertently altering the data state during the operation.</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:1086e259-5fd5-4933-8389-a2248f0a0692" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Grid x:Name="LayoutRoot" Background="White"&gt;
    &lt;controlsToolkit:BusyIndicator IsBusy="{Binding DataServicesAreBusy}"&gt;

        &lt;!-- This button will not be enabled when IsBusy is set to True --&gt;
        &lt;Button Content="This is a button" HorizontalAlignment="Center"  VerticalAlignment="Center" Padding="8"/&gt;

    &lt;/controlsToolkit:BusyIndicator&gt;
&lt;/Grid&gt;</pre>
</div>
<h4>Customizing the busy content</h4>
<p>The entire thing is very customizable, you can use data templates and even retemplate the control. David Anson covered this <a href="http://blogs.msdn.com/delay/archive/2009/11/18/silverlight-4-beta-is-out-and-the-toolkit-has-it-covered-silverlight-toolkit-november-2009-release-now-available-for-silverlight-3-and-4.aspx">in his post yesterday on the topic</a>.</p>
<p>Here’s a quick example of changing the text that is displayed – the Content property can take any kind of content, so you could even put a quick game in there if you wanted to go overboard.</p>
</p>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:887EC618-8FBE-49a5-A908-2339AF2EC720:43e84fe4-5da5-43da-b964-e31f66aeda88" class="wlWriterEditableSmartContent">
<pre class="xml" name="code">&lt;Grid x:Name="LayoutRoot" Background="White"&gt;

    &lt;controlsToolkit:BusyIndicator IsBusy="{Binding DataServicesAreBusy}"&gt;
            &lt;controlsToolkit:BusyIndicator.BusyContent&gt;
                &lt;TextBlock Text="Reticulating Splines..."
                           FontSize="18"
                           FontWeight="Bold" /&gt;
            &lt;/controlsToolkit:BusyIndicator.BusyContent&gt;

                &lt;!-- This button will not be enabled when IsBusy is set to True --&gt;
        &lt;Button Content="This is a button" HorizontalAlignment="Center"  VerticalAlignment="Center" Padding="8"/&gt;

    &lt;/controlsToolkit:BusyIndicator&gt;
&lt;/Grid&gt;</pre>
</div>
<p>And here’s what that looks like in a real application when IsBusy is true:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Splines" border="0" alt="Splines" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/Splines.png" width="685" height="383" />&#160; </p>
<h3>Find out more in the Silverlight Controls Browser</h3>
<p>Just like all other controls in the Silverlight core runtime, SDK, and the Silverlight Toolkit, you’ll find the Activity Control in the Silverlight Controls Browser. It is under the Toolkit tree view item, near the bottom of the list on the left part of the app.</p>
<p>Silverlight 3 <a href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html">samples are here</a>. </p>
<p>Silverlight 4 Beta <a href="http://silverlight.net/content/samples/sl4/toolkitcontrolsamples/run/default.html">samples are here</a>, if you’re a developer and have the Silverlight 4 Beta on your machine.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="BusyIndicatorSample" border="0" alt="BusyIndicatorSample" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/BusyIndicatorSample.png" width="685" height="419" />&#160;</p>
<h3>Where to find the control</h3>
<p>You’ll find the BusyIndicator control in the System.Windows.Controls.Toolkit.dll assembly, documentation in the Silverlight Toolkit docs, a few unit tests, and yeah it’s in the sample browser as well. It lives in the System.Windows.Controls namespace.</p>
<p>Hope you enjoy having this control available in the Silverlight Toolkit!</p>
<h3>Download the Silverlight Toolkit November 2009 Release Today</h3>
<p><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Toolkit[3]" border="0" alt="Toolkit[3]" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/Toolkit3.png" width="685" height="88" /></a> </p>
<p>The Silverlight Toolkit is a collection of Silverlight controls, components and utilities that help make Silverlight development a little easier, more fun, and add value outside the regular Silverlight release cycle.</p>
<p>The sixth release of the Silverlight Toolkit, the November 2009 release targets Silverlight 3. There is also a release available that targets the new Silverlight 4 Beta for developers.</p>
<p>Resources of note:</p>
<ul>
<li><a href="http://silverlight.codeplex.com/">Learn more about the Silverlight Toolkit</a> </li>
<li><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><strong>Download the November 2009 Release</strong></a> </li>
<li><a href="http://silverlight.net/getstarted/">Get started with Silverlight development</a> </li>
<li>Participate in the <a href="http://silverlight.net/forums/35.aspx">controls community at Silverlight.net</a> </li>
<li>Check out questions and answers on Stack Overflow using the <a href="http://stackoverflow.com/questions/tagged/silverlight-toolkit">‘silverlight-toolkit’ tag</a> </li>
<li>The <a href="http://silverlight.codeplex.com/WorkItem/List.aspx">Issue Tracker</a> can be used to report issues, add to the feature wish list, and vote on the work to be done by the Microsoft team </li>
</ul>
<p><em>Hope you enjoy our new release!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2009/11/busy-indicator-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Application Library Caching &#8211; November 2009 Silverlight Toolkit</title>
		<link>http://www.jeff.wilcox.name/2009/11/app-library-caching-nov-2009/</link>
		<comments>http://www.jeff.wilcox.name/2009/11/app-library-caching-nov-2009/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 22:49:06 +0000</pubDate>
		<dc:creator>Jeff Wilcox</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Silverlight Toolkit]]></category>

		<guid isPermaLink="false">http://www.jeff.wilcox.name/2009/11/app-library-caching-nov-2009/</guid>
		<description><![CDATA[The November 2009 release of the Silverlight Toolkit finally includes application library caching support to help reduce the size of your application .Xaps.]]></description>
			<content:encoded><![CDATA[<p>We’ve decided to include, free of charge,<strong> </strong>application library cache support in the <a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060">November 2009 release</a> of the <a href="http://silverlight.codeplex.com/">Silverlight Toolkit</a> for Microsoft Silverlight 3 and also a preview supporting the new Silverlight 4 Beta. One of the many ways that we continue to deliver high-value in our open source set of goodies for Silverlight developers.</p>
<p>Kidding aside, yes, you can finally enable library caching when using the latest release. Since our installations are always side-by-side friendly, you should get this support immediately after installing the latest release that pairs with your Silverlight development environment.</p>
<p><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ReduceXapSize" border="0" alt="ReduceXapSize" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/ReduceXapSize.png" width="525" height="501" /> </p>
<p>Note that the Out of Browser feature of Silverlight is unavailable for your application if you use this feature, since key libraries need to be contained inside your Out of Browser Xap file.</p>
<p>Previously available <a href="http://www.jeff.wilcox.name/2009/10/toolkit-extmaps/">only by blog</a>, the application library cache files sit alongside the control, feature, and theme binaries for the Silverlight Toolkit and enable the Silverlight SDK to package up those components separately, improving application download and startup time in some situation for application users starting the second time they use your app.</p>
<h3>Toolkit Libraries Supported</h3>
<ul>
<li>Microsoft.Silverlight.Testing.dll </li>
<li>Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll </li>
<li>System.ComponentModel.Composition.Packaging.Toolkit.dll<em> <font color="#004080"><strong>(Silverlight 4 Toolkit Only)</strong></font> </em></li>
<li>System.Reactive.dll <strong><font color="#004080"><em>(Note: This is a pre-release version of the Reactive Framework at this time and supports the Drag and Drop features introduced in the last release)</em></font></strong> </li>
<li>System.Windows.Controls.Data.DataForm.Toolkit.dll </li>
<li>System.Windows.Controls.Data.Toolkit.dll </li>
<li>System.Windows.Controls.DataVisualization.Toolkit.dll </li>
<li>System.Windows.Controls.Input.Toolkit.dll </li>
<li>System.Windows.Controls.Layout.Toolkit.dll </li>
<li>System.Windows.Controls.Theming.Toolkit.dll </li>
<li>System.Windows.Controls.Toolkit.dll </li>
</ul>
<h3>Toolkit Themes Supported</h3>
<ul>
<li>System.Windows.Controls.Theming.BubbleCreme.dll </li>
<li>System.Windows.Controls.Theming.BureauBlack.dll </li>
<li>System.Windows.Controls.Theming.BureauBlue.dll </li>
<li>System.Windows.Controls.Theming.ExpressionDark.dll </li>
<li>System.Windows.Controls.Theming.ExpressionLight.dll </li>
<li>System.Windows.Controls.Theming.RainierOrange.dll </li>
<li>System.Windows.Controls.Theming.RainierPurple.dll </li>
<li>System.Windows.Controls.Theming.ShinyBlue.dll </li>
<li>System.Windows.Controls.Theming.ShinyRed.dll </li>
<li>System.Windows.Controls.Theming.TwilightBlue.dll </li>
<li>System.Windows.Controls.Theming.WhistlerBlue.dll </li>
</ul>
<h3>Size differences</h3>
<p>Here’s a simple application with a chart, you can see that the .Xap file weighs in around 345 KB:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="OriginalSize[1]" border="0" alt="OriginalSize[1]" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/OriginalSize1.png" width="680" height="475" /> </p>
<p>After enabling the application library cache support, check it out:</p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="UpdatedSize[1]" border="0" alt="UpdatedSize[1]" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/UpdatedSize1.png" width="680" height="475" /> </p>
<p>The core .Xap is now 41 KB. Of course, there are no time savings on the first download: all those other .Zip files with the extensions are downloaded as well. But if you update your .Xap file, you likely do not need to refresh the .Zip files with the cached libraries. So your users only download the new 41 KB on next visit after a change, instead of hundreds of kilobytes.</p>
<p><strong>Sorry!     <br /></strong>In retrospect, I admit that it’s quite embarrassing that we didn’t offer application library caching support right off-the-bat alongside the Silverlight 3 release. Having limited time and resources to deliver for each release, we’re not always able to get it all done.</p>
<p>Keep letting us know what you want us to work on by voicing your opinion on our blogs and by voting on the <a href="http://silverlight.codeplex.com/WorkItem/List.aspx">CodePlex Work Item Tracker</a> (it tracks both feature requests and bugs).</p>
<h3>Download the Silverlight Toolkit November 2009 Release Today</h3>
<p><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Toolkit" border="0" alt="Toolkit" src="http://www.jeff.wilcox.name/wp-content/uploads/2009/11/Toolkit.png" width="685" height="88" /></a> </p>
<p>The Silverlight Toolkit is a collection of Silverlight controls, components and utilities that help make Silverlight development a little easier, more fun, and add value outside the regular Silverlight release cycle.</p>
<p>The sixth release of the Silverlight Toolkit, the November 2009 release targets Silverlight 3. There is also a release available that targets the new Silverlight 4 Beta for developers.</p>
<p>Resources of note:</p>
<ul>
<li><a href="http://silverlight.codeplex.com/">Learn more about the Silverlight Toolkit</a></li>
<li><a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"><strong>Download the November 2009 Release</strong></a></li>
<li><a href="http://silverlight.net/getstarted/">Get started with Silverlight development</a></li>
<li>Participate in the <a href="http://silverlight.net/forums/35.aspx">controls community at Silverlight.net</a></li>
<li>Check out questions and answers on Stack Overflow using the <a href="http://stackoverflow.com/questions/tagged/silverlight-toolkit">‘silverlight-toolkit’ tag</a></li>
<li>The <a href="http://silverlight.codeplex.com/WorkItem/List.aspx">Issue Tracker</a> can be used to report issues, add to the feature wish list, and vote on the work to be done by the Microsoft team</li>
</ul>
<p><em>Hope you enjoy our new release!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jeff.wilcox.name/2009/11/app-library-caching-nov-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
