<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Benjamin Roux</title><subtitle type="html">Silverlight Expert - Silverlight Fan - MVP Client App Dev</subtitle><id>http://weblogs.asp.net/broux/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/broux/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2009-08-20T08:23:16Z</updated><entry><title>[WP7 App] Bixel: Bixi in Montreal</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2011/04/16/wp7-app-bixel-bixi-in-montreal.aspx" /><id>http://weblogs.asp.net/broux/archive/2011/04/16/wp7-app-bixel-bixi-in-montreal.aspx</id><published>2011-04-16T20:09:28Z</published><updated>2011-04-16T20:09:28Z</updated><content type="html">&lt;p&gt;Hello everyone,&lt;/p&gt;  &lt;p&gt;I just release my first personal WP7 application and it’s called Bixel.&lt;/p&gt;  &lt;p&gt;Bixel locates the nearest Bixi stations in Montreal. You can add them to your favorites, see the directions and see the number of available docks and bikes.&lt;/p&gt;  &lt;p&gt;I will add some features in the next few days but I wanted to release a functional version for the new Bixi season which begins today.&lt;/p&gt;  &lt;p&gt;Here are some screenshots&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.50.26.928_4BE0A5C8.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="_4-3-2011_19.50.26.928" border="0" alt="_4-3-2011_19.50.26.928" src="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.50.26.928_thumb_4BA0D03B.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.53.27.26_49179E7D.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="_4-3-2011_19.53.27.26" border="0" alt="_4-3-2011_19.53.27.26" src="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.53.27.26_thumb_3AC8FFC0.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.55.19.694_6E24C31C.png"&gt;&lt;img style="background-image: none; border-right-width: 0px; margin: 0px 0px 0px 20px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="_4-3-2011_19.55.19.694" border="0" alt="_4-3-2011_19.55.19.694" src="http://weblogs.asp.net/blogs/broux/_4-3-2011_19.55.19.694_thumb_2A3D16A0.png" width="148" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Bixel is available for free on the Marketplace, in French and English.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://social.zune.net/redirect?type=phoneApp&amp;amp;id=10f8f2cb-555e-e011-854c-00237de2db9e"&gt;&lt;img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" border="0" alt="Télécharger" src="http://www.runatserver.com/Images/wp7app.png" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7761143" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Personal" scheme="http://weblogs.asp.net/broux/archive/tags/Personal/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /><category term="WP7" scheme="http://weblogs.asp.net/broux/archive/tags/WP7/default.aspx" /></entry><entry><title>[Silverlight] How to watermark a WriteableBitmap with a text</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2011/02/08/silverlight-how-to-watermark-a-writeablebitmapimage-with-a-text.aspx" /><id>http://weblogs.asp.net/broux/archive/2011/02/08/silverlight-how-to-watermark-a-writeablebitmapimage-with-a-text.aspx</id><published>2011-02-08T20:48:00Z</published><updated>2011-02-08T20:48:00Z</updated><content type="html">&lt;p&gt;Hello,&lt;/p&gt;  &lt;p&gt;In my current project, I needed to watermark a WriteableBitmap with a text. As I couldn’t find anything I decided to create a small extension method to do so.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public static class WriteableBitmapEx
{
    /// &amp;lt;summary&amp;gt;
    /// Creates a watermark on the specified image
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name="input"&amp;gt;The image to create the watermark from&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="watermark"&amp;gt;The text to watermark&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="color"&amp;gt;The color - default is White&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="fontSize"&amp;gt;The font size - default is 50&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="opacity"&amp;gt;The opacity - default is 0.25&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="hasDropShadow"&amp;gt;Specifies if a drop shadow effect must be added - default is true&amp;lt;/param&amp;gt;
    /// &amp;lt;returns&amp;gt;The watermarked image&amp;lt;/returns&amp;gt;
    public static WriteableBitmap Watermark(this WriteableBitmap input, string watermark, Color color = default(Color), double fontSize = 50, double opacity = 0.25, bool hasDropShadow = true)
    {
        var watermarked = GetTextBitmap(watermark, fontSize, color == default(Color) ? Colors.White : color, opacity, hasDropShadow);

        var width = watermarked.PixelWidth;
        var height = watermarked.PixelHeight;

        var result = input.Clone();

        var position = new Rect(input.PixelWidth - width - 20 /* right margin */, input.PixelHeight - height, width, height);
        result.Blit(position, watermarked, new Rect(0, 0, width, height));

        return result;
    }

    /// &amp;lt;summary&amp;gt;
    /// Creates a WriteableBitmap from a text
    /// &amp;lt;/summary&amp;gt;
    /// &amp;lt;param name="text"&amp;gt;&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="fontSize"&amp;gt;&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="color"&amp;gt;&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="opacity"&amp;gt;&amp;lt;/param&amp;gt;
    /// &amp;lt;param name="hasDropShadow"&amp;gt;&amp;lt;/param&amp;gt;
    /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;
    private static WriteableBitmap GetTextBitmap(string text, double fontSize, Color color, double opacity, bool hasDropShadow)
    {
        TextBlock txt = new TextBlock();
        txt.Text = text;
        txt.FontSize = fontSize;
        txt.Foreground = new SolidColorBrush(color);
        txt.Opacity = opacity;

        if (hasDropShadow) txt.Effect = new DropShadowEffect();

        WriteableBitmap bitmap = new WriteableBitmap((int)txt.ActualWidth, (int)txt.ActualHeight);
        bitmap.Render(txt, null);

        bitmap.Invalidate();

        return bitmap;
    }
}&lt;/pre&gt;

&lt;p&gt;For this code to run, you need the &lt;a href="http://writeablebitmapex.codeplex.com/" target="_blank" mce_href="http://writeablebitmapex.codeplex.com/"&gt;WritableBitmapEx library&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As you can see, it’s quite simple. You just need to call the Watermark method and pass it the text you want to add in your image. You can also pass optional parameters like the color, the opacity, the fontsize or if you want a drop shadow effect. I could have specify other parameters like the position or the the font family but you can change the code if you need to.&lt;/p&gt;

&lt;p&gt;Here’s what it can give&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/image_07B9C478.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/image_thumb_6649F90E.png" style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px; padding-top: 0px" title="image" alt="image" border="0" height="278" width="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7700545" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>[WP7] How to decompile WP7 assemblies</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2011/02/03/wp7-how-to-decompile-wp7-assemblys.aspx" /><id>http://weblogs.asp.net/broux/archive/2011/02/03/wp7-how-to-decompile-wp7-assemblys.aspx</id><published>2011-02-03T18:24:00Z</published><updated>2011-02-03T18:24:00Z</updated><content type="html">&lt;p&gt;The other day I wanted to check the source code of the ScrollViewer of WP7. I started Reflector (profit while its still free) and I opened the System.Windows.dll assembly located at C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone. When Reflector did the job I was surprised to see that all the methods/properties were empty !&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/reflector_7C868B20.png" mce_href="http://weblogs.asp.net/blogs/broux/reflector_7C868B20.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/reflector_thumb_083BD253.png" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="reflector" alt="reflector" mce_src="http://weblogs.asp.net/blogs/broux/reflector_thumb_083BD253.png" border="0" height="359" width="457"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After some investigations, I found out that these assemblys are used by Visual Studio for the Intelisense (among others) and so, for develoment.&lt;/p&gt;  &lt;p&gt;The thing is I still couldn’t check the ScrollViewer’s source code. &lt;/p&gt;  &lt;p&gt;Finally after new investigations, I discovered a link on the &lt;a href="http://forum.xda-developers.com/showthread.php?t=647138" mce_href="http://forum.xda-developers.com/showthread.php?t=647138" target="_blank"&gt;XDA forum&lt;/a&gt; which provide the WP7 emulator dump. I downloaded it and decompiled the GAC_System.Windows_v2_0_5_0_cneutral_1.dll assembly located this time at /SYS/SILVERLIGHT.&lt;/p&gt;  &lt;p&gt;Et voila, the ScrollViewer’s source code is available.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/image_7E93641C.png" mce_href="http://weblogs.asp.net/blogs/broux/image_7E93641C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/image_thumb_226C15AA.png" style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="image" alt="image" mce_src="http://weblogs.asp.net/blogs/broux/image_thumb_226C15AA.png" border="0" height="359" width="457"&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hope this helps.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7696841" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /><category term="Reflector" scheme="http://weblogs.asp.net/broux/archive/tags/Reflector/default.aspx" /><category term="Windows Phone" scheme="http://weblogs.asp.net/broux/archive/tags/Windows+Phone/default.aspx" /><category term="WP7" scheme="http://weblogs.asp.net/broux/archive/tags/WP7/default.aspx" /></entry><entry><title>[Silverlight] How to choose the webcam resolution</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2011/02/03/silverlight-how-to-choose-the-webcam-resolution.aspx" /><id>http://weblogs.asp.net/broux/archive/2011/02/03/silverlight-how-to-choose-the-webcam-resolution.aspx</id><published>2011-02-03T17:54:23Z</published><updated>2011-02-03T17:54:23Z</updated><content type="html">&lt;p&gt;Hello,&lt;/p&gt;  &lt;p&gt;Today I’m gonna show you how to choose the webcam resolution when using Silverlight. By default most of them are in 640x480 which can be sometimes insufficient.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;VideoCaptureDevice source = devices.SelectedItem as VideoCaptureDevice; 
source.DesiredFormat = new VideoFormat(PixelFormatType.Unknown, 4096, 4096, 30);&lt;/pre&gt;

&lt;p&gt;The magic thing with this line, is that the camera will choose the best resolution available (and not absolutely 4096x4096).&lt;/p&gt;

&lt;p&gt;You can also get all the supported formats using the SupportedFormats property.&lt;/p&gt;

&lt;p&gt;Hope this help.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7696819" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>[Silverlight] Suggestion – Move INotifyCollectionChanged from System.Windows.dll to System.dll</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/05/19/silverlight-suggestion-move-inotifycollectionchanged-from-system-windows-dll-to-system-dll.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/05/19/silverlight-suggestion-move-inotifycollectionchanged-from-system-windows-dll-to-system-dll.aspx</id><published>2010-05-19T20:22:18Z</published><updated>2010-05-19T20:22:18Z</updated><content type="html">&lt;p&gt;I just submitted a suggestion on &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/560184/move-inotifycollectionchanged-from-system-windows-dll-to-system-dll"&gt;Microsoft Connect&lt;/a&gt; to move the &lt;em&gt;INotifyCollectionChanged&lt;/em&gt; from &lt;em&gt;System.Windows.dll&lt;/em&gt; to &lt;em&gt;System.dll&lt;/em&gt;.&lt;/p&gt;  &lt;p&gt;You can review it here: &lt;a title="https://connect.microsoft.com/VisualStudio/feedback/details/560184/move-inotifycollectionchanged-from-system-windows-dll-to-system-dll" href="https://connect.microsoft.com/VisualStudio/feedback/details/560184/move-inotifycollectionchanged-from-system-windows-dll-to-system-dll"&gt;https://connect.microsoft.com/VisualStudio/feedback/details/560184/move-inotifycollectionchanged-from-system-windows-dll-to-system-dll&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here’s the reason why I suggest that.&lt;/p&gt;  &lt;p&gt;Actually I wanted to take advantages of the new feature of Silverlight/Visual Studio 2010 for sharing assemblies (see &lt;a href="http://blogs.msdn.com/clrteam/archive/2009/12/01/sharing-silverlight-assemblies-with-net-apps.aspx" target="_blank"&gt;http://blogs.msdn.com/clrteam/archive/2009/12/01/sharing-silverlight-assemblies-with-net-apps.aspx&lt;/a&gt;). Everything went fine until I try to share a custom collection (with custom business logic) implementing &lt;em&gt;INotifyCollectionChanged&lt;/em&gt;.    &lt;br /&gt;This modification has been made in the .NET Framework 4 (see &lt;a href="https://connect.microsoft.com/VisualStudio/feedback/details/488607/move-inotifycollectionchanged-to-system-dll" target="_blank"&gt;https://connect.microsoft.com/VisualStudio/feedback/details/488607/move-inotifycollectionchanged-to-system-dll&lt;/a&gt;) so maybe it could be done in Silverlight too.&lt;/p&gt;  &lt;p&gt;If you think this is justifiable you can vote for it.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7490267" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>[Silverlight] Need Silverlight graphist for an online game</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/02/03/silverlight-need-silverlight-graphist-for-an-online-game.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/02/03/silverlight-need-silverlight-graphist-for-an-online-game.aspx</id><published>2010-02-03T17:17:09Z</published><updated>2010-02-03T17:17:09Z</updated><content type="html">&lt;p&gt;Hi everyone,&lt;/p&gt;  &lt;p&gt;I just created a multiplayer turn-based online game and I'm looking for a Silverlight graphist to realize the design of the game itself and of the hosting website (room, room chat, in-game chat...).&lt;/p&gt;  &lt;p&gt;The game is 90% completed but I cant publish it as is, I need a good graphist for making it awesome!&lt;/p&gt;  &lt;p&gt;In case of success and if we make some money, there will be equal share!&lt;/p&gt;  &lt;p&gt;Just post a comment or contact me if you’re interested.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7333073" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Personal" scheme="http://weblogs.asp.net/broux/archive/tags/Personal/default.aspx" /><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /><category term="Games" scheme="http://weblogs.asp.net/broux/archive/tags/Games/default.aspx" /></entry><entry><title>The Memoirs of Sir Isaac Newton's life in Silverlight</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/01/20/the-memoirs-of-sir-isaac-newton-s-life-in-silverlight.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/01/20/the-memoirs-of-sir-isaac-newton-s-life-in-silverlight.aspx</id><published>2010-01-20T19:36:58Z</published><updated>2010-01-20T19:36:58Z</updated><content type="html">&lt;p&gt;The &lt;a href="http://royalsociety.org/Turning-the-Pages/" target="_blank"&gt;Royal Society&lt;/a&gt; just published a manuscript of William Stukeley which relates the life of Sir Isaac Newton with, of course, the famous apple which leads to the general gravitational low.&lt;/p&gt;  &lt;p&gt;This manuscript, as well as many others, are available for consultation through a &lt;a href="http://rs.onlineculture.co.uk/silverlight/" target="_blank"&gt;Silverlight player&lt;/a&gt; but also a &lt;a href="http://rs.onlineculture.co.uk/xbap/" target="_blank"&gt;xbap&lt;/a&gt; version.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7317606" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /><category term="Fun" scheme="http://weblogs.asp.net/broux/archive/tags/Fun/default.aspx" /></entry><entry><title>[Silverlight] My Entry for the MIX 10K Coding Challenge</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/01/12/silverlight-my-entry-for-the-mix-10k-coding-challenge.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/01/12/silverlight-my-entry-for-the-mix-10k-coding-challenge.aspx</id><published>2010-01-12T15:41:33Z</published><updated>2010-01-12T15:41:33Z</updated><content type="html">&lt;p&gt;Hello everyone,&lt;/p&gt;  &lt;p&gt;Today, I’d like to present you my entry for the &lt;a href="http://mix10k.visitmix.com/" target="_blank"&gt;MIX 10K Coding Challenge&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" border="0" alt="http://mix10k.visitmix.com/Uploads/140/Thumbnail.jpg" src="http://mix10k.visitmix.com/Uploads/140/Thumbnail.jpg" /&gt;&lt;/p&gt;  &lt;p&gt;For those who don’t know this challenge, the rules are really simple. You have to submit an application whose the source code’s size is less than 10 kilobytes. The technologies allowed are Silverlight, HTML5 and Gestalt.&lt;/p&gt;  &lt;p&gt;As you can guess, I chose Silverlight 3 and my source code’s size is 9.5 kilobytes.&lt;/p&gt;  &lt;p&gt;So if you like my app, vote for me!&lt;/p&gt;  &lt;p&gt;&lt;a title="http://mix10k.visitmix.com/Entry/Details/140" href="http://mix10k.visitmix.com/Entry/Details/140"&gt;http://mix10k.visitmix.com/Entry/Details/140&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Thanks!&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7308336" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Personal" scheme="http://weblogs.asp.net/broux/archive/tags/Personal/default.aspx" /><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /><category term="MIX10" scheme="http://weblogs.asp.net/broux/archive/tags/MIX10/default.aspx" /></entry><entry><title>[Silverlight] An image loading control</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/01/11/silverlight-an-image-loading-control.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/01/11/silverlight-an-image-loading-control.aspx</id><published>2010-01-11T20:08:57Z</published><updated>2010-01-11T20:08:57Z</updated><content type="html">&lt;p&gt;Re,&lt;/p&gt;  &lt;p&gt;Ok the title is not really explicit but in this post we’re going to see an image control which display the busy pointer that we saw in &lt;a href="http://weblogs.asp.net/broux/archive/2010/01/11/silverlight-a-busy-mouse-pointer.aspx"&gt;my previous post&lt;/a&gt;, until the image be loaded.&lt;/p&gt;  &lt;p&gt;First we create the Xaml composed with two controls: an image and the Busy pointer.&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;UserControl&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Class&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;xxx.ImageProgress&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #ff0000"&gt;xmlns&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #ff0000"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #ff0000"&gt;xmlns:local&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;clr-namespace:xxx&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Background&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;White&amp;quot;&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;Image&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Image&amp;quot;&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Stretch&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Fill&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;local:BusyPointer&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;&lt;span style="color: #0000ff"&gt;=&amp;quot;Buffer&amp;quot;&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;Grid&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;UserControl&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;And some C#&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Media.Imaging;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; xxx&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ImageProgress : UserControl&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ImageProgress()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            InitializeComponent();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; BitmapImage Source&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            get { &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (BitmapImage)GetValue(SourceProperty); }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            set&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                SetValue(SourceProperty, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;.DownloadProgress += &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; EventHandler&amp;lt;DownloadProgressEventArgs&amp;gt;(value_DownloadProgress);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Image.Source = &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.BeginAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; value_DownloadProgress(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, DownloadProgressEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.Progress == 100)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                StopAnimation();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #008000"&gt;// Using a DependencyProperty as the backing store for Source.  This enables animation, styling, binding, etc...&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; DependencyProperty SourceProperty =&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            DependencyProperty.Register(&lt;span style="color: #006080"&gt;&amp;quot;Source&amp;quot;&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(BitmapImage), &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(ImageProgress), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyMetadata(&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyChangedCallback(OnSourceChanged)));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; OnSourceChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            ImageProgress source = sender &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; ImageProgress;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (source != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;) source.Source = (BitmapImage)e.NewValue;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; BeginAnimation()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Buffer.IsBusy = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;#160;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; StopAnimation()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Buffer.IsBusy = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Buffer.Visibility = Visibility.Collapsed;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;I created a Dependency Property for the image’s source. When this DP is changed, I download the image from the source we I display the busy pointer. When the download is complete I stop the animation and hide it.&lt;/p&gt;

&lt;p&gt;This control can be really useful if your application uses images from external source like Flickr or Bing.&lt;/p&gt;

&lt;p&gt;We could check the &lt;em&gt;ImageFailed&lt;/em&gt; event for notifying the user if there is an error.&lt;/p&gt;

&lt;p&gt;Live sample: &lt;a title="http://broux.developpez.com/public/SL/ImageProgress/index.html" href="http://broux.developpez.com/public/SL/ImageProgress/index.html"&gt;http://broux.developpez.com/public/SL/ImageProgress/index.html&lt;/a&gt; (the image is 4MB).&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7307332" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>[Silverlight] A busy mouse pointer</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2010/01/11/silverlight-a-busy-mouse-pointer.aspx" /><id>http://weblogs.asp.net/broux/archive/2010/01/11/silverlight-a-busy-mouse-pointer.aspx</id><published>2010-01-11T16:18:00Z</published><updated>2010-01-11T16:18:00Z</updated><content type="html">
&lt;p&gt; Hello everyone,&lt;/p&gt;
  
&lt;p&gt;Today I’m gonna present you a control which can be really useful, since you can find him in Windows: the busy mouse pointer. This control is used for notice the user than something is happening.&lt;/p&gt;
  
&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/loading_2730360C.png" mce_href="http://weblogs.asp.net/blogs/broux/loading_2730360C.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/loading_thumb_5BD09247.png" style="border: 0px none ; display: block; float: none; margin-left: auto; margin-right: auto;" title="loading" alt="loading" mce_src="http://weblogs.asp.net/blogs/broux/loading_thumb_5BD09247.png" border="0" height="51" width="54"&gt;&lt;/a&gt;&lt;/p&gt;
  
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
  
&lt;p&gt;The code for this control is quite simple.&lt;/p&gt;
  &lt;div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;" id="codeSnippetWrapper"&gt;   &lt;div style="border-style: none; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;" id="codeSnippet"&gt;     
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#region&lt;/span&gt; Dependency Properties&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt; IsBusy&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    get { &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; (&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;)GetValue(IsBusyProperty); }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    set &lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    { &lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;        SetValue(IsBusyProperty, &lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;        ChangeState();&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 128, 0);"&gt;// Using a DependencyProperty as the backing store for IsBusy.  This enables animation, styling, binding, etc...&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;readonly&lt;/span&gt; DependencyProperty IsBusyProperty =&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    DependencyProperty.Register(&lt;span style="color: rgb(0, 96, 128);"&gt;"IsBusy"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;), &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(BusyPointer), &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; PropertyMetadata(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; PropertyChangedCallback(OnBusyChanged)));&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnBusyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    ((BusyPointer)sender).IsBusy = (&lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt;)e.NewValue;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#region&lt;/span&gt; Initialization&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; BusyPointer()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.DefaultStyleKey = &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(BusyPointer);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#region&lt;/span&gt; Methods&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; ChangeState()&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (IsBusy) VisualStateManager.GoToState(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"Busied"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;else&lt;/span&gt; VisualStateManager.GoToState(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"Normal"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(204, 102, 51);"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Juste a very simple control with a IsBusy property. When the value is true the animation starts, when it’s false it stops.&lt;/p&gt;

&lt;p&gt;And the theme I use.&lt;/p&gt;

&lt;div style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;" id="codeSnippetWrapper"&gt;
  &lt;div style="border-style: none; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;" id="codeSnippet"&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:BusyPointer"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Template"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:BusyPointer"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="LayoutRoot"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Background&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Transparent"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="CommonStates"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Normal"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Busied"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="VisualElement"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="(UIElement.RenderTransform).Angle"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RepeatBehavior&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Forever"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;SplineDoubleKeyFrame&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;KeyTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0:0:1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="360"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DoubleAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Width&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="25"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Height&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="25"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;StrokeThickness&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="5.5"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="VisualElement"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse.Stroke&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;LinearGradientBrush&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;EndPoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.5,1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;StartPoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.5,0"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF096475"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.571"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FFA8FCFC"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse.Stroke&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse.RenderTransform&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;RotateTransform&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;CenterX&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="12.5"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;CenterY&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="12.5"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse.RenderTransform&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Ellipse&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;
    
&lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;You can change the colors, the animation, the shape, everything!&lt;/p&gt;

&lt;p&gt;Have fun!&lt;/p&gt;

&lt;iframe src="http://cid-0c27f716ffc1ae40.skydrive.live.com/embedicon.aspx/.Public/BusyPointer.zip" title="Preview" marginheight="0" marginwidth="0" style="padding: 0pt; width: 98px; height: 115px; background-color: rgb(252, 252, 252);" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7307107" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>[Silverlight] How to handle the contextual menu</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2009/08/20/silverlight-how-to-handle-the-contextual-menu.aspx" /><id>http://weblogs.asp.net/broux/archive/2009/08/20/silverlight-how-to-handle-the-contextual-menu.aspx</id><published>2009-08-20T22:12:00Z</published><updated>2009-08-20T22:12:00Z</updated><content type="html">&lt;p&gt;&lt;a href="file:///C:/Users/Benjamin/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles5E7EB37/silverlight7.png" mce_href="file:///C:/Users/Benjamin/AppData/Local/Temp/WindowsLiveWriter1286139640/supfiles5E7EB37/silverlight7.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/silverlight_thumb5_4CA8C6C9.png" style="border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;" title="silverlight_thumb5" alt="silverlight_thumb5" mce_src="http://weblogs.asp.net/blogs/broux/silverlight_thumb5_4CA8C6C9.png" align="right" border="0" height="124" width="92"&gt;&lt;/a&gt; Hello again,&lt;/p&gt;  &lt;p&gt;There is a question that I often see on Silverlight’s forum. It’s about the contextual menu (right click). The current answer is that it’s not possible to surcharge them like we can do in Flash. Maybe in the next version of Silverlight…&lt;/p&gt;  &lt;p&gt;However I’m gonna show you a solution I created for bypass the classic right click. Unfortunatly my method works well on Internet Explorer and quite bad on Firefox where the classic menu displays and then the custom menu. If someone knows a workaround for Firefox he can post a comment.&lt;/p&gt;  &lt;p&gt;For an easy use I created a RightClickService class, which allow us to create contextual menus for a lot of controls.&lt;/p&gt;  &lt;p&gt;First, the code for &lt;i&gt;ContextMenuItem&lt;/i&gt; and &lt;i&gt;ContextMenu&lt;/i&gt;.&lt;/p&gt;  &lt;div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;"&gt;   &lt;div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;     &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;[TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Normal"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"CommonStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Focused"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"FocusStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"MouseOver"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"CommonStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Disabled"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"CommonStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Unselected"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"SelectionStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Selected"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"SelectionStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"SelectedUnfocused"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"SelectionStates"&lt;/span&gt;),&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;TemplateVisualState(Name = &lt;span style="color: rgb(0, 96, 128);"&gt;"Unfocused"&lt;/span&gt;, GroupName = &lt;span style="color: rgb(0, 96, 128);"&gt;"FocusStates"&lt;/span&gt;)]&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; ContextMenuItem : ContentControl&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;event&lt;/span&gt; MouseButtonEventHandler Click;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; ContextMenuItem()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.DefaultStyleKey = &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(ContextMenuItem);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;.MouseLeftButtonDown += &lt;span style="color: rgb(0, 0, 255);"&gt;delegate&lt;/span&gt;(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, MouseButtonEventArgs e)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Click != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;) Click(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, e);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        };&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnApplyTemplate()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.OnApplyTemplate();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        VisualStateManager.GoToState(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"Normal"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnMouseLeftButtonUp(MouseButtonEventArgs e)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (!e.Handled)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.OnMouseLeftButtonUp(e);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            e.Handled = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (RightClickService.Popup != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;) RightClickService.Popup.IsOpen = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnMouseEnter(MouseEventArgs e)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.OnMouseEnter(e);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        VisualStateManager.GoToState(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"MouseOver"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnMouseLeave(MouseEventArgs e)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.OnMouseLeave(e);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        VisualStateManager.GoToState(&lt;span style="color: rgb(0, 0, 255);"&gt;this&lt;/span&gt;, &lt;span style="color: rgb(0, 96, 128);"&gt;"Normal"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;It’s just a simple control who looks like a &lt;i&gt;ListBoxItem&lt;/i&gt;. I also created a &lt;i&gt;Click&lt;/i&gt; event which is fired when a &lt;i&gt;MouseLeftButtonDown&lt;/i&gt; occurs.&lt;/p&gt;

&lt;p&gt;The theme’s control:&lt;/p&gt;

&lt;div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;"&gt;
  &lt;div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;
    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ResourceDictionary&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;  &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;  &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;  &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:local&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="clr-namespace:ContextMenu"&lt;/span&gt;    &lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;  &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:vsm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="clr-namespace:System.Windows;assembly=System.Windows"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:ContextMenu"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Padding"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Background"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FFFFFFFF"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Foreground"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF000000"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="HorizontalContentAlignment"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Left"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="VerticalContentAlignment"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Top"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="IsTabStop"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="False"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="BorderThickness"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="TabNavigation"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Once"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="BorderBrush"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;LinearGradientBrush&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;EndPoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.5,1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;StartPoint&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.5,0"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FFA3AEB9"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF8399A9"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.375"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF718597"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0.375"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;GradientStop&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Color&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF617584"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Offset&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;LinearGradientBrush&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Template"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:ContextMenu"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Border&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;CornerRadius&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="2"&lt;/span&gt; &lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(255, 0, 0);"&gt;BorderBrush&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding BorderBrush}"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(255, 0, 0);"&gt;BorderThickness&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding BorderThickness}"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ItemsPresenter&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Border&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:ContextMenuItem"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Padding"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="3"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="HorizontalContentAlignment"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Left"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="VerticalContentAlignment"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Top"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Background"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Transparent"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="BorderThickness"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Property&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Template"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;TargetType&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="local:ContextMenuItem"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Background&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding Background}"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="CommonStates"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Normal"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="MouseOver"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DoubleAnimation&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="fillColor"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Opacity"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Duration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;To&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=".35"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Disabled"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DoubleAnimation&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="contentPresenter"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Opacity"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Duration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;To&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=".55"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="SelectionStates"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Unselected"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Selected"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DoubleAnimation&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="fillColor2"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Opacity"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Duration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;To&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;=".75"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="FocusStates"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Focused"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetName&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="FocusVisualElement"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Storyboard&lt;/span&gt;.&lt;span style="color: rgb(255, 0, 0);"&gt;TargetProperty&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Visibility"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Duration&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DiscreteObjectKeyFrame&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;KeyTime&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DiscreteObjectKeyFrame.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Visibility&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;Visible&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Visibility&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DiscreteObjectKeyFrame.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;DiscreteObjectKeyFrame&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ObjectAnimationUsingKeyFrames&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Storyboard&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualState&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Unfocused"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateGroup&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;vsm:VisualStateManager.VisualStateGroups&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Rectangle&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Fill&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="LightGray"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;IsHitTestVisible&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="False"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusX&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusY&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Rectangle&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="fillColor"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Opacity&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Fill&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FFBADDE9"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;IsHitTestVisible&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="False"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusX&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusY&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Rectangle&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="fillColor2"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Opacity&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Fill&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FFBADDE9"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;IsHitTestVisible&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="False"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusX&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusY&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ContentPresenter&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="contentPresenter"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(255, 0, 0);"&gt;Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding Content}"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(255, 0, 0);"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding ContentTemplate}"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(255, 0, 0);"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Left"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(255, 0, 0);"&gt;Margin&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{TemplateBinding Padding}"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Rectangle&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="FocusVisualElement"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Stroke&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#FF6DBDD1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;StrokeThickness&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Visibility&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Collapsed"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusX&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;RadiusY&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ControlTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter.Value&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Setter&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Style&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;ResourceDictionary&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;The &lt;i&gt;ContextMenu&lt;/i&gt; :&lt;/p&gt;

&lt;div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;"&gt;
  &lt;div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;
    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; ContextMenu : ItemsControl&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; ContextMenu()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.DefaultStyleKey = &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(ContextMenu);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnApplyTemplate()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;base&lt;/span&gt;.OnApplyTemplate();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; DependencyObject GetContainerForItemOverride()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; ContextMenuItem();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;bool&lt;/span&gt; IsItemItsOwnContainerOverride(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; item)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; (item &lt;span style="color: rgb(0, 0, 255);"&gt;is&lt;/span&gt; ContextMenuItem);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;This control inherits from &lt;i&gt;ItemsControl&lt;/i&gt;, and overrides the &lt;i&gt;GetContainerForItemOverride&lt;/i&gt; and &lt;i&gt;IsItemItsOwnContainerOverride&lt;/i&gt; methods for define the control to use for the display if we don’t use a &lt;i&gt;ContextMenuItem&lt;/i&gt;.&lt;/p&gt;

&lt;p&gt;And now the big part: &lt;i&gt;RightClickService&lt;/i&gt;.&lt;/p&gt;

&lt;div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;"&gt;
  &lt;div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;
    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;class&lt;/span&gt; RightClickService&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;{&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; FrameworkElement mRootVisual = &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;internal&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; FrameworkElement RootVisual&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        get&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            SetRootVisual();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; mRootVisual;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; SetRootVisual()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (mRootVisual == &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt; &amp;amp;&amp;amp; Application.Current != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            mRootVisual = Application.Current.RootVisual &lt;span style="color: rgb(0, 0, 255);"&gt;as&lt;/span&gt; FrameworkElement;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(204, 102, 51);"&gt;#region&lt;/span&gt; Attached Property&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;readonly&lt;/span&gt; DependencyProperty ContextMenuProperty =&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        DependencyProperty.RegisterAttached(&lt;span style="color: rgb(0, 96, 128);"&gt;"ContextMenu"&lt;/span&gt;, &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(ContextMenu), &lt;span style="color: rgb(0, 0, 255);"&gt;typeof&lt;/span&gt;(RightClickService), &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; SetContextMenu(UIElement element, ContextMenu &lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        element.SetValue(ContextMenuProperty, &lt;span style="color: rgb(0, 0, 255);"&gt;value&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; ContextMenu GetContextMenu(UIElement element)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; (ContextMenu)element.GetValue(ContextMenuProperty);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(204, 102, 51);"&gt;#endregion&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; RightClickService()&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Application.Current.Host.Settings.Windowless == &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;) &lt;span style="color: rgb(0, 0, 255);"&gt;throw&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Exception(&lt;span style="color: rgb(0, 96, 128);"&gt;"Your SL plugin must be initialize with Windowless to true"&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (HtmlPage.IsEnabled) HtmlPage.Document.AttachEvent(&lt;span style="color: rgb(0, 96, 128);"&gt;"oncontextmenu"&lt;/span&gt;, RightClickService.OnContextMenu);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; OnContextMenu(&lt;span style="color: rgb(0, 0, 255);"&gt;object&lt;/span&gt; sender, HtmlEventArgs e)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        IEnumerable&amp;lt;UIElement&amp;gt; elements = GetControls(e.OffsetX, e.OffsetY);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (elements != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;foreach&lt;/span&gt; (UIElement element &lt;span style="color: rgb(0, 0, 255);"&gt;in&lt;/span&gt; elements)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                ContextMenu menu = RightClickService.GetContextMenu(element);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (menu != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    PerformPlacement(menu, e.OffsetX, e.OffsetY);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;break&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        e.PreventDefault();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;internal&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; Popup Popup { get; set; }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;void&lt;/span&gt; PerformPlacement(FrameworkElement content, &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; x, &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; y)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Canvas elementOutside = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Canvas();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Canvas childCanvas = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Canvas();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        elementOutside.Background = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; SolidColorBrush(Colors.Transparent);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Popup != &lt;span style="color: rgb(0, 0, 255);"&gt;null&lt;/span&gt;)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            Popup.IsOpen = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;if&lt;/span&gt; (Popup.Child &lt;span style="color: rgb(0, 0, 255);"&gt;is&lt;/span&gt; Canvas) ((Canvas)Popup.Child).Children.Clear();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Popup = &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Popup();&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Popup.Child = childCanvas;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        elementOutside.MouseLeftButtonDown += &lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; MouseButtonEventHandler((o, e) =&amp;gt; Popup.IsOpen = &lt;span style="color: rgb(0, 0, 255);"&gt;false&lt;/span&gt;);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        elementOutside.Width = Application.Current.Host.Content.ActualWidth;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        elementOutside.Height = Application.Current.Host.Content.ActualHeight;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        childCanvas.Children.Add(elementOutside);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        childCanvas.Children.Add(content);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Canvas.SetLeft(content, x);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Canvas.SetTop(content, y);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        Popup.IsOpen = &lt;span style="color: rgb(0, 0, 255);"&gt;true&lt;/span&gt;;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&amp;nbsp;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;static&lt;/span&gt; IEnumerable&amp;lt;UIElement&amp;gt; GetControls(&lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; x, &lt;span style="color: rgb(0, 0, 255);"&gt;int&lt;/span&gt; y)&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    {&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;return&lt;/span&gt; VisualTreeHelper.FindElementsInHostCoordinates(&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt; Point(x, y), RootVisual);&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    }&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;}&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;I just use the &lt;i&gt;oncontextmenu&lt;/i&gt; Javascript event.&lt;/p&gt;

&lt;p&gt;For specify the contextual menu for a control I use an attached property. When the right click is detected I get the control by using the coordinate of the mouse and the &lt;i&gt;VisualTreeHelper&lt;/i&gt; class, then the menu associated to the control. Then I display the menu in a Popup.&lt;/p&gt;

&lt;p&gt;Trick: I use an invisible Canvas which fill the entire application. It allows to close the menu when the user clicks outside it.&lt;/p&gt;

&lt;p&gt;It’s over for the control, now let’s see how to use it.&lt;/p&gt;

&lt;p&gt;First there is one requirement: your Silverlight plugin must be initialize with the Windowless property to true.&lt;/p&gt;

&lt;div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: rgb(244, 244, 244); width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;"&gt;
  &lt;div style="border-style: none; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;
    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;UserControl&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Class&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="TestSilverlight.Page"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:x&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(255, 0, 0);"&gt;xmlns:cm&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="clr-namespace:ContextMenu;assembly=ContextMenu"&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(255, 0, 0);"&gt;Width&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="400"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Height&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="300"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;x:Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="LayoutRoot"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Background&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="White"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Image&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Source&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="silverlight.png"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:RightClickService.ContextMenu&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:ContextMenu&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:ContextMenuItem&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Save As"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Click&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="SaveImage"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:ContextMenuItem&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Content&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="View Image"&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;Click&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="ViewImage"&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;                &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:ContextMenu&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;            &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;cm:RightClickService.ContextMenu&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Image&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: white; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;    &lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

    &lt;pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: rgb(244, 244, 244); width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;UserControl&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;You see? It’s simple.&lt;/p&gt;

&lt;p&gt;And the result:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/broux/screen_0A55AE86.png" mce_href="http://weblogs.asp.net/blogs/broux/screen_0A55AE86.png"&gt;&lt;img src="http://weblogs.asp.net/blogs/broux/screen_thumb_16833A7B.png" style="border-width: 0px; display: inline;" title="screen" alt="screen" mce_src="http://weblogs.asp.net/blogs/broux/screen_thumb_16833A7B.png" border="0" height="500" width="446"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;iframe src="http://cid-0c27f716ffc1ae40.skydrive.live.com/embedrowdetail.aspx/.Public/ContextMenu.zip" style="border: 1px solid rgb(221, 229, 233); margin: 3px; padding: 0px; background-color: rgb(255, 255, 255); width: 240px; height: 66px;" marginheight="0" mce_src="http://cid-0c27f716ffc1ae40.skydrive.live.com/embedrowdetail.aspx/.Public/ContextMenu.zip" marginwidth="0" frameborder="0" scrolling="no"&gt;&lt;/iframe&gt;&lt;/p&gt;

&lt;p&gt;Have fun :)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7175246" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Microsoft" scheme="http://weblogs.asp.net/broux/archive/tags/Microsoft/default.aspx" /><category term="Silverlight" scheme="http://weblogs.asp.net/broux/archive/tags/Silverlight/default.aspx" /><category term=".NET" scheme="http://weblogs.asp.net/broux/archive/tags/.NET/default.aspx" /></entry><entry><title>A new one</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/broux/archive/2009/08/20/a-new-one.aspx" /><id>http://weblogs.asp.net/broux/archive/2009/08/20/a-new-one.aspx</id><published>2009-08-20T15:23:16Z</published><updated>2009-08-20T15:23:16Z</updated><content type="html">&lt;p&gt;Hello everybody and welcome to my English weblog.&lt;/p&gt;  &lt;p&gt;Just a few words about me.&lt;/p&gt;  &lt;p&gt;My name is Benjamin Roux and I just finished my studies in a French private school where I was also .NET trainer. The last 2 years I gave courses in France, USA and China and that’s the reason why I lived&amp;#160; in San Francisco (which is the most cool, beautiful, awesome city I’ve ever seen…) from October to July.&lt;/p&gt;  &lt;p&gt;Microsoft awarded me with the title of Client Application Development MVP for my contributions in the French community. By the way, for the French readers you can find my weblog here &lt;a title="http://blogs.developpeur.org/broux/" href="http://blogs.developpeur.org/broux/"&gt;http://blogs.developpeur.org/broux/&lt;/a&gt; and my articles here &lt;a title="http://broux.developpez.com/" href="http://broux.developpez.com/"&gt;http://broux.developpez.com/&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I opened this blog to share my experience and my researches about the .NET technologies and specially &lt;strong&gt;Silverlight&lt;/strong&gt; which is my favourite. I hope my posts will be helpful!&lt;/p&gt;  &lt;p&gt;As you could guess, English is not my mother tongue so in advance, all my apologies for my mistakes.&lt;/p&gt;  &lt;p&gt;See you in my next post.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=7175194" width="1" height="1"&gt;</content><author><name>Benjamin Roux</name><uri>http://weblogs.asp.net/members/Benjamin-Roux.aspx</uri></author><category term="Personal" scheme="http://weblogs.asp.net/broux/archive/tags/Personal/default.aspx" /></entry></feed>
