<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Delay's Blog</title><subtitle type="html" /><id>http://blogs.msdn.com/delay/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/delay/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-04-15T12:21:00Z</updated><entry><title>Silverlight Charting gets an update - and a TreeMap! [Silverlight Toolkit July 2009 release now available!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/07/10/silverlight-charting-gets-an-update-and-a-treemap-silverlight-toolkit-july-2009-release-now-available.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/07/10/silverlight-charting-gets-an-update-and-a-treemap-silverlight-toolkit-july-2009-release-now-available.aspx</id><published>2009-07-10T18:03:00Z</published><updated>2009-07-10T18:03:00Z</updated><content type="html">&lt;div class="delay"&gt;
&lt;p&gt;
We've just published the &lt;a href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24246" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=24246"&gt;July 2009 release&lt;/a&gt; of the &lt;a href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/a&gt; to help celebrate today's release of &lt;a href="http://silverlight.net/" mce_href="http://silverlight.net/"&gt;Silverlight 3&lt;/a&gt;!
Silverlight 3 includes a wide variety of new features that significantly enhance the platform and make developing powerful applications easier than ever!
The Silverlight Toolkit helps extends the Silverlight platform by offering a compelling set of additional controls to enable even more advanced scenarios.
I encourage everyone to have a look at the live samples for &lt;a href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html"&gt;Silverlight 2&lt;/a&gt; or &lt;a href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html"&gt;Silverlight 3&lt;/a&gt;, download the Toolkit installer, and enjoy!
&lt;/p&gt;
&lt;blockquote&gt;
Note: The Silverlight Toolkit includes support for both Silverlight 2 &lt;strong&gt;and&lt;/strong&gt; Silverlight 3, so please have a look even if you're not upgrading to 3 today. &lt;nobr&gt;:)&lt;/nobr&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
That said, you're probably here because what you really care about is &lt;a href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Silverlight/WPF Charting&lt;/a&gt;!
You may remember my last post &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx"&gt;announcing the June 2009 release of the WPF Toolkit with the first official release of WPF Charting&lt;/a&gt;.
I'm pleased to announce that this release of Silverlight Charting is &lt;em&gt;almost&lt;/em&gt; exactly in sync with its WPF Charting sibling!
There were just &lt;strong&gt;two&lt;/strong&gt; notable change that happened too late to be included with WPF Charting - they're in &lt;em&gt;italics&lt;/em&gt; below (along with a third, very minor tweak):
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Notable Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;
&lt;strong&gt;Included new TreeMap control!&lt;/strong&gt;
Please refer to the second half of this post for lots more about what a TreeMap is, what it's good for, and how to use it!
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Improved performance of internal data structures for many common scenarios.&lt;/strong&gt;
Charting now makes use of &lt;a href="http://en.wikipedia.org/wiki/Red_black_tree" mce_href="http://en.wikipedia.org/wiki/Red_black_tree"&gt;left-leaning red-black trees&lt;/a&gt; to maintain properly balanced data structures.
For more detail on this change, please refer to my &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx"&gt;post about the LeftLeaningRedBlackTree implementation&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Numerous bug fixes for animation inconsistencies between Silverlight and WPF.&lt;/strong&gt;
&lt;a href="http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx"&gt;Storyboards and Animations sometimes behave a little differently on Silverlight/WPF&lt;/a&gt;, and a good bit of effort was spent trying to ensure that Charting will behave the same way on both platforms.
In most cases, this was a matter of finding an implementation both platforms agreed on - in some it meant resorting to small, localized &lt;code&gt;#if&lt;/code&gt; blocks.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Fixed handling of data objects with non-unique hash codes.&lt;/strong&gt;
When each data object had a unique hash code, things already worked fine.
But data sets containing items sharing the same hash code could exhibit incorrect behavior in previous releases.
Most typical data sets would &lt;strong&gt;not&lt;/strong&gt; have encountered this problem because hash codes are nearly always unique - but there are certain classes that report quite &lt;strong&gt;UN&lt;/strong&gt;unique hash codes and could trigger the problem fairly easily.
This is no longer an issue.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Corrected behavior of charts at very small sizes and during animations.&lt;/strong&gt;
Some third party controls offer so-called "fluid" layout in which size changes are all animated and elements can easily shrink to a size of 0x0.
This kind of environment could previously trigger layout bugs that would result in an unhandled exception from the &lt;code&gt;Chart&lt;/code&gt; control.
These issues have been fixed and dynamic layout changes are now handled seamlessly.
&lt;/p&gt;
&lt;p&gt;&lt;em&gt;
&lt;strong&gt;Improved the performance of BubbleSeries.&lt;/strong&gt;
Scenarios with many bubbles animating simultaneously could have previously exhibited some sluggishness.
In this release for Silverlight we've implemented an optimization that saves a significant amount of time in such cases.
Animations of &lt;code&gt;BubbleSeries&lt;/code&gt; data changes are now considerably smoother.
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Breaking Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IRequireGlobalSeriesIndex's GlobalSeriesIndexChanged method takes a nullable int parameter.&lt;/strong&gt;
This should affect only people who have written custom Series implementations - and the code change is a trivial.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Other Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Many other fixes and improvements.&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Better handling of non-&lt;code&gt;double&lt;/code&gt; data by shared &lt;code&gt;Series&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Addition of &lt;code&gt;StrokeMiterLimit&lt;/code&gt; to the &lt;code&gt;Polyline&lt;/code&gt; used by &lt;code&gt;LineSeries&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Fixes for edge case scenarios when removing a &lt;code&gt;Series&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Ability to set &lt;code&gt;Series.Title&lt;/code&gt; with a &lt;code&gt;Binding&lt;/code&gt; (on Silverlight 3 and WPF)
&lt;/li&gt;
&lt;li&gt;
Automatic inheritance of the &lt;code&gt;Foreground&lt;/code&gt; property by the &lt;code&gt;Title&lt;/code&gt; control
&lt;/li&gt;
&lt;li&gt;
Visual improvements to the &lt;code&gt;LegendItem&lt;/code&gt; &lt;code&gt;DataPoint&lt;/code&gt; marker
&lt;/li&gt;
&lt;li&gt;&lt;em&gt;
Improvement to &lt;code&gt;AreaSeries&lt;/code&gt; default &lt;code&gt;Style&lt;/code&gt; &lt;code&gt;StrokeThickness&lt;/code&gt; behavior
&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
In my &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx"&gt;earlier post about WPF Charting&lt;/a&gt;, I announced a new DataVisualizationDemos sample that consolidates all the Charting samples I've posted to my blog into one handy place and compiles/runs on both Silverlight and WPF.
I've just updated DataVisualizationDemos for &lt;strong&gt;this&lt;/strong&gt; release so it includes everything through the "Letter Frequency" sample I introduced last time, the original easing functions sample from the &lt;a href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx"&gt;March 2009 release notes&lt;/a&gt;, my recent &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/15/peanut-butter-jelly-time-how-to-create-a-pleasing-visual-effect-with-silverlight-wpf-charting.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/15/peanut-butter-jelly-time-how-to-create-a-pleasing-visual-effect-with-silverlight-wpf-charting.aspx"&gt;"Jelly Charting" demonstration&lt;/a&gt;, &lt;strong&gt;and&lt;/strong&gt; a completely new sample:
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Demo.png" mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Demo.png" alt="TreeMap Introduction" width="394" height="382"&gt;
&lt;p&gt;&lt;strong&gt;
&lt;a href="http://cesso.org/Samples/DataVisualizationDemos/DataVisualizationDemos.zip" mce_href="http://cesso.org/Samples/DataVisualizationDemos/DataVisualizationDemos.zip"&gt;Click here to download the complete source code for the DataVisualizationDemos sample application.&lt;/a&gt;
&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
The new sample shows off the &lt;a href="http://en.wikipedia.org/wiki/Treemap" mce_href="http://en.wikipedia.org/wiki/Treemap"&gt;TreeMap&lt;/a&gt; control that's now part of the &lt;code&gt;System.Windows.Controls.DataVisualization&lt;/code&gt; namespace.
The &lt;a href="http://en.wikipedia.org/wiki/Treemap" mce_href="http://en.wikipedia.org/wiki/Treemap"&gt;Wikipedia entry&lt;/a&gt; explains TreeMaps in detail; the executive summary is that TreeMaps are used to visualize the values of a single property (ex: team scores) across an entire data set.
They do this by adjusting the size (i.e., area) of each element so items with larger values are bigger, items with smaller values are littler, and the relative proportions are correct.
There are some different algorithms to do this layout; our TreeMap implements the common "squarified" algorithm.
&lt;/p&gt;
&lt;p&gt;
But enough background - let's use a TreeMap to visualize some data!
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
To begin, imagine that we have a data set listing all the blog posts I've made and the following details for each: post date, length, tags, and relative popularity.
&lt;em&gt;(Aside: The popularity measure is not accurate because it's based on an incomplete set of statistics - but it's sufficient for our purposes.)&lt;/em&gt;
Let's begin by displaying all the posts ranked by popularity - that looks like this:
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Simple.png" mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Simple.png" alt="Simple TreeMap" width="441" height="342"&gt;
&lt;p&gt;
The XAML is a tad verbose, but it's quite easy to understand:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; x&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Name&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="AllPosts"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;   &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; ItemsSource&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap.ItemDefinition&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMapItemDefinition
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;           &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; ValueBinding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Popularity&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Border
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; BorderBrush&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Black"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; BorderThickness&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="1"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       &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;="#ff7fc3ff"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;                       &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Margin&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="0 0 1 1"&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&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;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StaticResource&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; GradientOverlay&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;controls&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Viewbox&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Margin&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="3 0 3 0"&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; FormattedDate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"/&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;controls&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Viewbox&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ToolTipService.ToolTip&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Title&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"/&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; FormattedTags&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; FontStyle&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="Italic"/&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TextBlock&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Text&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; FormattedDate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"/&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;StackPanel&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;ToolTipService.ToolTip&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Border&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;                &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Grid&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;            &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;        &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMapItemDefinition&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap.ItemDefinition&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
We start out by creating a &lt;code&gt;TreeMap&lt;/code&gt; and pointing it at our data set using the standard &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol(VS.95).aspx"&gt;ItemsControl&lt;/a&gt; pattern of setting the &lt;code&gt;ItemsSource&lt;/code&gt; property.
Then we specify a &lt;code&gt;TreeMapItemDefinition&lt;/code&gt; to describe what the items should look like and provide a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding(VS.95).aspx"&gt;Binding&lt;/a&gt; to identify the value we're visualizing.
&lt;/p&gt;
&lt;p&gt;
At this point, you may be wondering whether there's a corresponding &lt;code&gt;TreeMapItem&lt;/code&gt; control for each element (think &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listboxitem%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.listboxitem(VS.95).aspx"&gt;ListBoxItem&lt;/a&gt;).
Well, there is &lt;strong&gt;not&lt;/strong&gt;.
The reason being that TreeMaps are often used to display very large data sets with hundreds of elements - and it turns out that the overhead of having a wrapper control for each of those elements adds up quickly.
So &lt;code&gt;TreeMap&lt;/code&gt; takes the slightly different approach of allowing you to define a &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.datatemplate(VS.95).aspx"&gt;DataTemplate&lt;/a&gt; for its item (as with &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemtemplate%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.itemtemplate(VS.95).aspx"&gt;ItemsControl.ItemTemplate&lt;/a&gt;).
This &lt;code&gt;DataTemplate&lt;/code&gt; can be as simple or as complex as you'd like - and can even use a custom &lt;code&gt;TreeMapItem&lt;/code&gt;-like control - so there's no loss of flexibility.
However, there's a &lt;strong&gt;big&lt;/strong&gt; win in performance: this approach is roughly &lt;strong&gt;four&lt;/strong&gt; times faster!
&lt;/p&gt;
&lt;p&gt;
The contents of the &lt;code&gt;DataTemplate&lt;/code&gt; used here are pretty typical: a border around some text that's bound to the underlying data object and a helpful ToolTip to display more detail when the user mouses over the element.
It's as easy as that!
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
Okay, let's get a little more advanced and display &lt;strong&gt;two&lt;/strong&gt; values at the same time!
The conventional way of showing a second value in a TreeMap is by varying the color of the items, so we'll do that.
Size corresponds to popularity as before, but now we're using color saturation to visualize post length (where darker=longer):
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Interpolator.png" mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Interpolator.png" alt="TreeMap with Interpolator" width="441" height="341"&gt;
&lt;p&gt;
The basic &lt;code&gt;TreeMap&lt;/code&gt; definition is basically the same as last time - the interesting part is the contents of the &lt;code&gt;Interpolators&lt;/code&gt; collection:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;...
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap.Interpolators&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;    &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;SolidColorBrushInterpolator
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       &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;="Border"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       &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;="Background"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; DataRangeBinding&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="{&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;Binding&lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; Length&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;}"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       &lt;/span&gt;&lt;span style="color: rgb(255, 0, 0);"&gt; From&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;="#ffeeeeff"
&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;       &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;="#ff8080ff"/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;datavis&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;TreeMap.Interpolators&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color: rgb(163, 21, 21);"&gt;...
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
What's an &lt;code&gt;Interpolator&lt;/code&gt;?
It's a new concept we've introduced for &lt;code&gt;TreeMap&lt;/code&gt; to automatically map a particular value ("Length" in this case) to a range of &lt;em&gt;something&lt;/em&gt;.
In this case, the &lt;em&gt;something&lt;/em&gt; is colors, so we're using &lt;code&gt;SolidColorBrushInterpolator&lt;/code&gt; which works great for backgrounds and foregrounds.
There's also &lt;code&gt;DoubleInterpolator&lt;/code&gt; which is handy for changing opacity, font size, and things like that.
And if you want to do something different, it's simple to create your own mapping by deriving from &lt;code&gt;Interpolator&lt;/code&gt; (or &lt;code&gt;RangeInterpolator&amp;lt;T&amp;gt;&lt;/code&gt;)!
&lt;/p&gt;
&lt;p&gt;
We've purposely made &lt;code&gt;SolidColorBrushInterpolator&lt;/code&gt; easy to use - note how it cleanly incorporates the familiar notions of &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard(VS.95).aspx"&gt;Storyboard&lt;/a&gt;'s &lt;code&gt;TargetName&lt;/code&gt; and &lt;code&gt;TargetProperty&lt;/code&gt; properties with &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.coloranimation%28VS.95%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.coloranimation(VS.95).aspx"&gt;ColorAnimation&lt;/a&gt;'s &lt;code&gt;From&lt;/code&gt; and &lt;code&gt;To&lt;/code&gt;.
The remaining property, &lt;code&gt;DataRangeBinding&lt;/code&gt;, provides a &lt;code&gt;Binding&lt;/code&gt; that's used to identify the relevant variable on the data objects.
Once everything's in place, the &lt;code&gt;Interpolator&lt;/code&gt; automatically &lt;strong&gt;interpolates&lt;/strong&gt; each value according to where it falls in the overall range of values!
&lt;/p&gt;
&lt;p&gt;
It's a simple, yet powerful concept that makes it easy to build powerful visualizations without writing any code at all.
And please note that the &lt;code&gt;TreeMap.Interpolators&lt;/code&gt; property is a &lt;strong&gt;collection&lt;/strong&gt;, so you can add as many of these as you'd like in order to visualize multiple values or control multiple properties!
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
This time, instead of visualizing posts, let's visualize tags.
Specifically, let's see how many posts have been tagged with each tag name (remembering that some posts have multiple tags):
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Linq.png" mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Linq.png" alt="TreeMap via Linq" width="442" height="342"&gt;
&lt;p&gt;
The aggregation of per-post data into per-tag data is made easy by a simple bit of Linq that first creates a unique tag/post object for each tag/post pairing, then groups these all by tag, and finally selects them into a new collection of objects:
&lt;/p&gt;
&lt;pre&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;var&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; blogPostsByTag = blogPosts
    .SelectMany(p =&amp;gt; p.Tags.Select(t =&amp;gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; { Tag = t, Post = p }))
    .GroupBy(p =&amp;gt; p.Tag)
    .Select(g =&amp;gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;new&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;BlogTag&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; { Tag = g.Key, Posts = g.Select(p =&amp;gt; p.Post).ToArray() });
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
After that, creating the &lt;code&gt;TreeMap&lt;/code&gt; is easy - it's just a minor variation of what we've already seen.
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
For our final trick, let's enhance the previous sample so we can see posts sorted by popularity &lt;strong&gt;within&lt;/strong&gt; each tag grouping:
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Nested.png" mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-Jul09-TreeMap-Nested.png" alt="Nested TreeMaps" width="442" height="342"&gt;
&lt;p&gt;
This is pretty easy to do as well - it's the previous &lt;code&gt;TreeMap&lt;/code&gt; with copies of the first &lt;code&gt;TreeMap&lt;/code&gt; &lt;em&gt;nested inside each tag node&lt;/em&gt;!
Nested TreeMaps?
Sure!
Like I said, the &lt;code&gt;DataTemplate&lt;/code&gt; model is totally flexible.
The outer &lt;code&gt;TreeMap&lt;/code&gt; creates the bounding boxes, and the inner &lt;code&gt;TreeMap&lt;/code&gt;s sub-divide them according to post popularity.
No sweat... &lt;nobr&gt;:)&lt;/nobr&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
As I hope you'll agree, the new &lt;code&gt;TreeMap&lt;/code&gt; is a pretty cool addition to the Data Visualization assembly!
And we wouldn't have it if not for the tireless efforts of the folks on the &lt;a href="http://blogs.msdn.com/gpde/" mce_href="http://blogs.msdn.com/gpde/"&gt;GPD-E (Global Product Development Europe) team&lt;/a&gt; who we partnered with to deliver this new control.
In particular, all the real work was done by &lt;strong&gt;Cristian Costache&lt;/strong&gt;, &lt;strong&gt;&lt;a href="http://blogs.msdn.com/marlat/" mce_href="http://blogs.msdn.com/marlat/"&gt;Marek Latuskiewicz&lt;/a&gt;&lt;/strong&gt;, and &lt;strong&gt;Gareth Bradshaw&lt;/strong&gt; - I mainly helped coordinate things and do a bit of testing.
I'd like to extend my sincere thanks to these guys for their passion and dedication these past few weeks!
Please check out their blogs for more information about &lt;code&gt;TreeMap&lt;/code&gt; in the coming weeks! &lt;nobr&gt;:)&lt;/nobr&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;PS&lt;/strong&gt; - If you have any questions or feedback, the right places to start are the &lt;a href="http://silverlight.net/forums/35.aspx" mce_href="http://silverlight.net/forums/35.aspx"&gt;Silverlight Discussion Forum&lt;/a&gt; or the &lt;a href="http://wpf.codeplex.com/Thread/List.aspx" mce_href="http://wpf.codeplex.com/Thread/List.aspx"&gt;WPF Discussion List&lt;/a&gt;.
Bugs and feature requests can be logged with the &lt;a href="http://silverlight.codeplex.com/WorkItem/List.aspx" mce_href="http://silverlight.codeplex.com/WorkItem/List.aspx"&gt;Silverlight Issue Tracker&lt;/a&gt; or the &lt;a href="http://wpf.codeplex.com/WorkItem/List.aspx" mce_href="http://wpf.codeplex.com/WorkItem/List.aspx"&gt;WPF Issue Tracker&lt;/a&gt;.
Please raise issues that are clearly unique to one platform or the other in the obvious place.
But for general questions and things that are common to both platforms, the Silverlight forum/list is probably a better place because there's more context and history there.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;PPS&lt;/strong&gt; - &lt;code&gt;TreeMap&lt;/code&gt; is currently available only as part of the Silverlight Toolkit.
However, it should run perfectly well on WPF; in fact, I did that as part of the testing process!
Interested parties can recompile the Silverlight source code for WPF in order to start playing with TreeMaps on WPF today; the process should be pretty easy because both the Silverlight and WPF Toolkits are open source and share the same source code files/layout/etc..
However, I'll be posting more about this in the next few days and hope to have explicit directions &lt;strong&gt;and&lt;/strong&gt; a script to make the entire process easy for everyone! &lt;nobr&gt;:)&lt;/nobr&gt;
&lt;/p&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9828930" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>WPF Charting: It's official! [June 2009 release of the WPF Toolkit is now available!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx</id><published>2009-06-25T18:52:00Z</published><updated>2009-06-25T18:52:00Z</updated><content type="html">&lt;div class="delay"&gt;
&lt;p&gt;
The WPF Toolkit team just published the &lt;a href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117" mce_href="http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117"&gt;June 2009 release of the WPF Toolkit&lt;/a&gt;.
Those of you who know I'm on the &lt;a href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/a&gt; team are probably wondering why this is relevant - so let's get right to the release notes for the next version of &lt;a href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Silverlight/WPF Charting&lt;/a&gt; because they'll clear things up:
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Notable Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;WPF is now an official platform for Charting!&lt;/strong&gt;
Today's release of the June 2009 WPF Toolkit includes the binaries for WPF Charting, the associated design-time assemblies for both Visual Studio 2008 and Blend 3, and the complete source code for everything (under the usual &lt;a href="http://www.microsoft.com/opensource/licenses.mspx#Ms-PL" mce_href="http://www.microsoft.com/opensource/licenses.mspx#Ms-PL"&gt;Ms-PL license&lt;/a&gt;).
Prior to today, WPF Charting only existed informally because of a &lt;a href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx"&gt;blog post I'd written&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx"&gt;some bits I'd shared&lt;/a&gt;.
As of today, that "do it yourself" approach is a thing of the past - customers can get signed binaries and ready-to-build source code for Charting as part of the WPF Toolkit.
And, as always, Charting exposes the &lt;strong&gt;same&lt;/strong&gt; API and supports the &lt;strong&gt;same&lt;/strong&gt; XAML on &lt;strong&gt;both&lt;/strong&gt; platforms - making application portability trivial!
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles/delay/WpfCharting-Jun09-Installer.png" mce_src="http://blogs.msdn.com/blogfiles/delay/WpfCharting-Jun09-Installer.png" alt="WPF Toolkit installer" width="499" height="385"&gt;
&lt;p&gt;
&lt;strong&gt;Improved performance of internal data structures for many common scenarios.&lt;/strong&gt;
Charting now makes use of &lt;a href="http://en.wikipedia.org/wiki/Red_black_tree" mce_href="http://en.wikipedia.org/wiki/Red_black_tree"&gt;left-leaning red-black trees&lt;/a&gt; to maintain properly balanced data structures.
For more detail on this change, please refer to my &lt;a href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx"&gt;post about the LeftLeaningRedBlackTree implementation&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Numerous bug fixes for animation inconsistencies between Silverlight and WPF.&lt;/strong&gt;
&lt;a href="http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx"&gt;Storyboards and Animations sometimes behave a little differently on Silverlight/WPF&lt;/a&gt;, and a good bit of effort was spent trying to ensure that Charting will behave the same way on both platforms.
In most cases, this was a matter of finding an implementation both platforms agreed on - in some it meant resorting to small, localized &lt;code&gt;#if&lt;/code&gt; blocks.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Fixed handling of data objects with non-unique hash codes.&lt;/strong&gt;
When each data object had a unique hash code, things already worked fine.
But data sets containing items sharing the same hash code could exhibit incorrect behavior in previous releases.
Most typical data sets would &lt;strong&gt;not&lt;/strong&gt; have encountered this problem because hash codes are nearly always unique - but there are certain classes that report quite &lt;strong&gt;UN&lt;/strong&gt;unique hash codes and could trigger the problem fairly easily.
This is no longer an issue.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Corrected behavior of charts at very small sizes and during animations.&lt;/strong&gt;
Some third party controls offer so-called "fluid" layout in which size changes are all animated and elements can easily shrink to a size of 0x0.
This kind of environment could previously trigger layout bugs that would result in an unhandled exception from the &lt;code&gt;Chart&lt;/code&gt; control.
These issues have been fixed and dynamic layout changes are now handled seamlessly.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Breaking Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;IRequireGlobalSeriesIndex's GlobalSeriesIndexChanged method takes a nullable int parameter.&lt;/strong&gt;
This should affect only people who have written custom Series implementations - and the code change is a trivial.
&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;Other Changes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Many other fixes and improvements.&lt;/strong&gt;
&lt;/p&gt;&lt;ul&gt;
&lt;li&gt;
Proper &lt;code&gt;RoutedEvent&lt;/code&gt; support for &lt;code&gt;DataPointSeries.SelectionChangedEvent&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Better handling of non-&lt;code&gt;double&lt;/code&gt; data by shared &lt;code&gt;Series&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Addition of &lt;code&gt;StrokeMiterLimit&lt;/code&gt; to the &lt;code&gt;Polyline&lt;/code&gt; used by &lt;code&gt;LineSeries&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Fixes for edge case scenarios when removing a &lt;code&gt;Series&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
Ability to set &lt;code&gt;Series.Title&lt;/code&gt; with a &lt;code&gt;Binding&lt;/code&gt; (on Silverlight 3 and WPF)
&lt;/li&gt;
&lt;li&gt;
Automatic inheritance of the &lt;code&gt;Foreground&lt;/code&gt; property by the &lt;code&gt;Title&lt;/code&gt; control
&lt;/li&gt;
&lt;li&gt;
Visual improvements to the &lt;code&gt;LegendItem&lt;/code&gt; &lt;code&gt;DataPoint&lt;/code&gt; marker
&lt;/li&gt;
&lt;li&gt;
Addition of &lt;code&gt;SnapsToDevicePixels&lt;/code&gt; to the default &lt;code&gt;Chart&lt;/code&gt; &lt;code&gt;Template&lt;/code&gt; (WPF-only; unnecessary on Silverlight)
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;u&gt;Build Notes&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
If you plan to recompile the WPF Toolkit from source, please be aware that two of the three Charting &lt;strong&gt;design-time&lt;/strong&gt; assemblies reference Blend 3 DLLs &lt;code&gt;Microsoft.Windows.Design.Extensibility.dll&lt;/code&gt; and &lt;code&gt;Microsoft.Windows.Design.Interaction.dll&lt;/code&gt;.
Unlike their Visual Studio counterparts, these design-time assemblies are &lt;strong&gt;not&lt;/strong&gt; automatically found by the build and their absence causes 84 build errors in the &lt;code&gt;Controls.DataVisualization.Toolkit.Design&lt;/code&gt; and &lt;code&gt;Controls.DataVisualization.Toolkit.Expression.Design&lt;/code&gt; projects. &lt;nobr&gt;:(&lt;/nobr&gt;
&lt;/p&gt;
&lt;p&gt;
Most people won't care about building the &lt;strong&gt;Blend-specific design-time&lt;/strong&gt; assemblies and can simply right-click the two failing projects in Visual Studio and choose "Unload Project".
After that, everything builds successfully.
&lt;/p&gt;
&lt;p&gt;
Alternatively, users with Blend installed can update these projects' references to both assemblies and then everything (including the Blend design-time assemblies!) builds successfully.
The default location of the Blend assemblies is something like &lt;code&gt;C:\Program Files (x86)\Microsoft Expression\Blend 3 Beta&lt;/code&gt;.
(If you're on a 32-bit OS, remove the "&lt;code&gt; x86&lt;/code&gt;"; once Blend releases, remove the "&lt;code&gt; Beta&lt;/code&gt;".
&lt;/p&gt;
&lt;p&gt;
Sorry for the inconvenience - we didn't want to ship pre-release Blend components with the WPF Toolkit.
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
Long-time readers know that I always include some new Charting samples with my release notes to showcase new features.
The big feature here is WPF Charting, so I've put together a solution that contains almost all of the public Charting samples I've ever posted to my blog - &lt;strong&gt;now in one handy place&lt;/strong&gt;!
Naturally, the DataVisualizationDemos sample runs on both Silverlight (2 or 3!) and WPF with the exact same code and XAML.
And it includes a brand new scenario called "Letter Frequency" that I wrote to help test some of the recent changes.
&lt;/p&gt;
&lt;p&gt;
Here it is on WPF:
&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/blogfiles//delay/WpfCharting-Jun09-LetterFrequency.png" mce_src="http://blogs.msdn.com/blogfiles//delay/WpfCharting-Jun09-LetterFrequency.png" alt="DataVisualizationDemos Letter Frequency sample" width="515" height="415"&gt;
&lt;p&gt;&lt;strong&gt;
&lt;a href="http://cesso.org/Samples/DataVisualizationDemos/DataVisualizationDemos.zip" mce_href="http://cesso.org/Samples/DataVisualizationDemos/DataVisualizationDemos.zip"&gt;Click here to download the complete source code for the DataVisualizationDemos sample application.&lt;/a&gt;
&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;
(Note: To find the blog post associated with each sample, please refer to the "My posts" section of my &lt;a href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Charting Links collection&lt;/a&gt;.)
&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
Jafar and I spent most of the previous release cycle helping other teams with their deliverables, so we didn't get as nearly much time to spend on Charting as we would have liked.
&lt;em&gt;[Otherwise the release notes would be much longer! &lt;nobr&gt;:)&lt;/nobr&gt; ]&lt;/em&gt;
Fortunately, we &lt;strong&gt;did&lt;/strong&gt; make the time to deliver some good fixes for this release and that should help make customers' lives a little easier.
Of course, while we've done our best to make Charting as useful and problem-free as possible, there's &lt;strong&gt;always&lt;/strong&gt; room for improvement...
&lt;/p&gt;
&lt;p&gt;
So if you have any questions or feedback, the right places to start are the &lt;a href="http://silverlight.net/forums/35.aspx" mce_href="http://silverlight.net/forums/35.aspx"&gt;Silverlight Discussion Forum&lt;/a&gt; or the &lt;a href="http://wpf.codeplex.com/Thread/List.aspx" mce_href="http://wpf.codeplex.com/Thread/List.aspx"&gt;WPF Discussion List&lt;/a&gt;.
Bugs and feature requests can be logged with the &lt;a href="http://silverlight.codeplex.com/WorkItem/List.aspx" mce_href="http://silverlight.codeplex.com/WorkItem/List.aspx"&gt;Silverlight Issue Tracker&lt;/a&gt; or the &lt;a href="http://wpf.codeplex.com/WorkItem/List.aspx" mce_href="http://wpf.codeplex.com/WorkItem/List.aspx"&gt;WPF Issue Tracker&lt;/a&gt;.
Please raise issues that are clearly unique to one platform or the other in the obvious place.
But for general questions and things that are common to both platforms, the Silverlight forum/list is probably a better place - just because there's more context and history there.
&lt;/p&gt;
&lt;p&gt;
A big "thank you" goes out to everyone who's worked with Charting and helped to make it what it is today!
Today's release and announcement are specifically directed at the WPF early-adopters who've &lt;strong&gt;truly&lt;/strong&gt; gone the extra mile to use Charting.
We thank you for your dedication!
Also, my personal thanks go out to the WPF Toolkit team for making this possible - in particular to &lt;strong&gt;Samantha Durante&lt;/strong&gt;, &lt;strong&gt;Vamsee Potharaju&lt;/strong&gt;, and &lt;strong&gt;Alexis Roosa&lt;/strong&gt; for their assistance and support!
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;
PS - If you're a loyal Silverlight Charting user who's feeling a little left out right about now, I have some good news for you, too. &lt;nobr&gt;:)&lt;/nobr&gt;
The Silverlight Toolkit will &lt;strong&gt;also&lt;/strong&gt; be releasing an update fairly soon.
And when it does, Silverlight Charting will contain &lt;strong&gt;all&lt;/strong&gt; the fixes described here, one or two others that came in too late to make this release, &lt;strong&gt;AND&lt;/strong&gt; a nice little surprise that will make the wait worthwhile...
&lt;/em&gt;&lt;/p&gt;
&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9804053" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>Peanut butter jelly time [How to: Create a pleasing visual effect with Silverlight/WPF Charting]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/06/15/peanut-butter-jelly-time-how-to-create-a-pleasing-visual-effect-with-silverlight-wpf-charting.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/06/15/peanut-butter-jelly-time-how-to-create-a-pleasing-visual-effect-with-silverlight-wpf-charting.aspx</id><published>2009-06-15T19:13:00Z</published><updated>2009-06-15T19:13:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;I was recently part of an e-mail thread with &lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/default.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/default.aspx"&gt;Pete Brown&lt;/A&gt; discussing the prospects of reproducing Richard Zadorozny's cool &lt;A href="http://joestegman.members.winisp.net/Jelly/" mce_href="http://joestegman.members.winisp.net/Jelly/"&gt;"jelly chart"&lt;/A&gt; behavior with the official &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Silverlight/WPF Charting&lt;/A&gt; controls from the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;. Richard's sample is really fun to play around with - but at the core it's really just a slick user experience demo masquerading as a charting solution. The question was: how hard it would be to take a real-world charting solution and get it to masquerade as a slick user experience demo... &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P&gt;I had some particular opinions on how to go about this, and said I'd put together a quick sample to show off my approach. I was aware of this sample when we started work on Silverlight/WPF Charting and made sure that Charting supported two specific things to make this kind of behavior easy: the &lt;CODE&gt;DataPointSeries.AnimationSequence&lt;/CODE&gt; property and the &lt;CODE&gt;Reveal&lt;/CODE&gt;/&lt;CODE&gt;Show&lt;/CODE&gt; &lt;A href="http://blogs.msdn.com/expression/archive/2008/07/11/more-articles-on-visual-state-manager.aspx" mce_href="http://blogs.msdn.com/expression/archive/2008/07/11/more-articles-on-visual-state-manager.aspx"&gt;VSM&lt;/A&gt; state. In fact, I wrote a similar sample that's been part of the &lt;A href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html"&gt;public charting samples&lt;/A&gt; since our first release. To find it, load the samples, pick the "Column Series" page from the left-hand column, then switch to the "Animation" tab at the top. The "Custom: Grow" samples show off the basic concept - all that's missing is the easing and that's easy (no pun intended) to add via Silverlight 3's &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.easingfunctionbase(VS.100).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.easingfunctionbase(VS.100).aspx"&gt;built-in support&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;However, as I thought about duplicating the jelly scenario for a few moments, I realized line series would be more challenging - because the line's shape tracks the actual data values and isn't covered by a VSM animation the way its points are. Fortunately, I had another trick up my sleeve - and thus the following Silverlight 3 sample was born: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;A href="http://cesso.org/Samples/JellyCharting/" mce_href="http://cesso.org/Samples/JellyCharting/"&gt;&lt;IMG alt="JellyCharting sample" src="http://blogs.msdn.com/blogfiles/delay/JellyCharting.png" width=549 height=564 mce_src="http://blogs.msdn.com/blogfiles/delay/JellyCharting.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/JellyCharting/" mce_href="http://cesso.org/Samples/JellyCharting/"&gt;Click here or on the image above to run the sample in your browser.&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/JellyCharting/JellyCharting.zip" mce_href="http://cesso.org/Samples/JellyCharting/JellyCharting.zip"&gt;Click here to download the complete source code for the sample.&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;While I didn't go out of my way to duplicate every aspect of the original demo, I &lt;STRONG&gt;did&lt;/STRONG&gt; try to pay homage to it. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/EM&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My solution is a straightforward &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter(VS.95).aspx"&gt;IValueConverter&lt;/A&gt; implementation (&lt;A href="http://blogs.msdn.com/delay/archive/2008/05/04/ivalueconverter-the-swiss-army-knife-of-bindings-propertyviewer-sample-is-a-wpf-silverlight-visualization-and-debugging-aid.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/05/04/ivalueconverter-the-swiss-army-knife-of-bindings-propertyviewer-sample-is-a-wpf-silverlight-visualization-and-debugging-aid.aspx"&gt;more background&lt;/A&gt;) that can be easily dropped into an existing chart to add the cool jelly behavior. For simplicity, my implementation assumes the original data is &lt;CODE&gt;Point&lt;/CODE&gt;s and uses fixed values for delays and stuff - but that's just to keep things easy to read and understand. It would be quite easy to modify or extend what I've done to flexibly support more general scenarios. &lt;/P&gt;
&lt;P&gt;Here's the relevant code: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// IValueConverter implementation that creates a "jelly" effect for showing chart data
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyConverter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IValueConverter
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Converts an ICollection of Points to an ICollection of animated JellyPoints
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Convert(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; value, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; targetType, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; parameter, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; culture)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Type-check input
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; originalPoints = value &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ICollection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == originalPoints)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NotImplementedException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"JellyConverter only supports value type ICollection&amp;lt;T&amp;gt;."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Fixed paramaters (could be set via properties or parameter)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; duration = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.FromSeconds(0.5);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; delay = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.FromSeconds(0.5);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ease = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ElasticEase&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { Oscillations = 1 };

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Prepare Storyboard
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; count = originalPoints.Count;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; jellyPoints = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;(count);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; storyboard = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; propertyPath = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Y"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; i = 0;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// For each Point...
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; originalItem &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; originalPoints)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Add a corresponding JellyPoint
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; jellyPoint = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { X = originalItem.X, Y = 0 };
            jellyPoints.Add(jellyPoint);

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Create an animation
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; animation = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DoubleAnimationUsingKeyFrames&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetTarget(animation, jellyPoint);
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetTargetProperty(animation, propertyPath);

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Configure the initial delay and "jelly" behavior
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; thisDelay = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.FromSeconds(delay.TotalSeconds * ((i + 1.0) / count));
            animation.KeyFrames.Add(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;LinearDoubleKeyFrame
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            {
                KeyTime = thisDelay,
                Value = 0
            });
            animation.KeyFrames.Add(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EasingDoubleKeyFrame
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            {
                KeyTime = thisDelay + duration,
                Value = originalItem.Y,
                EasingFunction = ease
            });

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Add animation to Storyboard
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            animation.Duration = thisDelay + duration;
            storyboard.Children.Add(animation);
            i++;
        }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Play the Storyboard
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        storyboard.Begin();

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; jellyPoints;
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Custom Point-like class allows easy animation of Y property
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;INotifyPropertyChanged
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Static X value
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; X { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Dynamic Y value
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;readonly&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; YProperty = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Register(
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Y"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;), &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;), &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyMetadata&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(YPropertyChanged));
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Y
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)GetValue(YProperty); }
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { SetValue(YProperty, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;); }
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; YPropertyChanged(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; o, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyPropertyChangedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; jellyPoint = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;JellyPoint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)o;
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; handler = jellyPoint.PropertyChanged;
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != handler)
            {
                handler.Invoke(jellyPoint, _yPropertyChangedEventArgs);
            }
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyChangedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _yPropertyChangedEventArgs =
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyChangedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Y"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// INotifyPropertyChanged event
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;event&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyChangedEventHandler&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; PropertyChanged;
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Unimplemented/unnecessary method
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ConvertBack(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; value, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; targetType, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; parameter, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; culture)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NotImplementedException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notes: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The &lt;CODE&gt;IValueConverter&lt;/CODE&gt; works by looking at the input &lt;CODE&gt;Point&lt;/CODE&gt; collection and replacing it with a corresponding collection of &lt;CODE&gt;JellyPoint&lt;/CODE&gt; objects. These &lt;CODE&gt;JellyPoint&lt;/CODE&gt; objects are special in that their &lt;CODE&gt;Y&lt;/CODE&gt; property is a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty(VS.95).aspx"&gt;DependencyProperty&lt;/A&gt; and can therefore be animated by a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard(VS.95).aspx"&gt;Storyboard&lt;/A&gt;. Furthermore, they implement the &lt;A href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged(VS.95).aspx"&gt;INotifyPropertyChanged&lt;/A&gt; interface, so Charting automatically registers to get notifications every time the value changes. That done, a &lt;CODE&gt;Storyboard&lt;/CODE&gt; is created to animate each of the &lt;CODE&gt;Y&lt;/CODE&gt; values of the &lt;CODE&gt;JellyPoints&lt;/CODE&gt; from zero to their target values in left-to-right sequence. An &lt;A href="http://msdn.microsoft.com/en-us/library/cc189019(VS.96).aspx#keyframe_animations" mce_href="http://msdn.microsoft.com/en-us/library/cc189019(VS.96).aspx#keyframe_animations"&gt;easing function&lt;/A&gt; is applied to each animation to give the desired "jelly" effect. And Charting's built-in support for dynamic data automatically does all the rest of the work! &lt;/LI&gt;
&lt;LI&gt;Note that &lt;CODE&gt;DataPointSeries.TransitionDuration&lt;/CODE&gt; is set to 0 so Charting knows not to try to animate each value change itself - that's what the custom Storyboard is doing, after all! &lt;/LI&gt;
&lt;LI&gt;You can click the little thumbnail in the upper right of the chart to switch from line to column. The switch is done smoothly with a standard &lt;CODE&gt;Storyboard&lt;/CODE&gt; - though I do register a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.timeline.completed(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.timeline.completed(VS.95).aspx"&gt;Completed&lt;/A&gt; event handler so I can bring the new thumbnail to the top after the animation is done. (Recall that when two elements overlap, one of them is always on top - and that role swaps every time the thumbnail is clicked.) &lt;/LI&gt;
&lt;LI&gt;I mentioned above that the &lt;CODE&gt;IValueConverter&lt;/CODE&gt; shouldn't be necessary for the column sample because Charting natively supports everything that's needed - but I used the &lt;CODE&gt;IValueConverter&lt;/CODE&gt; anyway... What gives? Well, this is one of those things where it's harder to do a sample than it would be to do the real thing... When I run the sample, I always end up clicking the "More jelly!" button like a hyperactive monkey - and Charting wasn't designed for that kind of behavior. Specifically, when the &lt;CODE&gt;AnimationSequence&lt;/CODE&gt; property is set, the corresponding in- and out-animations are always run to completion. They each have a duration of one second, so when someone goes nuts clicking, the animations start falling behind and the visuals start to lag. Things eventually settle correctly, but I'm not very patient and I used the &lt;CODE&gt;IValueConverter&lt;/CODE&gt; just in case there are any other click-happy folks out there. &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've always thought the original "jelly charts" sample was really well done - it was fun to reproduce it using a "real" charting package. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9754484" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Maintaining balance [A versatile red-black tree implementation for .NET (via Silverlight/WPF Charting)]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/06/02/maintaining-balance-a-versatile-red-black-tree-implementation-for-net-via-silverlight-wpf-charting.aspx</id><published>2009-06-02T17:34:00Z</published><updated>2009-06-02T17:34:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I spent some time in my last post &lt;A href="http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx"&gt;explaining how Silverlight/WPF Charting takes advantage of an ordered multi-dictionary to improve the performance of various scenarios&lt;/A&gt;. I wrote about Charting's use of a custom binary tree implementation and outlined some limitations of that algorithm and our particular implementation of it. In this post, I'm going to explain how we're addressing those limitations for the next release of Charting &lt;STRONG&gt;and&lt;/STRONG&gt; share the general purpose code we're using to do it! &lt;/P&gt;
&lt;P&gt;The fundamental problem with our current &lt;CODE&gt;BinaryTree&lt;/CODE&gt; implementation is that offers no &lt;A href="http://en.wikipedia.org/wiki/Balanced_binary_tree" mce_href="http://en.wikipedia.org/wiki/Balanced_binary_tree"&gt;guarantee of balance&lt;/A&gt;, and can devolve into linear performance even when dealing with fairly typical data. And this isn't an implementation problem - it's an algorithmic one: if you want balancing behavior, you should really use a data structure that balances. (Duh...) One of the most popular data structures for implementing a balanced binary tree is the &lt;A href="http://en.wikipedia.org/wiki/Red_black_tree" mce_href="http://en.wikipedia.org/wiki/Red_black_tree"&gt;red-black tree&lt;/A&gt;. Red-black trees get their name from the colors they assign to their nodes - which they use to perform various "rotations" on the tree in order to maintain a set of invariants that guarantee the tree remains more-or-less balanced. (I'm not going to go into more detail here; the &lt;A href="http://en.wikipedia.org/wiki/Red_black_tree" mce_href="http://en.wikipedia.org/wiki/Red_black_tree"&gt;Wikipedia article&lt;/A&gt; is a great resource for learning more.) The "problem" with red-black trees is that they're notoriously tricky to implement correctly - especially the &lt;STRONG&gt;remove&lt;/STRONG&gt; scenarios. There are a lot of special cases to deal with, and things can get messy pretty quickly... &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Solution&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Which is why I was so excited to read about &lt;A href="http://www.cs.princeton.edu/~rs/" mce_href="http://www.cs.princeton.edu/~rs/"&gt;Robert Sedgewick&lt;/A&gt;'s &lt;A href="http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf" mce_href="http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf&amp;#13;&amp;#10;"&gt;research paper on "left-leaning red-black trees"&lt;/A&gt;. (If you want something a little more colorful than a research paper, &lt;A href="http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf" mce_href="http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf"&gt;here's a presentation on the same topic&lt;/A&gt;.) Basically, Dr. Sedgewick took advantage of a correspondence between red-black trees and 2-3-4 trees to introduce a constraint (that red nodes must be "left-leaning") which &lt;STRONG&gt;significantly&lt;/STRONG&gt; simplifies the overall implementation. This new algorithm sounded perfect for our purposes, and I spent a few bus rides developing a C# implementation of left-leaning red-black trees based on the published research. &lt;/P&gt;&lt;IMG height=241 alt="Performance comparison of up to 2000 elements" src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-Comparison-2000.png" width=321 mce_src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-Comparison-2000.png"&gt; 
&lt;P&gt;But wait! Charting needs an ordered multi-dictionary whereas red-black trees implement a standard dictionary - what gives? Well, do you remember the trick I wrote about in my &lt;A href="http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx"&gt;binary tree post&lt;/A&gt; where I figured out that I could turn a standard dictionary into an ordered multi-dictionary by adding a value comparison into the mix? Good, because I've done exactly the same thing here. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P&gt;But this time it's even a little bit better! Instead of storing "identical" nodes next "beside" each other (which is not as easy in a red-black tree), I realized that I could collapse all duplicate nodes into the &lt;STRONG&gt;same&lt;/STRONG&gt; node by adding a &lt;CODE&gt;Sibling&lt;/CODE&gt; count to the &lt;CODE&gt;Node&lt;/CODE&gt; structure. This makes duplicate nodes really easy to deal with because the standard &lt;STRONG&gt;add&lt;/STRONG&gt; and &lt;STRONG&gt;remove&lt;/STRONG&gt; code stays exactly the same until the very end when it checks for siblings. &lt;/P&gt;
&lt;P&gt;But wait - there's more. &lt;NOBR&gt;:)&lt;/NOBR&gt; Because it was so easy to implement the ordered multi-dictionary Charting needed, I decided to make my &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; implementation &lt;STRONG&gt;both&lt;/STRONG&gt; an ordered multi-dictionary &lt;STRONG&gt;and&lt;/STRONG&gt; a normal dictionary! You can choose which one you want by passing in either key+value comparison functions to the constructor (to create an ordered multi-dictionary) or just a key comparison function (to create a standard dictionary). All the class's properties and methods work exactly the same in both modes, so switching between them is easy! (To make it even easier, I've added two trivial helper methods to simplify the standard dictionary scenarios: &lt;CODE&gt;Remove(key)&lt;/CODE&gt; and &lt;CODE&gt;GetValueForKey(key)&lt;/CODE&gt;.) &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Performance&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Okay, so this is all well and good, but the real question is whether &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; runs faster than &lt;CODE&gt;BinaryTree&lt;/CODE&gt; or not. Well, if you looked at the graph above comparing the elapsed time (vertical axis) of the two solutions for different node counts (horizontal axis), then you already know the answer. &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; is a clear win for the tested scenario (which was sequential &lt;STRONG&gt;add&lt;/STRONG&gt;s, a bunch of min/max &lt;STRONG&gt;search&lt;/STRONG&gt; operations, then sequential &lt;STRONG&gt;remove&lt;/STRONG&gt;s - typical Charting behavior). Okay, so once you've decided that &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; is a win when node counts start getting large, the next question is how the two implementations compare for low node counts. Because the scale of the previous graph is large and could be obscuring some detail in the low range, let's specifically measure the performance for small numbers of nodes: &lt;/P&gt;&lt;IMG height=241 alt="Performance comparison focus on less than 100 elements" src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-Comparison-100.png" width=321 mce_src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-Comparison-100.png"&gt; 
&lt;P&gt;And there you have it: &lt;CODE&gt;BinaryTree&lt;/CODE&gt; beats &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; when the node count is close to 20. Which isn't very surprising when you think about it - for small numbers of nodes, the unbalance of &lt;CODE&gt;BinaryTree&lt;/CODE&gt; is not yet significant enough to outweigh the overhead that &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; incurs from its balancing process. But does this particular region of performance inversion &lt;STRONG&gt;really&lt;/STRONG&gt; matter? Not so much - the range where &lt;CODE&gt;BinaryTree&lt;/CODE&gt; wins is very small, the difference in timings is small, and the impact of sorting on performance at those node counts is basically insignificant. So the next version of Charting doesn't bother trying to pick the best sorting algorithm for different scenarios - it uses &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; for everything. And you'll be glad it does when your node count starts growing! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;BLOCKQUOTE&gt;Aside: There &lt;STRONG&gt;is&lt;/STRONG&gt; a scenario where &lt;CODE&gt;BinaryTree&lt;/CODE&gt; beats &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; even at large node counts. Specifically, if the original data is already completely random, then &lt;CODE&gt;BinaryTree&lt;/CODE&gt; naturally ends up nicely balanced as a direct consequence of that randomness - and it didn't need to spend &lt;STRONG&gt;any&lt;/STRONG&gt; cycles making itself that way! &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; doesn't know the data is random and spends cycles balancing itself unnecessarily. However, this performance delta between the algorithms doesn't diverge like in the charts above - &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; has a consistent ~35% overhead across the board. It's been said that you never get something for nothing - and this overhead is just part of the cost of having &lt;STRONG&gt;guaranteed&lt;/STRONG&gt; balancing behavior across &lt;STRONG&gt;all&lt;/STRONG&gt; inputs. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Testing&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Okay, so it's faster - but is it correct? Yes, I'm prepared to suggest that it is - and I happen to have a set of automated test cases to back my claim up! &lt;NOBR&gt;:)&lt;/NOBR&gt; The tests I've written pick a random number of elements across randomly sized key and value spaces, add all these random pairs to the tree, make sure everything's behaving correctly, and then remove them all in random order. After each add or remove, the complete state of the entire tree is checked against a separate algorithm. And all the while &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; is running its own internal code to ensure the invariants of a left-leaning red-black tree are maintained at all times. &lt;/P&gt;
&lt;P&gt;I call this whole thing a "scenario". I've found that 100% code coverage is achieved after running just 1 or 2 scenarios; 40 scenarios is all it takes to exercise the set of problematic corner cases I've seen. Well, the automated tests run &lt;STRONG&gt;1000&lt;/STRONG&gt; scenarios - 250 known scenarios against a normal dictionary, 250 known scenarios against an ordered multi-dictionary, 250 random ones on a normal dictionary, and 250 random ones on an ordered multi-dictionary. Whew! &lt;/P&gt;
&lt;P&gt;Of course, no code is ever perfect - but I'm pretty happy with the level of coverage here and optimistic that it's helped squash the bugs that matter. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;API&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;You might expect &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; to implement &lt;A href="http://msdn.microsoft.com/en-us/library/s4ys34ea.aspx" mce_href="http://msdn.microsoft.com/en-us/library/s4ys34ea.aspx"&gt;IDictionary&amp;lt;TKey, TValue&amp;gt;&lt;/A&gt; - but it doesn't. However, it &lt;STRONG&gt;does&lt;/STRONG&gt; have an API that strongly resembles that interface, so it should look pretty familiar. For example, &lt;CODE&gt;Add&lt;/CODE&gt; looks exactly the same and the single-parameter form of &lt;CODE&gt;Remove&lt;/CODE&gt; (for normal dictionary mode) is exactly the same as well. Ordered multi-dictionary mode necessitates a two-parameter form of &lt;CODE&gt;Remove&lt;/CODE&gt;, but it's just what you'd expect. &lt;CODE&gt;Clear&lt;/CODE&gt; and &lt;CODE&gt;Count&lt;/CODE&gt; (via &lt;CODE&gt;IDictionary&lt;/CODE&gt;'s base class &lt;A href="http://msdn.microsoft.com/en-us/library/92t2ye13.aspx" mce_href="http://msdn.microsoft.com/en-us/library/92t2ye13.aspx"&gt;ICollection&amp;lt;T&amp;gt;&lt;/A&gt;) are identical as well. &lt;/P&gt;
&lt;P&gt;However, things start to diverge a bit after that. Instead of ICollection&amp;lt;T&amp;gt; properties for &lt;CODE&gt;Keys&lt;/CODE&gt; and &lt;CODE&gt;Values&lt;/CODE&gt; (which may be unnecessarily costly to compute if the caller only needed a few of the elements), there are &lt;A href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx" mce_href="http://msdn.microsoft.com/en-us/library/9eekhta0.aspx"&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/A&gt; methods &lt;CODE&gt;GetKeys&lt;/CODE&gt; and &lt;CODE&gt;GetValuesForAllKeys&lt;/CODE&gt;. It's the same idea, but more efficient thanks to being sequence-based! The array accessor (&lt;CODE&gt;this[T]&lt;/CODE&gt;) is deliberately absent because it doesn't make much sense for the ordered multi-dictionary mode - I'd rather things be more explicit via &lt;CODE&gt;Add&lt;/CODE&gt; or &lt;CODE&gt;GetValueForKey&lt;/CODE&gt;/&lt;CODE&gt;GetValuesForKey&lt;/CODE&gt;. The latter of those last two methods works in both modes; the first is available as a simplification for normal dictionary mode (and throws &lt;A href="http://msdn.microsoft.com/en-us/library/system.collections.generic.keynotfoundexception.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.collections.generic.keynotfoundexception.aspx"&gt;KeyNotFoundException&lt;/A&gt; for consistency with &lt;CODE&gt;IDictionary&lt;/CODE&gt; implementations). &lt;CODE&gt;ContainsKey&lt;/CODE&gt; and &lt;CODE&gt;TryGetValue&lt;/CODE&gt; are both absent - and trivial to add if you want them. As for the rest of the &lt;CODE&gt;IDictionary&amp;lt;T&amp;gt;&lt;/CODE&gt;/&lt;CODE&gt;ICollection&amp;lt;T&amp;gt;&lt;/CODE&gt;/&lt;CODE&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/CODE&gt;/&lt;CODE&gt;IEnumerable&lt;/CODE&gt; properties and methods, they either don't make sense on an ordered multi-dictionary or are easy enough to add. And finally, the API is rounded out by the &lt;CODE&gt;MinimumKey&lt;/CODE&gt; and &lt;CODE&gt;MaximumKey&lt;/CODE&gt; properties - specifically implemented for efficiency because Charting makes such heavy use of them. &lt;/P&gt;
&lt;P&gt;In case that was all just a confusing jumble of class names and interfaces, here's what it looks like in code:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Implements a left-leaning red-black tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;remarks&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Based on the research paper "Left-leaning Red-Black Trees"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; by Robert Sedgewick. More information available at:
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; http://www.cs.princeton.edu/~rs/talks/LLRB/RedBlack.pdf
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; http://www.cs.princeton.edu/~rs/talks/LLRB/08Penn.pdf
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/remarks&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;typeparam name="TKey"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Type of keys.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/typeparam&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;typeparam name="TValue"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Type of values.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/typeparam&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;LeftLeaningRedBlackTree&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TKey, TValue&amp;gt;
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Initializes a new instance of the LeftLeaningRedBlackTree class implementing a normal dictionary.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="keyComparison"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;The key comparison function.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; LeftLeaningRedBlackTree(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TKey&amp;gt; keyComparison)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Initializes a new instance of the LeftLeaningRedBlackTree class implementing an ordered multi-dictionary.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="keyComparison"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;The key comparison function.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="valueComparison"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;The value comparison function.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; LeftLeaningRedBlackTree(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TKey&amp;gt; keyComparison, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Comparison&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TValue&amp;gt; valueComparison)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Adds a key/value pair to the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="key"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Key to add.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="value"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Value to add.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Add(TKey key, TValue value)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Removes a key (and its associated value) from a normal (non-multi) dictionary.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="key"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Key to remove.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;True if key present and removed.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Remove(TKey key)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Removes a key/value pair from the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="key"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Key to remove.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="value"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Value to remove.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;True if key/value present and removed.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Remove(TKey key, TValue value)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Removes all nodes in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Clear()

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets a sorted list of keys in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Sorted list of keys.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TKey&amp;gt; GetKeys()

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets the value associated with the specified key in a normal (non-multi) dictionary.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="key"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Specified key.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Value associated with the specified key.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; TValue GetValueForKey(TKey key)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets a sequence of the values associated with the specified key.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="key"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Specified key.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Sequence of values.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TValue&amp;gt; GetValuesForKey(TKey key)

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets a sequence of all the values in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Sequence of all values.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;TValue&amp;gt; GetValuesForAllKeys()

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets the count of key/value pairs in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Count

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets the minimum key in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; TKey MinimumKey

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets the maximum key in the tree.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; TKey MaximumKey
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Debugging&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;At this point, I'm reasonably confident that &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; behaves correctly - but that wasn't always the case! &lt;NOBR&gt;:)&lt;/NOBR&gt; Three particular debugging aids served me well and I'd like to call them out (Note: to enable the bottom two debugging aids, you need to uncomment the line &lt;CODE&gt;#define DEBUGGING&lt;/CODE&gt; at the top of &lt;CODE&gt;LeftLeaningRedBlackTree.cs&lt;/CODE&gt;): &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The first is a standard .NET technique, but one many people don't seem to be familiar with: &lt;A href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerdisplayattribute.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.diagnostics.debuggerdisplayattribute.aspx"&gt;DebuggerDisplayAttribute&lt;/A&gt;. Specifically, this attribute improves the debugging experience by turning the visual representation of a node from &lt;CODE&gt;{LeftLeaningRedBlackTree&amp;lt;int,int&amp;gt;.Node}&lt;/CODE&gt; into &lt;CODE&gt;Key=4, Value=15, Siblings=0&lt;/CODE&gt;. Granted, it's the same information you'd get by expanding to display the node's properties, but it's automatically used in the Autos and Watch windows as well as by tooltips! What's more, this is easy to enable for &lt;STRONG&gt;any&lt;/STRONG&gt; class - just provide a customized format string like this: &lt;CODE&gt;"Key={Key}, Value={Value}, Siblings={Siblings}"&lt;/CODE&gt;. &lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Both &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; and its private &lt;CODE&gt;Node&lt;/CODE&gt; class expose a string property that returns an HTML representation of the tree/node and its children. Here's what it looks like when viewed with Visual Studio's built-in "HTML Visualizer" for strings: &lt;/P&gt;&lt;IMG height=195 alt="HTML debugging display" src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-HtmlDebugging.png" width=518 mce_src="http://blogs.msdn.com/blogfiles/delay/LeftLeaningRedBlackTree-HtmlDebugging.png"&gt; 
&lt;P&gt;More than just a cool trick, the &lt;CODE&gt;HtmlDocument&lt;/CODE&gt; and &lt;CODE&gt;HtmlFragment&lt;/CODE&gt; properties are an invaluable resource for visualizing the many rotations/manipulations of the tree as it balances itself. After you've stared at this kind of stuff for a while, you start to develop a sense of what looks wrong - and this visualization makes finding algorithmic problems quite a bit easier than if the in-memory representation of the tree was all you had! &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;When enabled for debugging, the &lt;CODE&gt;AssertInvariants&lt;/CODE&gt; method gets called at the end of every method that manipulates the tree. The purpose of this method is to ensure the basic requirements of a left-leaning red-black tree are maintained - specifically, it &lt;A href="http://msdn.microsoft.com/en-us/library/e63efys0.aspx" mce_href="http://msdn.microsoft.com/en-us/library/e63efys0.aspx"&gt;Assert&lt;/A&gt;s that the following conditions are true every time it's called: 
&lt;UL&gt;
&lt;LI&gt;Root node is black&lt;/LI&gt;
&lt;LI&gt;Every path from the root to leaf nodes contains the same number of black nodes&lt;/LI&gt;
&lt;LI&gt;Left node is less&lt;/LI&gt;
&lt;LI&gt;Right node is greater&lt;/LI&gt;
&lt;LI&gt;Both children of a red node are black&lt;/LI&gt;
&lt;LI&gt;Nodes are always left-leaning&lt;/LI&gt;
&lt;LI&gt;No consecutive red nodes&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;&lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; has been a fun project and I'm glad to be able to leverage it to help make significant improvements to Charting's performance for some very real customer scenarios. I'd like to extend my thanks to Dr. Sedgewick for his research in this area and express my hope that others will be able to take advantage of &lt;CODE&gt;LeftLeaningRedBlackTree&lt;/CODE&gt; to improve the performance of their own applications. As always, if you run into any problems, please let me know - any errors here are my fault, not anyone else's! &lt;NOBR&gt;:)&lt;/NOBR&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/LeftLeaningRedBlackTree/LeftLeaningRedBlackTree.zip" mce_href="http://cesso.org/Samples/LeftLeaningRedBlackTree/LeftLeaningRedBlackTree.zip"&gt;[Please click here to download the source code for LeftLeaningRedBlackTree, its test application, unit tests, and the comparison project.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9686081" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>You've got to know where you've been to know where you're going [Some background on Charting's ordered multiple dictionary implementation]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/05/26/you-ve-got-to-know-where-you-ve-been-to-know-where-you-re-going-some-background-on-charting-s-ordered-multiple-dictionary-implementation.aspx</id><published>2009-05-27T06:39:00Z</published><updated>2009-05-27T06:39:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;As I've said before, one of our key goals for the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430"&gt;March 09 release&lt;/A&gt; of &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Silverlight/WPF Charting&lt;/A&gt; was to &lt;A href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx"&gt;improve the performance of key customer scenarios&lt;/A&gt;. I didn't go into a lot of details with the release notes, but one of the ways we accomplished this was to change some code that had been doing a &lt;A href="http://en.wikipedia.org/wiki/Linear_search" mce_href="http://en.wikipedia.org/wiki/Linear_search"&gt;linear search&lt;/A&gt; to use a &lt;A href="http://en.wikipedia.org/wiki/Binary_search" mce_href="http://en.wikipedia.org/wiki/Binary_search"&gt;binary search&lt;/A&gt; instead. (Example: Finding the high/low data point values as part of the process of setting the range of an axis.) If this optimization seems obvious and makes you think "golly, they should have done it that way in the first place", you're absolutely right. &lt;NOBR&gt;:)&lt;/NOBR&gt; It's not that we didn't &lt;STRONG&gt;want&lt;/STRONG&gt; to do this earlier; it was just that we didn't have the resources to do so... &lt;/P&gt;
&lt;P&gt;What we hoped to take advantage of was some already-written-and-tested class implementing an ordered multi-dictionary (a kind of &lt;A href="http://en.wikipedia.org/wiki/Associative_array" mce_href="http://en.wikipedia.org/wiki/Associative_array"&gt;associative array&lt;/A&gt;) that could be dropped right into the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; source code and used without concern. After we found a suitable implementation, we established that it did, indeed, improve performance on non-trivial data sets in the way that we hoped. Unfortunately, something came up at the last minute and we decided &lt;STRONG&gt;not&lt;/STRONG&gt; to proceed with the code we'd been using for the previous few weeks. That left us in kind of a funk because we didn't want to give up the performance improvements we'd already seen... &lt;/P&gt;
&lt;P&gt;So I set aside some other tasks and dashed off a quick &lt;A href="http://en.wikipedia.org/wiki/Binary_search#Computer_usage" mce_href="http://en.wikipedia.org/wiki/Binary_search#Computer_usage"&gt;binary tree&lt;/A&gt; implementation to do what we needed and preserve the performance gains from faster searching. The resulting code for &lt;CODE&gt;BinaryTree&lt;/CODE&gt; is part of the Charting source code and can be viewed &lt;A href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#509082" mce_href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#509082"&gt;here&lt;/A&gt; or as part of the Silverlight Toolkit download. It's fairly simple and straightforward, though there are a few things worth calling out: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A binary tree (indexed by key, duplicates replace, values don't matter) doesn't follow quite the same semantics as an ordered multi-dictionary (indexed by key, duplicates do not replace, values matter). I needed to come up with an easy way to merge the two notions and the trick I came up with was to change the search function (named &lt;CODE&gt;KeyAndValueComparison&lt;/CODE&gt;) from being key-based to being key-and-value-based. Simply by incorporating the value into the comparison, I pretty easily created a multi-dictionary (i.e., something that can store multiple values for the same key). What's more, it automatically clusters by key &lt;STRONG&gt;and&lt;/STRONG&gt; orders the values under every key! The only remaining problem is what to do with key+value duplicates - and the answer is simple: store them all together in the tree. By relaxing the binary tree definition slightly to allow for same-valued nodes, it's easy enough to store identical nodes "beside" each other. The same &lt;STRONG&gt;search&lt;/STRONG&gt;/&lt;STRONG&gt;remove&lt;/STRONG&gt; logic still applies under the new rules - all that changes is a slight tweak to the &lt;STRONG&gt;add&lt;/STRONG&gt; logic! &lt;/LI&gt;
&lt;LI&gt;This implementation is just a simple binary tree, so there's no &lt;A href="http://en.wikipedia.org/wiki/Balanced_binary_tree" mce_href="http://en.wikipedia.org/wiki/Balanced_binary_tree"&gt;guarantee of balance&lt;/A&gt; like there is with more sophisticated algorithms. In fact, because the rules about where new nodes go are strict, there's no freedom when it comes time to place a new node. The only time there's any choice is when a key+value duplicate is added (or removed) - once the matching node in the tree is found, the new node could be added to its left or its right. In a feeble attempt to create balance, this &lt;CODE&gt;BinaryTree&lt;/CODE&gt; implementation alternates left/right in these cases. Unfortunately, it's not likely to help much because key+value duplicates are typically not the primary scenario... &lt;/LI&gt;
&lt;LI&gt;Because it was an easy performance win, this implementation uses an &lt;A href="http://en.wikipedia.org/wiki/Iteration#Computing" mce_href="http://en.wikipedia.org/wiki/Iteration#Computing"&gt;iterative&lt;/A&gt; &lt;STRONG&gt;add&lt;/STRONG&gt; implementation (vs. the traditional &lt;A href="http://en.wikipedia.org/wiki/Recursion_(computer_science)" mce_href="http://en.wikipedia.org/wiki/Recursion_(computer_science)"&gt;recursive&lt;/A&gt; one). The &lt;STRONG&gt;delete&lt;/STRONG&gt; operation is somewhat more complex and follows the usual recursive approach - which can be problematic for certain inputs. &lt;NOBR&gt;:(&lt;/NOBR&gt; Imagine the scenario of adding 1000 elements to a &lt;CODE&gt;BinaryTree&lt;/CODE&gt; where the keys are already in numerical order. (By the way, this isn't as unlikely as it sounds; people frequently chart data that is already sorted!) In this case, the tree will "go linear" and all the nodes will lie in a line off to the right side. Conveniently, removing the same nodes in the same order (the common scenario for Charting!) is wicked fast - the node that gets removed is always the root node which is both fast to find and fast to update. However, if one were to remove the nodes in &lt;STRONG&gt;reverse&lt;/STRONG&gt; order, there's a good chance the stack would overflow instead. &lt;NOBR&gt;:(&lt;/NOBR&gt; This is because the node that should be removed is at the &lt;STRONG&gt;end&lt;/STRONG&gt; of a long chain of 1000 nodes and the recursive &lt;STRONG&gt;remove&lt;/STRONG&gt; calls build up quickly and soon overwhelm the system. So please don't do that with this implementation! &lt;/LI&gt;
&lt;LI&gt;One of the handy helper methods I ended up writing is &lt;CODE&gt;Traverse&lt;/CODE&gt; which does an iterative &lt;A href="http://en.wikipedia.org/wiki/Tree_traversal" mce_href="http://en.wikipedia.org/wiki/Tree_traversal"&gt;inorder&lt;/A&gt; walk of the entire tree and returns a sequence of items selected by the selection function from nodes that match the comparison function. &lt;CODE&gt;Traverse&lt;/CODE&gt; makes it easy to build more sophisticated methods - &lt;CODE&gt;GetKeys&lt;/CODE&gt;, &lt;CODE&gt;GetValuesForKey&lt;/CODE&gt;, and &lt;CODE&gt;GetValuesForAllKeys&lt;/CODE&gt; are all simple 1-liners thanks to the power of &lt;CODE&gt;Traverse&lt;/CODE&gt;. Similarly, the &lt;CODE&gt;GetExtreme&lt;/CODE&gt; method does a binary search according to the successor function and returns some aspect of the most extreme node according to the selector function. &lt;CODE&gt;MinimumKey&lt;/CODE&gt;, &lt;CODE&gt;MaximumKey&lt;/CODE&gt;, &lt;CODE&gt;MinimumValue&lt;/CODE&gt;, and &lt;CODE&gt;MaximumValue&lt;/CODE&gt; are all simple 1-liners thanks to the flexibility of &lt;CODE&gt;GetExtreme&lt;/CODE&gt;. &lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;BinaryTree&lt;/CODE&gt; is a generic class and supports completely arbitrary key and value types. In order to avoid imposing unnecessary restrictions on the generic types (ex: that they implement the &lt;A href="http://msdn.microsoft.com/en-us/library/system.icomparable.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.icomparable.aspx"&gt;IComparable&lt;/A&gt; interface), &lt;CODE&gt;BinaryTree&lt;/CODE&gt;'s constructor takes a &lt;A href="http://msdn.microsoft.com/en-us/library/tfakywbh.aspx" mce_href="http://msdn.microsoft.com/en-us/library/tfakywbh.aspx"&gt;Comparison(T)&lt;/A&gt; delegate for comparing keys and another for comparing values. As long as &lt;STRONG&gt;you&lt;/STRONG&gt; can write code to compare two keys/values of the type you've chosen according to the necessary contract, &lt;CODE&gt;BinaryTree&lt;/CODE&gt; is happy to work with them! &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;So that's a bit of background on the &lt;CODE&gt;BinaryTree&lt;/CODE&gt; class that's used by Silverlight/WPF Charting today. An unbalanced binary tree doesn't give the best performance in the world, but it was quick and easy to implement (under time pressure!) and gives a noticeable boost to many of the common scenarios we set out to improve. &lt;/P&gt;
&lt;P&gt;And as it happens, this is all very relevant to the topic of my next post! Here's a &lt;STRONG&gt;&lt;SPAN style="COLOR: red"&gt;h&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;i&lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;n&lt;/SPAN&gt;&lt;SPAN style="COLOR: black"&gt;t&lt;/SPAN&gt;&lt;/STRONG&gt;; see if you can guess what it is... &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9643749" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Chart tweaking made easy [How to: Make four simple color/ToolTip changes with Silverlight/WPF Charting]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/05/19/chart-tweaking-made-easy-how-to-make-four-simple-color-tooltip-changes-with-silverlight-wpf-charting.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/05/19/chart-tweaking-made-easy-how-to-make-four-simple-color-tooltip-changes-with-silverlight-wpf-charting.aspx</id><published>2009-05-20T06:34:00Z</published><updated>2009-05-20T06:34:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;While answering a &lt;A href="http://silverlight.net/forums/35.aspx" mce_href="http://silverlight.net/forums/35.aspx"&gt;support forum&lt;/A&gt; question I'd seen a couple of times before, I figured it would be helpful to write a post showing how to make simple styling changes to charts created by the Charting controls that come with the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;. Note that I said &lt;STRONG&gt;simple&lt;/STRONG&gt; changes - if you want to make more dramatic changes, you should go read some of the excellent tutorials &lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/default.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/default.aspx"&gt;Pete Brown&lt;/A&gt; has written on the topic. &lt;EM&gt;Links to Pete's posts (and other interesting posts) can be found on my latest &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Charting links post&lt;/A&gt;.&lt;/EM&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sample application we'll be working with here shows off four scenarios and looks like this: &lt;/P&gt;&lt;IMG alt="Styling Sample" src="http://blogs.msdn.com/blogfiles/delay/ChartStylingScenarios.png" width=551 height=541 mce_src="http://blogs.msdn.com/blogfiles/delay/ChartStylingScenarios.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Simple Color Change &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In this scenario we have a basic &lt;CODE&gt;Chart&lt;/CODE&gt; with a &lt;CODE&gt;ColumnSeries&lt;/CODE&gt; and want to change the color to purple. As you'd expect, this is quite easy to do: we provide a custom &lt;CODE&gt;Style&lt;/CODE&gt; that sets the &lt;CODE&gt;Background&lt;/CODE&gt; color to purple and we're done! &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;It's worth pointing out that we could add &lt;STRONG&gt;more&lt;/STRONG&gt; &lt;CODE&gt;Setter&lt;/CODE&gt;s to this &lt;CODE&gt;Style&lt;/CODE&gt; to customize things further - but I promised I'd keep this simple, so we won't do that right now. :) &lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Simple Color Change"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ColumnSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Length&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ColumnSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:ColumnDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Purple"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ColumnSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ColumnSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Custom ToolTip (Column) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For this example, the setup is the same as last time except that now we want to change the default &lt;CODE&gt;ToolTip&lt;/CODE&gt; that appears when the user hovers over any of the columns. As with just about every other visual default, the standard &lt;CODE&gt;ToolTip&lt;/CODE&gt; is part of the &lt;CODE&gt;ColumnDataPoint&lt;/CODE&gt;'s default &lt;CODE&gt;Template&lt;/CODE&gt;. So in order to customize it we start with a copy of that &lt;CODE&gt;Template&lt;/CODE&gt; and modify it to suit our needs. Blend makes this easy, but I'm most comfortable in Visual Studio, so what we'll do here is go to the source code for &lt;A href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507645" mce_href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507645"&gt;ColumnDataPoint.xaml&lt;/A&gt; and copy the &lt;CODE&gt;Style&lt;/CODE&gt; there to the &lt;CODE&gt;Application.Resources&lt;/CODE&gt; section of our &lt;CODE&gt;App.xaml&lt;/CODE&gt;. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Aside: You can also use &lt;A href="http://blogs.msdn.com/delay/archive/2008/12/14/expanded-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-updated-for-better-compatibility.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/12/14/expanded-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-updated-for-better-compatibility.aspx"&gt;my handy-dandy SilverlightDefaultStyleBrowser&lt;/A&gt; for this. What's more, SilverlightDefaultStyleBrowser works even when you &lt;STRONG&gt;don't&lt;/STRONG&gt; have access to source code for the control you're styling, so it's something to keep in mind for those occasions when Blend isn't readily available. :) &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Copying done, we can tweak the &lt;CODE&gt;ToolTip&lt;/CODE&gt; to include a custom message as follows: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ToolTipService.ToolTip&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Custom ToolTip"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontWeight&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Bold"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FormattedDependentValue&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ToolTipService.ToolTip&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;After that, and it's simply a matter of assigning our customized &lt;CODE&gt;Style&lt;/CODE&gt;/&lt;CODE&gt;Template&lt;/CODE&gt; to the &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; property of the &lt;CODE&gt;ColumnSeries&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Custom ToolTip"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ColumnSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Length&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; MyColumnDataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Simple Palette Change &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;What we've done so far will work for all of the current series &lt;STRONG&gt;except&lt;/STRONG&gt; for &lt;CODE&gt;PieSeries&lt;/CODE&gt; which is special because each of its &lt;CODE&gt;PieDataPoint&lt;/CODE&gt;s gets a unique &lt;CODE&gt;Style&lt;/CODE&gt;. In other words, there's no &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; property on &lt;CODE&gt;PieSeries&lt;/CODE&gt; because one value just isn't enough! Therefore, &lt;CODE&gt;PieSeries&lt;/CODE&gt; exposes a &lt;CODE&gt;StylePalette&lt;/CODE&gt; property just like &lt;CODE&gt;Chart&lt;/CODE&gt; does and we can use that to provide a &lt;STRONG&gt;collection&lt;/STRONG&gt; of &lt;CODE&gt;Styles&lt;/CODE&gt; for the pie slices. (Note that we can provide as many or as few as we want; &lt;CODE&gt;PieSeries&lt;/CODE&gt; will start at the beginning and automatically loop through the collection as necessary.) &lt;/P&gt;
&lt;P&gt;In this case, we know our data has exactly four items, so we'll provide exactly four custom &lt;CODE&gt;Style&lt;/CODE&gt;s to set the colors we want. Other than using a list this time around, it's just like the first example we saw: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Simple Palette Change"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Length&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries.StylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;datavis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:PieDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Red"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:PieDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Orange"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:PieDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Green"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:PieDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Blue"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;datavis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries.StylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Custom ToolTip (Pie) &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Finally, let's customize the &lt;CODE&gt;ToolTip&lt;/CODE&gt; for the slices of a &lt;CODE&gt;PieSeries&lt;/CODE&gt;. Like before, we'll start by copying the default &lt;CODE&gt;Style&lt;/CODE&gt;/&lt;CODE&gt;Template&lt;/CODE&gt; from the source code for &lt;A href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507651" mce_href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507651"&gt;PieDataPoint.xaml&lt;/A&gt; and then customize the &lt;CODE&gt;ToolTip&lt;/CODE&gt; found within:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ToolTipService.ToolTip&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Custom ToolTip"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontWeight&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Bold"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FormattedDependentValue&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContentControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TemplateBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FormattedRatio&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ToolTipService.ToolTip&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Because we want our &lt;CODE&gt;PieSeries&lt;/CODE&gt; to use all the same colors as the default, the next step is to copy the default &lt;CODE&gt;StylePalette&lt;/CODE&gt; from the code for &lt;A href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507636" mce_href="http://silverlight.codeplex.com/SourceControl/changeset/view/18791#507636"&gt;Chart.xaml&lt;/A&gt; and add a single &lt;CODE&gt;Setter&lt;/CODE&gt; for the &lt;CODE&gt;Template&lt;/CODE&gt; property of each of the &lt;CODE&gt;Style&lt;/CODE&gt;s within. All of which point to the &lt;STRONG&gt;one&lt;/STRONG&gt; &lt;CODE&gt;Template&lt;/CODE&gt; we just customized, so if we make any changes in the future there's exactly one place we need to touch and our changes automatically shows up everywhere they should: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;datavis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StylePalette
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; x&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;Key&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="MyStylePalette"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!--Blue--&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Control"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Template"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; MyPieDataPointTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                ...
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!--Red--&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Control"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Template"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; MyPieDataPointTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                ...
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    ...
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;With that out of the way, all that remains is to use our customized &lt;CODE&gt;StylePalette&lt;/CODE&gt; by assigning it to the &lt;CODE&gt;StylePalette&lt;/CODE&gt; property of &lt;CODE&gt;PieSeries&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Custom ToolTip"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Length&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; StylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; MyStylePalette&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;PieSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Done!&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;If you've gotten this far, I hope that you've gained at least a somewhat better understanding of how to perform some basic style changes to the Toolkit's Charting controls. We've really only scratched the surface, though, so I encourage interested readers to have a look at some of the other &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;charting links&lt;/A&gt; for more details, ideas, and inspiration! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/ChartStylingScenarios/ChartStylingScenarios.zip" mce_href="http://cesso.org/Samples/ChartStylingScenarios/ChartStylingScenarios.zip"&gt;[Please click here to download the source code for the sample application.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9631686" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Pineapple upside-down chart [How to: Invert the axis of a chart for "smaller is better" scenarios]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/05/12/pineapple-upside-down-chart-how-to-invert-the-axis-of-a-chart-for-smaller-is-better-scenarios.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/05/12/pineapple-upside-down-chart-how-to-invert-the-axis-of-a-chart-for-smaller-is-better-scenarios.aspx</id><published>2009-05-12T18:31:00Z</published><updated>2009-05-12T18:31:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Let's imagine that we want to use Silverlight (or WPF!) to chart the performance of a book on one of those "bestsellers" lists... The book we care about has been doing very well lately; here's the corresponding data we want to display: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; items = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;List&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(2009, 4, 1), 10),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(2009, 4, 8),  5),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(2009, 4, 15), 2),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(2009, 4, 22), 1),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(2009, 4, 29), 1),
};
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Naturally, we'll use the &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Charting controls&lt;/A&gt; that are part of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; (and also &lt;A href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx"&gt;available for WPF&lt;/A&gt;). :) Charting is easy to use and we quickly bang out the following XAML to create something suitable: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="9"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValuePath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Place"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValuePath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Date"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Book"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:LineDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Maroon"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Y"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Minimum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0.5"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Maximum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="10.5"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Interval&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ShowGridLines&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="True"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;It looks like this: &lt;/P&gt;&lt;IMG height=234 alt="Initial attempt" src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Initial.png" width=278 mce_src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Initial.png"&gt; 
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Hurm...&lt;/STRONG&gt;&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;The chart is &lt;STRONG&gt;100% correct&lt;/STRONG&gt;, but there's a problem: it looks like the book is becoming &lt;STRONG&gt;less&lt;/STRONG&gt; popular, not &lt;STRONG&gt;more&lt;/STRONG&gt; popular. Most of us are used to assuming that "bigger/taller is better", but that's not the case for the data in this scenario and so the chart's meaning is not intuitively obvious. In the ideal world, there would be a &lt;CODE&gt;bool&lt;/CODE&gt; &lt;CODE&gt;Invert&lt;/CODE&gt; property on &lt;CODE&gt;LinearAxis&lt;/CODE&gt; that you could toggle to "flip" the vertical axis and save the day. Unfortunately, we haven't yet implemented such a property (though it's on our list of things to do)... &lt;/P&gt;
&lt;P&gt;Therefore, it looks like a clever solution is called for - and in this case the simple trick is to &lt;STRONG&gt;invert the values&lt;/STRONG&gt; before charting them. After inversion, the "best" values (low numbers like 1) will be numerically greater than the "worst" values (high numbers like 10) and will therefore appear towards the top of the chart. This seems almost &lt;STRONG&gt;too&lt;/STRONG&gt; easy, so let's see how it works out in practice by writing a simple &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter(VS.95).aspx"&gt;IValueConverter&lt;/A&gt; to invert the values and then making the &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;highlighted&lt;/SPAN&gt; changes to the XAML: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;InverterConverter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IValueConverter
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Convert(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; value, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; targetType, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; parameter, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; culture)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (value &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;is&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; -(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)value;
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NotImplementedException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ConvertBack(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; value, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; targetType, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; parameter, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; culture)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NotImplementedException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="9"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Place&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Converter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;={&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; InverterConverter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}}&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValuePath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Date"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Book"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:LineDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Maroon"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Y"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Minimum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: yellow"&gt;-10.5&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Maximum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: yellow"&gt;-0.5&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Interval&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ShowGridLines&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="True"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;The resulting chart: &lt;/P&gt;&lt;IMG height=234 alt="Inverted axis" src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Inverted.png" width=278 mce_src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Inverted.png"&gt; 
&lt;P&gt;&lt;STRONG&gt;Woot&lt;/STRONG&gt; - the chart now clearly communicates the book's recent popularity! But the trick we played with negative numbers is plainly visible for everyone to see and they will probably mock us mercilessly. :( If only there were &lt;STRONG&gt;some&lt;/STRONG&gt; way to customize the chart's visuals to hide what we've done and complete the illusion... &lt;/P&gt;
&lt;P&gt;Wait - there &lt;STRONG&gt;is&lt;/STRONG&gt; a way! All we need to do is take advantage of Charting's &lt;CODE&gt;DataPoint.DependentValueStringFormat&lt;/CODE&gt; and &lt;CODE&gt;LinearAxis.AxisLabelStyle&lt;/CODE&gt; properties and mix in a little of .NET's support for &lt;A href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx" mce_href="http://msdn.microsoft.com/en-us/library/0c899ak8.aspx"&gt;"Section Separators and Conditional Formatting"&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;[Type, type, type...]&lt;/EM&gt; &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="9"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; DependentValueBinding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Place&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;,&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Converter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;={&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;StaticResource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; InverterConverter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IndependentValuePath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Date"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Book"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:LineDataPoint"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Background"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Maroon"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="DependentValueStringFormat"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{}{0:0.#;0.#}"/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DataPointStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Y"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Minimum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="-10.5"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Maximum&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="-0.5"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Interval&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ShowGridLines&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="True"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis.AxisLabelStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="charting:AxisLabel"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="StringFormat"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{}{0:0.#;0.#}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis.AxisLabelStyle&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LinearAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries.DependentRangeAxis&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;LineSeries&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;charting&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Presto: &lt;/P&gt;&lt;IMG height=234 alt="Complete success" src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Complete.png" width=278 mce_src="http://blogs.msdn.com/blogfiles/delay/InvertedAxis-Complete.png"&gt; 
&lt;P&gt;&lt;STRONG&gt;Success&lt;/STRONG&gt; - our chart looks exactly how we want it to and we barely even broke a sweat! You can go ahead and pat yourself on the back a few times - then stop spending time imagining Charting scenarios and get back to work! :) &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/InvertedAxis/InvertedAxis.zip" mce_href="http://cesso.org/Samples/InvertedAxis/InvertedAxis.zip"&gt;[Click here to download the complete source code for the sample application used to create the charts shown above.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9607895" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>One more platform difference more-or-less tamed [SetterValueBindingHelper makes Silverlight Setters better!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/05/07/one-more-platform-difference-more-or-less-tamed-settervaluebindinghelper-makes-silverlight-setters-better.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/05/07/one-more-platform-difference-more-or-less-tamed-settervaluebindinghelper-makes-silverlight-setters-better.aspx</id><published>2009-05-07T08:40:00Z</published><updated>2009-05-07T08:40:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Earlier this week &lt;A href="http://blogs.msdn.com/delay/archive/2009/05/04/going-extreme-with-silverlight-3-sharing-the-source-code-for-a-real-world-sample-application.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/05/04/going-extreme-with-silverlight-3-sharing-the-source-code-for-a-real-world-sample-application.aspx"&gt;I wrote about the "app building" exercise my team conducted and posted my sample application&lt;/A&gt;, a simple organizational hierarchy viewer using many of the controls in the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;. One of the surprises I had during the process of building this application was that Silverlight (version 2 as well as the Beta for version 3) doesn't support the scenario of providing a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding.aspx"&gt;Binding&lt;/A&gt; in the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.setter.value.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.setter.value.aspx"&gt;Value&lt;/A&gt; of a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.setter.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.setter.aspx"&gt;Setter&lt;/A&gt;. I bumped into this when I was trying to follow one of the "best practices" for &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeview.aspx"&gt;TreeView&lt;/A&gt; manipulation - but I soon realized the problem has much broader reach. &lt;/P&gt;
&lt;P&gt;First, a bit about why this is interesting at all. :) Because of the way &lt;CODE&gt;TreeView&lt;/CODE&gt; works on WPF and Silverlight, it turns out that the most elegant way of manipulating the nodes (for example, to expand all the nodes in a tree) is to do so by manipulating &lt;STRONG&gt;your own&lt;/STRONG&gt; classes to which the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.aspx"&gt;TreeViewItem&lt;/A&gt;'s &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.isexpanded.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.treeviewitem.isexpanded.aspx"&gt;IsExpanded&lt;/A&gt; property is bound. &lt;A href="http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx" mce_href="http://www.codeproject.com/KB/WPF/TreeViewWithViewModel.aspx"&gt;Josh Smith does a great job explaining why in this article&lt;/A&gt;, so I won't spend more time on that here. However, as &lt;A href="http://bea.stollnitz.com/blog/?p=55" mce_href="http://bea.stollnitz.com/blog/?p=55"&gt;Bea Stollnitz explains near the bottom of this post&lt;/A&gt; (and as I mention above), the XAML-based &lt;CODE&gt;Setter&lt;/CODE&gt;/&lt;CODE&gt;Value&lt;/CODE&gt;/&lt;CODE&gt;Binding&lt;/CODE&gt; approach doesn't work on Silverlight. &lt;/P&gt;
&lt;P&gt;In her post, Beatriz outlines a very reasonable workaround for this problem which is to subclass &lt;CODE&gt;TreeView&lt;/CODE&gt; and &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; in order to override &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.getcontainerforitemoverride.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.getcontainerforitemoverride.aspx"&gt;GetContainerForItemOverride&lt;/A&gt; and hook up the desired &lt;CODE&gt;Binding&lt;/CODE&gt;s there. However, there are two drawbacks with this approach that I hoped to be able to improve upon: 1. It's limited to &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.aspx"&gt;ItemsControl&lt;/A&gt; subclasses (because other controls don't have &lt;CODE&gt;GetContainerForItemOverride&lt;/CODE&gt;) and 2. it moves design concerns into code (where designers can't see or change them). &lt;/P&gt;
&lt;P&gt;As part of my app building work, I came up with a one-off way of avoiding the &lt;CODE&gt;ItemsControl&lt;/CODE&gt; coupling, but it wasn't broadly useful in its original form. Fortunately, in the process of extracting that code out in generalizing it for this post, I realized how I could avoid the second drawback as well and accomplish the goal without needing &lt;STRONG&gt;any&lt;/STRONG&gt; code at all - it's all XAML, all the time! &lt;EM&gt;[Yes, designers, I [heart] you. :) ]&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;The trick is to use a &lt;CODE&gt;Setter&lt;/CODE&gt; to set a special attached &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dependencyproperty.aspx"&gt;DependencyProperty&lt;/A&gt; with a &lt;CODE&gt;Value&lt;/CODE&gt; that specifies a special object which identifies the &lt;CODE&gt;DependencyProperty&lt;/CODE&gt; and &lt;CODE&gt;Binding&lt;/CODE&gt; to set. &lt;STRONG&gt;It's that easy!&lt;/STRONG&gt; Well, okay, I have to do a bit of work behind the scenes to make this all hang together, but it &lt;STRONG&gt;does&lt;/STRONG&gt; work - and what's more it even works for attached properties! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's an example of &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; in action: &lt;/P&gt;&lt;IMG height=380 alt="SetterValueBindingHelperDemo sample" src="http://blogs.msdn.com/blogfiles/delay/SetterValueBindingHelperDemo.png" width=488 mce_src="http://blogs.msdn.com/blogfiles/delay/SetterValueBindingHelperDemo.png"&gt; 
&lt;P&gt;First, the relevant XAML for the &lt;CODE&gt;TreeViewItem&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="controls:TreeViewItem"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- WPF syntax:
    &amp;lt;Setter Property="IsExpanded" Value="{Binding IsExpanded}"/&amp;gt; --&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="local:SetterValueBindingHelper.PropertyBinding"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;SetterValueBindingHelper
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="IsExpanded"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IsExpanded&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Yes, things end up being a little bit more verbose than they are on WPF, but if you squint hard enough the syntax is quite similar. Even better, it's something that someone who &lt;STRONG&gt;hasn't&lt;/STRONG&gt; read this post should be able to figure out on their own fairly easily. &lt;/P&gt;
&lt;P&gt;Here's the XAML for the top &lt;CODE&gt;Button&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Button"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- WPF syntax:
    &amp;lt;Setter Property="Content" Value="{Binding}"/&amp;gt; --&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="local:SetterValueBindingHelper.PropertyBinding"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;SetterValueBindingHelper
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Content"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;There's really nothing new here, but I did want to show off that &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; works for non-ItemsControls as well. &lt;/P&gt;
&lt;P&gt;Finally, here's the XAML for the right &lt;CODE&gt;Button&lt;/CODE&gt; where &lt;STRONG&gt;two&lt;/STRONG&gt; properties are being set by &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Button"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- WPF syntax:
    &amp;lt;Setter Property="Grid.Column" Value="{Binding}"/&amp;gt;
    &amp;lt;Setter Property="Grid.Row" Value="{Binding}"/&amp;gt; --&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="local:SetterValueBindingHelper.PropertyBinding"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;SetterValueBindingHelper
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="System.Windows.Controls.Grid, System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Column"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="local:SetterValueBindingHelper.PropertyBinding"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;SetterValueBindingHelper
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Grid"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Property&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Row"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter.Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Setter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;As you can see, &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; also supports setting attached &lt;CODE&gt;DependencyProperty&lt;/CODE&gt;s, so if you find yourself in a situation where you need to style such a creature, &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt;'s got your back. It's also worth pointing out that the &lt;CODE&gt;Setter&lt;/CODE&gt; for "Column" is using the official assembly-qualified naming for the Type parameter of the &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; object. This form is completely unambiguous - and it's also big, ugly, and pretty much impossible to type from memory... :) So I added code to &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; that allows users to also specify the full name of a type (ex: &lt;CODE&gt;System.Windows.Controls.Grid&lt;/CODE&gt;) or just its short name (ex: &lt;CODE&gt;Grid&lt;/CODE&gt;, used by the &lt;CODE&gt;Setter&lt;/CODE&gt; for "Row"). I expect pretty much everyone will use the short name - but sleep soundly knowing you can fall back on the other forms "just in case". &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/SetterValueBindingHelperDemo/SetterValueBindingHelperDemo.zip" mce_href="http://cesso.org/Samples/SetterValueBindingHelperDemo/SetterValueBindingHelperDemo.zip"&gt;[Click here to download the complete source code for SetterValueBindingHelper and the sample application.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Lastly, here's the code for &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; in case that's all you care about: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Class that implements a workaround for a Silverlight XAML parser
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; limitation that prevents the following syntax from working:
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;    &amp;amp;lt;Setter Property="IsSelected" Value="{Binding IsSelected}"/&amp;amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Optional type parameter used to specify the type of an attached
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; DependencyProperty as an assembly-qualified name, full name, or
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; short name.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SuppressMessage&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.Naming"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CA1721:PropertyNamesShouldNotMatchGetMethods"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        Justification = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Unambiguous in XAML."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Type { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Property name for the normal/attached DependencyProperty on which
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; to set the Binding.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Property { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Binding to set on the specified property.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Binding { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets the value of the PropertyBinding attached DependencyProperty.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="element"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Element for which to get the property.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Value of PropertyBinding attached DependencyProperty.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SuppressMessage&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.Design"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CA1011:ConsiderPassingBaseTypesAsParameters"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        Justification = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"SetBinding is only available on FrameworkElement."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; GetPropertyBinding(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == element)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ArgumentNullException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"element"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)element.GetValue(PropertyBindingProperty);
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Sets the value of the PropertyBinding attached DependencyProperty.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="element"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Element on which to set the property.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="value"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Value forPropertyBinding attached DependencyProperty.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SuppressMessage&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.Design"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CA1011:ConsiderPassingBaseTypesAsParameters"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        Justification = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"SetBinding is only available on FrameworkElement."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetPropertyBinding(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; value)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == element)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ArgumentNullException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"element"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }
        element.SetValue(PropertyBindingProperty, value);
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; PropertyBinding attached DependencyProperty.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;readonly&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; PropertyBindingProperty =
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.RegisterAttached(
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"PropertyBinding"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;),
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;),
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyMetadata&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, OnPropertyBindingPropertyChanged));

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Change handler for the PropertyBinding attached DependencyProperty.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="d"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Object on which the property was changed.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="e"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Property change arguments.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; OnPropertyBindingPropertyChanged(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; d, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyPropertyChangedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get/validate parameters
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)d;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(e.NewValue);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == item.Property) || (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == item.Binding))
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"SetterValueBindingHelper's Property and Binding must both be set to non-null values."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the type on which to set the Binding
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; type = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == item.Type)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// No type specified; setting for the specified element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            type = element.GetType();
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Try to get the type from the type system
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            type = System.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetType(item.Type);
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == type)
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Search for the type in the list of assemblies
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; assembly &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; AssembliesToSearch)
                {
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Match on short or full name
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    type = assembly.GetTypes()
                        .Where(t =&amp;gt; (t.FullName == item.Type) || (t.Name == item.Type))
                        .FirstOrDefault();
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != type)
                    {
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Found; done searching
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;break&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
                    }
                }
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == type)
                {
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Unable to find the requested type anywhere
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Format(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.CurrentCulture,
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Unable to access type \"{0}\". Try using an assembly qualified type name."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
                        item.Type));
                }
            }
        }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the DependencyProperty for which to set the Binding
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; property = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; field = type.GetField(item.Property + &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Property"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;BindingFlags&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.FlattenHierarchy | &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;BindingFlags&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Public | &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;BindingFlags&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Static);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != field)
        {
            property = field.GetValue(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;) &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DependencyProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
        }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == property)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Unable to find the requested property
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;throw&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ArgumentException&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Format(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.CurrentCulture,
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Unable to access DependencyProperty \"{0}\" on type \"{1}\"."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
                item.Property, type.Name));
        }

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Set the specified Binding on the specified property
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        element.SetBinding(property, item.Binding);
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Returns a stream of assemblies to search for the provided type name.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assembly&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; AssembliesToSearch
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Start with the System.Windows assembly (home of all core controls)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;yield&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;typeof&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Control&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).Assembly;

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Fall back by trying each of the assemblies in the Deployment's Parts list
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;foreach&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; part &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Deployment&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Current.Parts)
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; streamResourceInfo = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Application&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetResourceStream(
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Uri&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(part.Source, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UriKind&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Relative));
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; stream = streamResourceInfo.Stream)
                {
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;yield&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; part.Load(stream);
                }
            }
        }
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9593158" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Going "extreme" with Silverlight 3 [Sharing the source code for a real-world sample application]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/05/04/going-extreme-with-silverlight-3-sharing-the-source-code-for-a-real-world-sample-application.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/05/04/going-extreme-with-silverlight-3-sharing-the-source-code-for-a-real-world-sample-application.aspx</id><published>2009-05-04T18:41:00Z</published><updated>2009-05-04T18:41:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;My teammates and I spent some time last week on an exercise known as "app building" to help identify issues with the latest build of Silverlight, the SDK, and the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;. The way app building works is that everyone comes up with an idea for a medium-sized application they think could be built with the bits at hand - then goes off and tries to build as &lt;STRONG&gt;much&lt;/STRONG&gt; of that application as they can before time runs out! &lt;/P&gt;
&lt;P&gt;The emphasis is on testing new scenarios, coming up with creative ways of integrating components, and basically just getting the same kind of experience with the framework that customers have every day. Coming up with a beautifully architected solution is nice if it happens, but &lt;STRONG&gt;not&lt;/STRONG&gt; specifically a goal here. Rather, the point is to help people take a holistic look at how everything works together - because sometimes you'll find that two things which both look good in isolation are quite difficult to use &lt;STRONG&gt;together&lt;/STRONG&gt;. App building is a great technique to use as part of the quality assurance process and the time we spent was definitely worthwhile. :) &lt;/P&gt;
&lt;P&gt;For my application, I decided to write an organizational hierarchy viewer based loosely on an internal tool managers use at Microsoft. The application offers three main ways to visualize the data: a hierarchical tree of all employees at the left, a flattened summary pane of all employees at the bottom, and a detailed view of the selected employee at the right. I also added a search feature and a simple chart for visualizing the size of someone's "empire". &lt;EM&gt;(Because I love me some &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx"&gt;Charting&lt;/A&gt;...)&lt;/EM&gt; I called my app "HeadTraxExtreme" (partly an inside joke) and here's what it looked like after the two days I spent banging it out: &lt;/P&gt;&lt;A href="http://cesso.org/Samples/HeadTraxExtreme/" mce_href="http://cesso.org/Samples/HeadTraxExtreme/"&gt;&lt;IMG height=706 alt="HeadTraxExtreme sample application" src="http://blogs.msdn.com/blogfiles/delay/HeadTraxExtreme.png" width=566 mce_src="http://blogs.msdn.com/blogfiles/delay/HeadTraxExtreme.png"&gt;&lt;/A&gt; 
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/HeadTraxExtreme/" mce_href="http://cesso.org/Samples/HeadTraxExtreme/"&gt;[If you have the Silverlight 3 Beta installed, click here (or on the image above) to run HeadTraxExtreme in your browser.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/HeadTraxExtreme/HeadTraxExtreme.zip" mce_href="http://cesso.org/Samples/HeadTraxExtreme/HeadTraxExtreme.zip"&gt;[If you want to have a look at the complete source code or build HeadTraxExtreme yourself, click here to download it.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notes: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;HeadTraxExtreme incorporates the following controls/concepts: 
&lt;UL&gt;
&lt;LI&gt;DataGrid&lt;/LI&gt;
&lt;LI&gt;DataForm&lt;/LI&gt;
&lt;LI&gt;TreeView/TreeViewItem&lt;/LI&gt;
&lt;LI&gt;AutoCompleteBox&lt;/LI&gt;
&lt;LI&gt;ComboBox&lt;/LI&gt;
&lt;LI&gt;Chart/PieSeries/PieDataPoint&lt;/LI&gt;
&lt;LI&gt;Image&lt;/LI&gt;
&lt;LI&gt;Data Binding&lt;/LI&gt;
&lt;LI&gt;Model-View-ViewModel (MVVM)&lt;/LI&gt;
&lt;LI&gt;Custom Style/Template&lt;/LI&gt;
&lt;LI&gt;Asynchronous data access&lt;/LI&gt;
&lt;LI&gt;Out-of-browser&lt;/LI&gt;
&lt;LI&gt;IValueConverter&lt;/LI&gt;
&lt;LI&gt;INotifyPropertyChanged&lt;/LI&gt;
&lt;LI&gt;XLinq&lt;/LI&gt;
&lt;LI&gt;Layout&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;
&lt;LI&gt;The employee images are downloaded from the web site of origin, so if you download and build it yourself please be sure to run HeadTraxExtreme using the included web project (&lt;CODE&gt;HeadTraxExtreme.Web&lt;/CODE&gt;) if you want to see the images. &lt;/LI&gt;
&lt;LI&gt;Because we were testing the latest (private) builds of everything, I needed to back-port my code to the official Silverlight 3 Beta bits in order to post it here. That didn't take long, but it did draw my attention to a couple of very notable improvements that have been made since the Beta bits went out. I won't say more because I don't want to ruin any surprises, but I can say that a couple of the controls will be much more pleasant to use by RTM. :) &lt;/LI&gt;
&lt;LI&gt;My original version displayed a 300+ person org, but I didn't want to publish everyone's personal data without permission. :) So I made up the &lt;STRONG&gt;completely fictional&lt;/STRONG&gt; 14 person mini-org you see above. Any resemblance to an actual org is unintentional... &lt;/LI&gt;
&lt;LI&gt;There are two aspects of HeadTraxExtreme that I plan to write more about in the next few days. In both cases, I approached something in a specific way and I'd like to highlight what I did and talk about why I thought that was a good way. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Building HeadTraxExtreme was a fun little diversion that turned up some good issues for everyone. It exposed me to a couple of controls I hadn't used yet and I'm glad to have broadened my knowledge. I think there's probably a little something for everyone here; I hope HeadTraxExtreme can be a good learning experience for others, too! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9586226" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Trying to get the story straight [A brief summary of Storyboard differences between WPF and Silverlight]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/28/trying-to-get-the-story-straight-a-brief-summary-of-storyboard-differences-between-wpf-and-silverlight.aspx</id><published>2009-04-29T06:05:00Z</published><updated>2009-04-29T06:05:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;I was investigating a &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; bug this morning and got into a spirited discussion about &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard(VS.95).aspx"&gt;Storyboard&lt;/A&gt; &lt;A href="http://msdn.microsoft.com/en-us/library/cc189019(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc189019(VS.95).aspx"&gt;behavior&lt;/A&gt; with &lt;A href="http://themechanicalbride.blogspot.com/" mce_href="http://themechanicalbride.blogspot.com/"&gt;Jafar&lt;/A&gt;. We disagreed on a couple of points, so I [grudgingly :) ] coded up a quick test application to help sort things out. Unfortunately, it turns out that the situation is a little weirder than &lt;STRONG&gt;either&lt;/STRONG&gt; of us realized... I knew I'd never be able to remember the specifics, so I'm documenting my findings here for everyone's benefit. &lt;/P&gt;&lt;IMG height=239 alt="StoryboardBehavior on WPF" src="http://blogs.msdn.com/blogfiles/delay/StoryboardBehavior-WPF.png" width=739 mce_src="http://blogs.msdn.com/blogfiles/delay/StoryboardBehavior-WPF.png"&gt; 
&lt;P&gt;At the heart of the matter is the way &lt;CODE&gt;Storyboard&lt;/CODE&gt;s fit into the &lt;A href="http://msdn.microsoft.com/en-us/library/ms743230.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms743230.aspx"&gt;Silverlight/WPF property system&lt;/A&gt;. What's generally expected is that when a &lt;CODE&gt;Storyboard&lt;/CODE&gt; is actively animating a property, the animation value takes precedence over the local value. It should still be possible to change the local value, but such changes shouldn't be visible until the &lt;A href="http://msdn.microsoft.com/en-us/library/aa970493.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa970493.aspx"&gt;Storyboard gives up control of the property&lt;/A&gt;. That said, there are a few ways in which WPF and Silverlight seem to disagree - as the following table illustrates. To help keep things clear, I've colored things green or red according to whether I believe the behavior to be correct or incorrect (respectively) based on my current understanding. (Note: All tests were performed with the default &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.fillbehavior(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.fillbehavior(VS.95).aspx"&gt;HoldEnd FillBehavior&lt;/A&gt;.) &lt;/P&gt;
&lt;TABLE class="" cellSpacing=5 cellPadding=5&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TH class=""&gt;Scenario &lt;/TH&gt;
&lt;TH class=""&gt;WPF &lt;/TH&gt;
&lt;TH class=""&gt;Silverlight 2 /&lt;BR&gt;Silverlight 3 Beta &lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #dddddd"&gt;&lt;EM&gt;[DoubleAnimation.From specified]&lt;/EM&gt; 
&lt;OL&gt;
&lt;LI&gt;Start animation from value A to value B&lt;/LI&gt;
&lt;LI&gt;Set value C during animation&lt;/LI&gt;
&lt;LI&gt;Stop animation when complete&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #bbffbb"&gt;Property has value C &lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #ffbbbb"&gt;Property has value A &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #dddddd"&gt;&lt;EM&gt;[DoubleAnimation.From specified]&lt;/EM&gt; 
&lt;OL&gt;
&lt;LI&gt;Start animation from value A to value B&lt;/LI&gt;
&lt;LI&gt;Set value C after animation completes&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #bbffbb"&gt;Property has value B &lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #ffbbbb"&gt;Property has value C &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #dddddd"&gt;&lt;EM&gt;[DoubleAnimation.From not specified]&lt;/EM&gt; 
&lt;OL&gt;
&lt;LI&gt;Start animation from value A to value B&lt;/LI&gt;
&lt;LI&gt;Set value C during animation&lt;/LI&gt;&lt;/OL&gt;&lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #ffbbbb"&gt;Animation "jitters" when value C is set &lt;/TD&gt;
&lt;TD class="" style="BACKGROUND-COLOR: #bbffbb"&gt;No "jitter" &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;You can experiment with these behaviors using the sample application I built for this purpose. It works quite simply: the width of the orange rectangle starts at 200 pixels and is changed by either animating it &lt;STRONG&gt;wider&lt;/STRONG&gt; to 300 pixels or by directly setting it &lt;STRONG&gt;narrower&lt;/STRONG&gt; to 50 pixels. The animation is performed by a 2 second &lt;CODE&gt;Storyboard&lt;/CODE&gt;, so there's plenty of time to change things during the animation. (The relevant code is included below.) &lt;/P&gt;&lt;IMG height=321 alt="StoryboardBehavior on Silverlight" src="http://blogs.msdn.com/blogfiles/delay/StoryboardBehavior-SL.png" width=739 mce_src="http://blogs.msdn.com/blogfiles/delay/StoryboardBehavior-SL.png"&gt; 
&lt;P&gt;As far as I can tell, the WPF behavior is the most correct. Granted, the animation "jitter" is visually jarring (and doesn't fit with my understanding of the property system hierarchy), but things quickly work themselves out and the final results on that platform make the most sense to me. Of course, I'll be passing all this information on to the folks who actually own this functionality and will help get bugs get opened for any behavior that turns out to be wrong. And with luck, these inconsistencies will be gone in a future release of Silverlight and/or WPF! :) &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/StoryboardBehavior/StoryboardBehavior.zip" mce_href="http://cesso.org/Samples/StoryboardBehavior/StoryboardBehavior.zip"&gt;[Click here to download the StoryboardBehavior test application source code for WPF and Silverlight.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;partial&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DemoControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UserControl
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; DemoControl()
    {
        InitializeComponent();
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetFrom { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Storyboard
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; == _storyboard)
            {
                _storyboard = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetTarget(_storyboard, Indicator);
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetTargetProperty(_storyboard, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;PropertyPath&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Width"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DoubleAnimation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; doubleAnimation = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DoubleAnimation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
                doubleAnimation.Duration = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Duration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.FromSeconds(2));
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (SetFrom)
                {
                    doubleAnimation.From = 200;
                }
                doubleAnimation.To = 300;
                _storyboard.Children.Add(doubleAnimation);
            }
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _storyboard;
        }
    }
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Storyboard&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _storyboard;

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; StartGrowingAnimation(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        Storyboard.Begin();
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; StopGrowingAnimation(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        Storyboard.Stop();
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetSmallerSize(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RoutedEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        Indicator.Width = 50;
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9575100" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>My new home page, extended [Updated collection of great Silverlight and WPF Charting resources!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/24/my-new-home-page-extended-updated-collection-of-great-silverlight-and-wpf-charting-resources.aspx</id><published>2009-04-24T07:23:00Z</published><updated>2009-04-24T07:23:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;It's been a while since the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430"&gt;March 09 release&lt;/A&gt; of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; - and even longer since I &lt;A href="http://blogs.msdn.com/delay/archive/2009/02/05/my-new-home-page-expanded-updated-collection-of-great-silverlight-charting-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/02/05/my-new-home-page-expanded-updated-collection-of-great-silverlight-charting-resources.aspx"&gt;last posted a collection of Charting links&lt;/A&gt;. It's clearly time for an update, so I've added a bunch of new links to the collection below (FYI: previously published links are gray): &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Overviews (&lt;A href="http://support.microsoft.com/default.aspx?scid=gp;en-us;WebCastLevels&amp;amp;sd=gn" mce_href="http://support.microsoft.com/default.aspx?scid=gp;en-us;WebCastLevels&amp;amp;sd=gn"&gt;100 level&lt;/A&gt;) &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://timheuer.com/blog/archive/2008/10/28/silverlight-toolkit-released-with-charting-databinding.aspx" mce_href="http://timheuer.com/blog/archive/2008/10/28/silverlight-toolkit-released-with-charting-databinding.aspx"&gt;Silverlight Toolkit Released – More controls!&lt;/A&gt; - &lt;STRONG&gt;Tim Heuer&lt;/STRONG&gt;'s &lt;EM&gt;during the PDC keynote&lt;/EM&gt; overview set the stage for good Charting content. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/10/28/Silverlight-Toolkit-_2800_Silverlight-2-Control-Pack_2900_-_2D00_-Charting.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/10/28/Silverlight-Toolkit-_2800_Silverlight-2-Control-Pack_2900_-_2D00_-Charting.aspx"&gt;Silverlight Toolkit (Silverlight 2 Control Pack) - Charting &lt;/A&gt;- &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt; followed up minutes later with another good overview. (Party trivia: The styles seen in his blog offer a rare glimpse of the pre-release Charting styles.) &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://cornucopia30.blogspot.com/2008/10/silverlight-2-introducing-chart-control.html" mce_href="http://cornucopia30.blogspot.com/2008/10/silverlight-2-introducing-chart-control.html"&gt;Silverlight 2 - Introducing the Chart Control&lt;/A&gt; - &lt;STRONG&gt;Chad Campbell&lt;/STRONG&gt; was also ready with a good "zero-day" overview and code samples. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://www.hanselman.com/blog/TheWeeklySourceCode36PDCBabySmashAndSilverlightCharting.aspx" mce_href="http://www.hanselman.com/blog/TheWeeklySourceCode36PDCBabySmashAndSilverlightCharting.aspx"&gt;The Weekly Source Code 36 - PDC, BabySmash and Silverlight Charting&lt;/A&gt; - &lt;STRONG&gt;Scott Hanselman&lt;/STRONG&gt;'s post includes a &lt;A href="http://www.babysmash.com/" mce_href="http://www.babysmash.com/"&gt;BabySmash&lt;/A&gt; tie-in and a smidge of flattery. :) &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://silverlight.net/blogs/jesseliberty/archive/2008/11/24/graphing-silverlight-toolkit.aspx" mce_href="http://silverlight.net/blogs/jesseliberty/archive/2008/11/24/graphing-silverlight-toolkit.aspx"&gt;Graphing – Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Jesse Liberty&lt;/STRONG&gt; introduces Charting and covers some of the basics. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://silverlight.net/blogs/jesseliberty/archive/2008/12/17/bubble-chart.aspx" mce_href="http://silverlight.net/blogs/jesseliberty/archive/2008/12/17/bubble-chart.aspx"&gt;Bubble chart&lt;/A&gt; - &lt;STRONG&gt;Jesse Liberty&lt;/STRONG&gt; introduces the BubbleSeries class and describes some interesting use-cases. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.sparklingclient.com/the-bubble-chart-in-the-silverlight-toolkit/" mce_href="http://www.sparklingclient.com/the-bubble-chart-in-the-silverlight-toolkit/"&gt;The Bubble Chart in the Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Sparkling Client&lt;/STRONG&gt; interviews &lt;STRONG&gt;Jesse Liberty&lt;/STRONG&gt; in this podcast discussing the BubbleSeries. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Scenarios (200 level) &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://www.sitechno.com/Blog/ZoomingIntoAChart.aspx" mce_href="http://www.sitechno.com/Blog/ZoomingIntoAChart.aspx"&gt;Zooming into a chart&lt;/A&gt; - &lt;STRONG&gt;Ruurd Boeke&lt;/STRONG&gt; did the "zooming" scenario sample for the &lt;A href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl2/toolkitcontrolsamples/run/default.html"&gt;live Charting samples page&lt;/A&gt; - here's how he did it. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://cornucopia30.blogspot.com/2008/10/silverlight-2-getting-started-with.html" mce_href="http://cornucopia30.blogspot.com/2008/10/silverlight-2-getting-started-with.html"&gt;Silverlight 2 - Getting Started with the Chart Control&lt;/A&gt; - &lt;STRONG&gt;Chad Campbell &lt;/STRONG&gt;again - a thorough walkthrough of creating your first chart. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://www.eggheadcafe.com/tutorials/aspnet/5b0c5717-2817-47a5-bd20-1bbdc0ab1240/silverlight-2-custom-stoc.aspx" mce_href="http://www.eggheadcafe.com/tutorials/aspnet/5b0c5717-2817-47a5-bd20-1bbdc0ab1240/silverlight-2-custom-stoc.aspx"&gt;Silverlight 2 Custom Stock Charts With Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Peter Bromberg&lt;/STRONG&gt; with his own walkthrough - creating a stock chart with plenty of code. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/10/31/Styling-the-Charts-in-the-Silverlight-Toolkit.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/10/31/Styling-the-Charts-in-the-Silverlight-Toolkit.aspx"&gt;Styling the Charts in the Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt; again - this time with a good styling overview for designers. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/mehdis/archive/2008/11/11/designer-s-guide-to-styling-silverlight-toolkit-charting-controls.aspx" mce_href="http://blogs.msdn.com/mehdis/archive/2008/11/11/designer-s-guide-to-styling-silverlight-toolkit-charting-controls.aspx"&gt;Designer’s Guide to Styling Silverlight Toolkit Charting Controls&lt;/A&gt; - &lt;STRONG&gt;Mehdi Slaoui Andaloussi&lt;/STRONG&gt; goes over the top with a &lt;A href="http://en.wikipedia.org/wiki/Soup_to_nuts" mce_href="http://en.wikipedia.org/wiki/Soup_to_nuts"&gt;"soup to nuts"&lt;/A&gt; designer-oriented guide to styling &lt;EM&gt;everything&lt;/EM&gt;. It probably helps that Mehdi works on my team and authored the shipping styles for Charting as well. :) &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/12/04/Pie-Chart-Styling-in-the-Silverlight-Toolkit-_2D00_-Cross_2D00_Slice-Gradients.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/12/04/Pie-Chart-Styling-in-the-Silverlight-Toolkit-_2D00_-Cross_2D00_Slice-Gradients.aspx"&gt;Pie Chart Styling in the Silverlight Toolkit - Cross-Slice Gradients&lt;/A&gt; - &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt; takes a proof-of-concept for holistic pie chart styling and uses it to &lt;EM&gt;great&lt;/EM&gt; effect. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://silverlight.net/blogs/jesseliberty/archive/2008/12/18/bubbles-1-chart-three-axes.aspx" mce_href="http://silverlight.net/blogs/jesseliberty/archive/2008/12/18/bubbles-1-chart-three-axes.aspx"&gt;Bubbles – 1 Chart – three Axes&lt;/A&gt; - &lt;STRONG&gt;Jesse Liberty&lt;/STRONG&gt; takes advantage of BubbleSeries to visualize historical data in an interesting way. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://kevindockx.blogspot.com/2008/12/customizing-labels-on-axis-of.html" mce_href="http://kevindockx.blogspot.com/2008/12/customizing-labels-on-axis-of.html"&gt;Customizing the Labels on an Axis of the Silverlight Toolkit Chart&lt;/A&gt; - &lt;STRONG&gt;Kevin Dockx&lt;/STRONG&gt; calls out the AxisLabelStyle property which allows designers to easily customize the labels of an axis. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/01/09/Dazzling-Silverlight-Toolkit-Pie-Charts-with-Overlays.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/01/09/Dazzling-Silverlight-Toolkit-Pie-Charts-with-Overlays.aspx"&gt;Dazzling Silverlight Toolkit Pie Charts with Overlays&lt;/A&gt; - &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt; continues working with pie charts and creates a further level of polish by adding some shiny overlays that make the visuals "pop". &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://www.jeff.wilcox.name/2008/12/10/charting-rich-tooltips/" mce_href="http://www.jeff.wilcox.name/2008/12/10/charting-rich-tooltips/"&gt;Silverlight Charting: Creating rich data point tooltips&lt;/A&gt; - &lt;STRONG&gt;Jeff Wilcox&lt;/STRONG&gt; shows how he customized the ToolTips of a LineSeries to show a wealth of information relevant information in a very user-friendly manner. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://silverlight.net/blogs/jesseliberty/archive/2009/01/10/pie-chart-and-column-chart-videos-post.aspx" mce_href="http://silverlight.net/blogs/jesseliberty/archive/2009/01/10/pie-chart-and-column-chart-videos-post.aspx"&gt;Pie Chart and Column Chart videos post&lt;/A&gt; - &lt;STRONG&gt;Jesse Liberty&lt;/STRONG&gt; demonstrates the use of PieSeries and ColumnSeries in a set of "How Do I" videos. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://expression.microsoft.com/en-us/dd433476.aspx" mce_href="http://expression.microsoft.com/en-us/dd433476.aspx"&gt;Styling Charts with the Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt;'s comprehensive &lt;A href="http://expression.microsoft.com/en-us/default.aspx" mce_href="http://expression.microsoft.com/en-us/default.aspx"&gt;Expression Newsletter&lt;/A&gt; article provides some of the best information available anywhere about Charting styling! &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.codeproject.com/KB/WPF/WPFSLChart.aspx" mce_href="http://www.codeproject.com/KB/WPF/WPFSLChart.aspx"&gt;Styling a Silverlight Chart&lt;/A&gt; - &lt;STRONG&gt;Rudi Grobler&lt;/STRONG&gt; shows how to re-style a LineSeries to look just like the &lt;A href="http://www.google.com/analytics/" mce_href="http://www.google.com/analytics/"&gt;Google Analytics&lt;/A&gt; charts. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://leeontech.wordpress.com/2009/02/25/linechart-with-markers/" mce_href="http://leeontech.wordpress.com/2009/02/25/linechart-with-markers/"&gt;LineChart with Markers&lt;/A&gt; - &lt;STRONG&gt;Lee&lt;/STRONG&gt; demonstrates one way of adding markers (also known as annotations or cursors) to a Chart. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://leeontech.wordpress.com/2009/03/13/showing-and-hiding-series-in-chart/" mce_href="http://leeontech.wordpress.com/2009/03/13/showing-and-hiding-series-in-chart/"&gt;Showing and Hiding Series in chart&lt;/A&gt; - &lt;STRONG&gt;Lee&lt;/STRONG&gt; neatly solves the problem of hiding (and showing) individual Series by clicking on their entries in the Legend. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://geekswithblogs.net/tkokke/archive/2009/04/01/creating-binding-and-styling-a-bubble-chart.aspx" mce_href="http://geekswithblogs.net/tkokke/archive/2009/04/01/creating-binding-and-styling-a-bubble-chart.aspx"&gt;Creating, Binding and Styling a Bubble Chart&lt;/A&gt; - &lt;STRONG&gt;Timmy Kokke&lt;/STRONG&gt; shows off how some of the new Blend 3 features can be used to completely customize the appearance of a BubbleSeries without writing any code at all. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/04/09/Custom-Bar-Charts-with-the-Silverlight-Toolkit.aspx" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/04/09/Custom-Bar-Charts-with-the-Silverlight-Toolkit.aspx"&gt;Custom Bar Charts with the Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Pete Brown&lt;/STRONG&gt; discusses how he went about dramatically customizing the appearance of two Chart types to create a very modern, polished look for a demo app. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Internals (300 level) &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://www.scottlogic.co.uk/blog/wpf/2009/02/adding-a-location-crosshair-to-silverlight-charts/" mce_href="http://www.scottlogic.co.uk/blog/wpf/2009/02/adding-a-location-crosshair-to-silverlight-charts/"&gt;Adding a Location Crosshair to Silverlight Charts&lt;/A&gt; - &lt;STRONG&gt;Colin Eberhardt&lt;/STRONG&gt; shows how to add crosshairs on top of a Chart to display the coordinates of the mouse pointer. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.scottlogic.co.uk/blog/wpf/2009/03/adding-a-location-crosshair-to-silverlight-charts-again/" mce_href="http://www.scottlogic.co.uk/blog/wpf/2009/03/adding-a-location-crosshair-to-silverlight-charts-again/"&gt;Adding a Location Crosshair to Silverlight charts (again!)&lt;/A&gt; - &lt;STRONG&gt;Colin Eberhardt&lt;/STRONG&gt; updates his crosshairs post to accommodate changes in the March 09 release. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.codeproject.com/KB/silverlight/SLTCandlestickChart2.aspx" mce_href="http://www.codeproject.com/KB/silverlight/SLTCandlestickChart2.aspx"&gt;How to create stock charts using the Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Rudi Grobler&lt;/STRONG&gt; shows how to create a custom Series type that's perfect for stock charts (open/high/low/close). &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/351/Silverlight-Charts-Binding-multiple-Series.aspx" mce_href="http://jmorrill.hjtcentral.com/Home/tabid/428/EntryId/351/Silverlight-Charts-Binding-multiple-Series.aspx"&gt;Silverlight Charts: Binding multiple Series&lt;/A&gt; - &lt;STRONG&gt;Jeremiah Morrill&lt;/STRONG&gt; shows off an attached behavior that enables binding a Chart to a "collection of collections" to create an arbitrary number of series automatically. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://leeontech.wordpress.com/2009/03/02/interacting-with-charts/" mce_href="http://leeontech.wordpress.com/2009/03/02/interacting-with-charts/"&gt;Interacting with Charts&lt;/A&gt; - &lt;STRONG&gt;Lee&lt;/STRONG&gt; implements a nice interactive range selection behavior to create a friendly "zoom" feature for controlling the Axis range. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Jafar Husain's posts (Partner level) &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://themechanicalbride.blogspot.com/2008/10/building-observable-model-in.html" mce_href="http://themechanicalbride.blogspot.com/2008/10/building-observable-model-in.html"&gt;Building an Observable Model in Silverlight&lt;/A&gt; - Some deep, technical detail about the observable model that Charting uses to enable its rich dynamic data support. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://themechanicalbride.blogspot.com/2009/03/writing-your-own-silverlight-chart.html" mce_href="http://themechanicalbride.blogspot.com/2009/03/writing-your-own-silverlight-chart.html"&gt;Writing Your Own Silverlight Chart Series (Part 1): Making Designers Happy&lt;/A&gt; - An overview of what it takes to create a new Series type and some scaffolding for an &lt;A href="http://en.wikipedia.org/wiki/OHLC" mce_href="http://en.wikipedia.org/wiki/OHLC"&gt;OHLC&lt;/A&gt; Series. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://themechanicalbride.blogspot.com/2009/03/writing-your-own-silverlight-chart_25.html" mce_href="http://themechanicalbride.blogspot.com/2009/03/writing-your-own-silverlight-chart_25.html"&gt;Writing Your Own Silverlight Chart Series (Part 2): Implementing the Series&lt;/A&gt; - All that it takes to completely implement a custom chart type using only the public interfaces! &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;My posts (Ego level) &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/10/28/announcing-a-free-open-source-charting-solution-for-silverlight-silverlight-toolkit-released-today-at-pdc.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/10/28/announcing-a-free-open-source-charting-solution-for-silverlight-silverlight-toolkit-released-today-at-pdc.aspx"&gt;Announcing a free, open source Charting solution for Silverlight [Silverlight Toolkit released today at PDC!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/10/29/click-your-way-to-great-silverlight-charts-live-chartbuilder-sample-and-source-code.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/10/29/click-your-way-to-great-silverlight-charts-live-chartbuilder-sample-and-source-code.aspx"&gt;Click your way to great Silverlight charts [Live ChartBuilder sample and source code!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/11/06/improving-chartbuilder-s-cultural-sensitivity-chartbuilder-app-source-updated.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/11/06/improving-chartbuilder-s-cultural-sensitivity-chartbuilder-app-source-updated.aspx"&gt;Improving ChartBuilder's cultural sensitivity [ChartBuilder app/source updated!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/12/09/silverlight-charting-gets-a-host-of-improvements-silverlight-toolkit-december-08-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/12/09/silverlight-charting-gets-a-host-of-improvements-silverlight-toolkit-december-08-release-now-available.aspx"&gt;Silverlight Charting gets a host of improvements [Silverlight Toolkit December 08 release now available!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/12/10/great-silverlight-charts-are-still-just-a-click-away-chartbuilder-sample-and-source-code-updated-for-charting-s-december-08-release.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/12/10/great-silverlight-charts-are-still-just-a-click-away-chartbuilder-sample-and-source-code-updated-for-charting-s-december-08-release.aspx"&gt;Great Silverlight charts are still just a click away [ChartBuilder sample and source code updated for Charting's December 08 release]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2008/12/30/yummier-pies-a-technique-for-more-flexible-gradient-styling-of-silverlight-toolkit-pie-charts.aspx" mce_href="http://blogs.msdn.com/delay/archive/2008/12/30/yummier-pies-a-technique-for-more-flexible-gradient-styling-of-silverlight-toolkit-pie-charts.aspx"&gt;Yummier pies! [A technique for more flexible gradient styling of Silverlight Toolkit pie charts]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/02/04/columns-of-a-different-color-customizing-the-appearance-of-silverlight-charts-with-re-templating-and-mvvm.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/02/04/columns-of-a-different-color-customizing-the-appearance-of-silverlight-charts-with-re-templating-and-mvvm.aspx"&gt;Columns of a different color [Customizing the appearance of Silverlight charts with re-templating and MVVM]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/19/silverlight-charting-is-faster-and-better-than-ever-silverlight-toolkit-march-09-release-now-available.aspx"&gt;Silverlight Charting is faster and better than ever [Silverlight Toolkit March 09 release now available!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/20/silverlight-charting-remains-just-a-click-away-and-runs-on-wpf-too-chartbuilder-sample-and-source-code-updated-for-charting-s-march-09-release.aspx"&gt;Silverlight Charting remains just a click away - and runs on WPF, too!! [ChartBuilder sample and source code updated for Charting's March 09 release]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/03/25/supporting-the-unsupported-two-fixes-for-the-unofficial-wpf-charting-assembly.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/25/supporting-the-unsupported-two-fixes-for-the-unofficial-wpf-charting-assembly.aspx"&gt;Supporting the unsupported [Two fixes for the unofficial WPF Charting assembly!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx"&gt;If they can build it, they will come... [Enabling anyone to compile WPF Charting from the Silverlight Charting sources!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/04/22/another-round-of-un-support-quick-fix-for-the-unofficial-wpf-charting-assembly.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/22/another-round-of-un-support-quick-fix-for-the-unofficial-wpf-charting-assembly.aspx"&gt;Another round of (un)support [Quick fix for the unofficial WPF Charting assembly!]&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Many, many thanks to everyone who has spent time helping others learn how to use Silverlight/WPF Charting! &lt;/P&gt;
&lt;P&gt;PS - If I've missed any good resources, please leave a comment with a link - I'm always happy to find more quality Charting content! :) &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9566224" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Another round of (un)support [Quick fix for the unofficial WPF Charting assembly!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/22/another-round-of-un-support-quick-fix-for-the-unofficial-wpf-charting-assembly.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/22/another-round-of-un-support-quick-fix-for-the-unofficial-wpf-charting-assembly.aspx</id><published>2009-04-22T07:11:00Z</published><updated>2009-04-22T07:11:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;When I updated my &lt;A href="http://cesso.org/Samples/ChartBuilder/" mce_href="http://cesso.org/Samples/ChartBuilder/"&gt;ChartBuilder sample/application/learning tool&lt;/A&gt; for the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=20430"&gt;March 09 release&lt;/A&gt; of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; a few weeks ago, I included an &lt;STRONG&gt;unofficial&lt;/STRONG&gt; build of the Silverlight Charting assembly for WPF. Despite my warning that WPF Charting was completely untested, I nevertheless hoped that some of you would give WPF Charting a try - and you didn't let me down. :) Two significant &lt;STRONG&gt;WPF-only&lt;/STRONG&gt; issues came up pretty quickly, and &lt;A href="http://blogs.msdn.com/delay/archive/2009/03/25/supporting-the-unsupported-two-fixes-for-the-unofficial-wpf-charting-assembly.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/25/supporting-the-unsupported-two-fixes-for-the-unofficial-wpf-charting-assembly.aspx"&gt;I responded by fixing them and publishing an updated build of the WPF Charting assembly&lt;/A&gt; - along with sharing &lt;A href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/26/if-they-can-build-it-they-will-come-enabling-anyone-to-compile-wpf-charting-from-the-silverlight-charting-sources.aspx"&gt;the files and steps for anyone to build the WPF Charting assembly themselves&lt;/A&gt;! &lt;/P&gt;
&lt;P&gt;Things were pretty quiet on the WPF Charting front until recently when &lt;A href="http://silverlight.net/forums/t/88715.aspx" mce_href="http://silverlight.net/forums/t/88715.aspx"&gt;forum user giggs123 reported seeing an exception when handling the &lt;CODE&gt;SelectionChanged&lt;/CODE&gt; event of a &lt;CODE&gt;DataPointSeries&lt;/CODE&gt; class&lt;/A&gt;. I investigated and discovered that the WPF-only &lt;CODE&gt;SelectionChangedEvent&lt;/CODE&gt; was handled incorrectly. :( While &lt;CODE&gt;SelectionChanged&lt;/CODE&gt; is a normal &lt;A href="http://msdn.microsoft.com/en-us/library/17sde2xt.aspx" mce_href="http://msdn.microsoft.com/en-us/library/17sde2xt.aspx"&gt;.NET event&lt;/A&gt; on Silverlight (because that's all that's supported), it is a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.routedevent.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.routedevent.aspx"&gt;RoutedEvent&lt;/A&gt; on WPF. Except that it was hooked up wrong and caused an exception if it was raised when something was listening for it... (Fortunately, handling selection is a relatively uncommon scenario, so this probably wouldn't affect most of you. And, incidentally, the reason I didn't catch it with WPF ChartBuilder is that raising the event works just fine when nothing's listening for it!) &lt;/P&gt;
&lt;P&gt;Long story short, I replied on the forum with a simple patch to the code - then went ahead and made the full fix and checked it into our version control system for inclusion with the next release of Charting. I've updated the WPF Charting assembly in the ChartBuilder download to include this fix (along with the previous two), so if you're already playing around with WPF Charting, please take a moment to upgrade to the new version of &lt;CODE&gt;System.Windows.Controls.DataVisualization.Toolkit.dll&lt;/CODE&gt; from the ChartBuilder download link below. And if you're building WPF Charting for yourself, you'll be happy to know that I've also updated the code in the &lt;CODE&gt;Controls.DataVisualization.Toolkit.WPF.zip&lt;/CODE&gt; archive to include the latest changes. :) &lt;/P&gt;
&lt;P&gt;Again, I'd like to stress that &lt;STRONG&gt;none&lt;/STRONG&gt; of these problems is present in Silverlight Charting; they exist &lt;STRONG&gt;only&lt;/STRONG&gt; in the unofficially available WPF Charting bits and are there because we did no testing on WPF due to a lack of time or resources. If you don't care about WPF Charting, then none of this matters to you; there are &lt;STRONG&gt;no&lt;/STRONG&gt; other changes to the files in the downloads. &lt;/P&gt;
&lt;P&gt;Thanks again to everyone who has used WPF Charting and reported issues to us - we appreciate your help and patience! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/ChartBuilder/ChartBuilder.zip" mce_href="http://cesso.org/Samples/ChartBuilder/ChartBuilder.zip"&gt;[Please click here to download the complete ChartBuilder source code and the ready-to-use WPF Charting assembly (don't forget to reference WPFToolkit.dll, too).]&lt;/A&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/Controls.DataVisualization.Toolkit.WPF/Controls.DataVisualization.Toolkit.WPF.zip" mce_href="http://cesso.org/Samples/Controls.DataVisualization.Toolkit.WPF/Controls.DataVisualization.Toolkit.WPF.zip"&gt;[Please click here to download &lt;CODE&gt;Controls.DataVisualization.Toolkit.WPF.zip&lt;/CODE&gt; to build WPF Charting yourself.]&lt;/A&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;IMG height=670 alt="ChartBuilder on WPF" src="http://blogs.msdn.com/blogfiles/delay/ChartBuilder-Mar09-WPF.png" width=681 mce_src="http://blogs.msdn.com/blogfiles/delay/ChartBuilder-Mar09-WPF.png"&gt; &lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9561542" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>Fewer gotchas to getcha [Enhancing the ScrollIntoViewCentered method for WPF's ListBox]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/19/fewer-gotchas-to-getcha-enhancing-the-scrollintoviewcentered-method-for-wpf-s-listbox.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/19/fewer-gotchas-to-getcha-enhancing-the-scrollintoviewcentered-method-for-wpf-s-listbox.aspx</id><published>2009-04-20T06:23:00Z</published><updated>2009-04-20T06:23:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Earlier this month &lt;A href="http://blogs.msdn.com/delay/archive/2009/03/30/don-t-let-the-gotchas-getcha-adding-the-scrollintoviewcentered-method-to-wpf-s-listbox.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/03/30/don-t-let-the-gotchas-getcha-adding-the-scrollintoviewcentered-method-to-wpf-s-listbox.aspx"&gt;I blogged about adding the ScrollIntoViewCentered method to WPF's ListBox control&lt;/A&gt;. At the time, I explained why it was necessary to set &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.cancontentscroll.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.cancontentscroll.aspx"&gt;&lt;CODE&gt;ScrollViewer.CanContentScroll&lt;/CODE&gt;&lt;/A&gt; to &lt;CODE&gt;False&lt;/CODE&gt; for the code I'd written to function. The limitation didn't matter for my scenario, so I didn't spend too much time worrying about it then... &lt;/P&gt;
&lt;P&gt;However, after putting the code into use for my &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/03/if-you-could-have-this-would-you-even-want-it-playing-around-with-writing-a-flexible-source-control-repository-browser-in-wpf.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/03/if-you-could-have-this-would-you-even-want-it-playing-around-with-writing-a-flexible-source-control-repository-browser-in-wpf.aspx"&gt;RepositoryExplorer version control system browser side-project&lt;/A&gt;, I discovered a bug. And further investigation proved that it wasn't a bug in &lt;STRONG&gt;my&lt;/STRONG&gt; code - it was a bug in &lt;STRONG&gt;WPF&lt;/STRONG&gt;! Specifically, setting &lt;CODE&gt;ScrollViewer.CanContentScroll&lt;/CODE&gt;&lt;/A&gt; to &lt;CODE&gt;False&lt;/CODE&gt; for a &lt;CODE&gt;ListBox&lt;/CODE&gt; with a horizontal &lt;CODE&gt;ScrollBar&lt;/CODE&gt; breaks the Page Down key under most circumstances. (FYI, I've already reported this issue to the WPF team to fix in a future release.) Here's a complete demonstration of the problem: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ListBox
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ItemsSource&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="{&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Fonts&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;SystemFontFamilies&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ScrollViewer.CanContentScroll&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="False"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ScrollViewer.HorizontalScrollBarVisibility&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Visible"/&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Just paste that XAML in a new application (or &lt;A href="http://msdn.microsoft.com/en-us/library/ms742398.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms742398.aspx"&gt;XamlPad&lt;/A&gt;), run it, and try to Page Down through the items in the list - you'll find that instead of advancing a &lt;STRONG&gt;page&lt;/STRONG&gt; each time you press Page Down, the list advances only a single &lt;STRONG&gt;line&lt;/STRONG&gt;. Specifically, the problem seems to occur if the bottom-most item in the &lt;CODE&gt;ListBox&lt;/CODE&gt; can hide completely behind the horizontal &lt;CODE&gt;ScrollBar&lt;/CODE&gt; - which it &lt;STRONG&gt;does&lt;/STRONG&gt; for the default font size of a WPF application. :( &lt;/P&gt;
&lt;P&gt;This bug is pretty bad and I didn't see a clean way of working around it, so I decided to revisit my &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt; implementation to see if there was some way I could get it working with &lt;CODE&gt;ScrollViewer.CanContentScroll&lt;/CODE&gt;&lt;/A&gt; set to &lt;CODE&gt;True&lt;/CODE&gt;... &lt;/P&gt;
&lt;P&gt;And as luck would have it, I managed to do so! Scroll down to find an updated version of &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt; that works well with &lt;STRONG&gt;both&lt;/STRONG&gt; settings. I've also updated the sample application to show &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt; working with a &lt;CODE&gt;ListBox&lt;/CODE&gt; where &lt;CODE&gt;ScrollViewer.CanContentScroll&lt;/CODE&gt;&lt;/A&gt; is &lt;CODE&gt;False&lt;/CODE&gt; (left; same as before) and another where it is &lt;CODE&gt;True&lt;/CODE&gt; (right; new scenario). I've forced the horizontal &lt;CODE&gt;ScrollBar&lt;/CODE&gt; on for both scenarios so you can see the broken Page Down behavior in the first one. &lt;/P&gt;&lt;IMG alt="ListBoxExtensionsDemo sample" src="http://blogs.msdn.com/blogfiles/delay/ListBoxExtensionsDemo-2.png" width=300 height=300 mce_src="http://blogs.msdn.com/blogfiles/delay/ListBoxExtensionsDemo-2.png"&gt; 
&lt;P&gt;There's just one thing to keep in mind: when using logical scrolling (item-based), WPF deals with item indices rather than pixel sizes for all of the items. The &lt;STRONG&gt;good&lt;/STRONG&gt; news is that logical scrolling is noticeably faster than physical scrolling (pixel-based), so the new support for it by &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt; allows you to use the faster scrolling option. However, the &lt;STRONG&gt;bad&lt;/STRONG&gt; news is that the calculations &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt; does for logical scrolling assume that all the items in the list are the same size. While this is nearly always the case with &lt;CODE&gt;ListBox&lt;/CODE&gt; items, it doesn't &lt;STRONG&gt;need&lt;/STRONG&gt; to be. So please consider the tradeoffs when choosing how you use &lt;CODE&gt;ScrollIntoViewCentered&lt;/CODE&gt;. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://delay.members.winisp.net/ListBoxExtensionsDemo/ListBoxExtensionsDemo.zip" mce_href="http://delay.members.winisp.net/ListBoxExtensionsDemo/ListBoxExtensionsDemo.zip"&gt;[Click here to download the source code for ScrollIntoViewCentered and the ListBoxExtensionsDemo sample application.]&lt;/A&gt;&lt;/STRONG&gt; &lt;/P&gt;
&lt;P&gt;Happy (more flexible) scrolling! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Class implementing helpful extensions to ListBox.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ListBoxExtensions
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Causes the object to scroll into view centered.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="listBox"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;ListBox instance.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="item"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Object to scroll.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SuppressMessage&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Microsoft.Design"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"CA1011:ConsiderPassingBaseTypesAsParameters"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        Justification = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Deliberately targeting ListBox."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)]
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ScrollIntoViewCentered(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ListBox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; listBox, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Debug&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Assert(!&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;VirtualizingStackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetIsVirtualizing(listBox),
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"VirtualizingStackPanel.IsVirtualizing must be disabled for ScrollIntoViewCentered to work."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the container for the specified item
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; container = listBox.ItemContainerGenerator.ContainerFromItem(item) &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != container)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollViewer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetCanContentScroll(listBox))
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the parent IScrollInfo
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; scrollInfo = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;VisualTreeHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetParent(container) &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IScrollInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != scrollInfo)
                {
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Need to know orientation, so parent must be a known type
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; stackPanel = scrollInfo &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;StackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; virtualizingStackPanel = scrollInfo &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;VirtualizingStackPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Debug&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Assert((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != stackPanel) || (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != virtualizingStackPanel),
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"ItemsPanel must be a StackPanel or VirtualizingStackPanel for ScrollIntoViewCentered to work."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);

                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the container's index
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; index = listBox.ItemContainerGenerator.IndexFromContainer(container);

                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Center the item by splitting the extra space
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != stackPanel) &amp;amp;&amp;amp; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Horizontal == stackPanel.Orientation)) ||
                        ((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != virtualizingStackPanel) &amp;amp;&amp;amp; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Horizontal == virtualizingStackPanel.Orientation)))
                    {
                        scrollInfo.SetHorizontalOffset(index - &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Floor(scrollInfo.ViewportWidth / 2));
                    }
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    {
                        scrollInfo.SetVerticalOffset(index - &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Floor(scrollInfo.ViewportHeight / 2));
                    }
                }
            }
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;else
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the bounds of the item container
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; rect = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Rect&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Point&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(), container.RenderSize);

                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Find constraining parent (either the nearest ScrollContentPresenter or the ListBox itself)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; constrainingParent = container;
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;do
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                {
                    constrainingParent = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;VisualTreeHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetParent(constrainingParent) &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;as&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FrameworkElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
                } &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != constrainingParent) &amp;amp;&amp;amp;
                         (listBox != constrainingParent) &amp;amp;&amp;amp;
                         !(constrainingParent &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;is&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollContentPresenter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));

                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; != constrainingParent)
                {
                    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Inflate rect to fill the constraining parent
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                    rect.Inflate(
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Max((constrainingParent.ActualWidth - rect.Width) / 2, 0),
                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Max((constrainingParent.ActualHeight - rect.Height) / 2, 0));
                }

                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Bring the (inflated) bounds into view
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                container.BringIntoView(rect);
            }
        }
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9556292" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><title>Comma quibbling a la Eric and Jafar [A slightly wacky approach to the problem in C#]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/16/comma-quibbling-a-la-eric-and-jafar-a-slightly-wacky-approach-to-the-problem-in-c.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/16/comma-quibbling-a-la-eric-and-jafar-a-slightly-wacky-approach-to-the-problem-in-c.aspx</id><published>2009-04-16T23:29:00Z</published><updated>2009-04-16T23:29:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Jafar was teasing me about &lt;A href="http://themechanicalbride.blogspot.com/2009/04/f-solution-to-eric-lippert-challenge.html" mce_href="http://themechanicalbride.blogspot.com/2009/04/f-solution-to-eric-lippert-challenge.html"&gt;his F# solution&lt;/A&gt; to &lt;A href="http://blogs.msdn.com/ericlippert/archive/2009/04/15/comma-quibbling.aspx" mce_href="http://blogs.msdn.com/ericlippert/archive/2009/04/15/comma-quibbling.aspx"&gt;Eric Lippert's comma quibbling problem&lt;/A&gt;, and I decided to retaliate. :) One of the things I didn't like about the five-or-so solutions I'd seen [including Jafar's :P ] was that they were doing a bunch of work to detect special cases on &lt;STRONG&gt;every&lt;/STRONG&gt; pass through the loop. That seemed silly to me because there are really only two special cases and they only come into play at the very &lt;STRONG&gt;end&lt;/STRONG&gt; of the operation. &lt;/P&gt;
&lt;P&gt;So I threw together the following method which has a fairly efficient inner loop which saves the special cases for the end. I also made it generic so it'll take an input stream of &lt;STRONG&gt;any&lt;/STRONG&gt; type - then defer to &lt;CODE&gt;StringBuilder&lt;/CODE&gt; (or the object itself!) for proper formatting. Oh, and the code is both &lt;STRONG&gt;compact&lt;/STRONG&gt; and &lt;STRONG&gt;commented&lt;/STRONG&gt;. :) &lt;/P&gt;
&lt;P&gt;The downside - and it's a &lt;STRONG&gt;big&lt;/STRONG&gt; one - is that the input stream is enumerated three times instead of just one. :( &lt;/P&gt;
&lt;P&gt;Oh well, when you're out for a quick bit of revenge you can't accomplish &lt;STRONG&gt;everything&lt;/STRONG&gt;... :) &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Solve comma quibbling posed by Eric Lippert at:
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; http://blogs.msdn.com/ericlippert/archive/2009/04/15/comma-quibbling.aspx.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;typeparam name="T"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Type of input.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/typeparam&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="input"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Stream of input elements (ex: string).&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;returns&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Quibbled string.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/returns&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;remarks&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Good points:
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; * Generic type support (StringBuilder formats for output)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; * Special-case logic is not run every time through the loop
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Bad points:
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; * Input stream is traversed three times :(
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/remarks&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; CommaQuibbling&amp;lt;T&amp;gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IEnumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;T&amp;gt; input)
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Capture stream
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; a = input.GetEnumerator();
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; b = input.Skip(1).GetEnumerator();
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; c = input.Skip(2).GetEnumerator();
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Prefix the result
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sb = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;new&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;StringBuilder&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"{"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Process the "normal" leading elements
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (c.MoveNext() &amp;amp;&amp;amp; b.MoveNext() &amp;amp;&amp;amp; a.MoveNext())
    {
        sb.Append(a.Current).Append(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;", "&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    }
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Process the non-Oxford comma scenario
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (b.MoveNext() &amp;amp;&amp;amp; a.MoveNext())
    {
        sb.Append(a.Current).Append(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;" and "&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    }
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Process the remaining element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (a.MoveNext())
    {
        sb.Append(a.Current);
    }
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Postfix the result and return it
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sb.Append(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;).ToString();
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9553599" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /></entry><entry><title>If one proxy is good, two must be better [Socks5to4a gives your SOCKS 4a proxy a free upgrade!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/04/15/if-one-proxy-is-good-two-must-be-better-socks5to4a-gives-your-socks-4a-proxy-a-free-upgrade.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/04/15/if-one-proxy-is-good-two-must-be-better-socks5to4a-gives-your-socks-4a-proxy-a-free-upgrade.aspx</id><published>2009-04-15T19:21:00Z</published><updated>2009-04-15T19:21:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;I occasionally find myself on a particular network that's separated from the rest of the Internet by a &lt;A href="http://en.wikipedia.org/wiki/Firewall" mce_href="http://en.wikipedia.org/wiki/Firewall"&gt;firewall&lt;/A&gt;. The administrators of this network are kind enough to provide both HTTP and SOCKS 4a &lt;A href="http://en.wikipedia.org/wiki/Proxy_server" mce_href="http://en.wikipedia.org/wiki/Proxy_server"&gt;proxy servers&lt;/A&gt;, so it's generally quite easy to get access to the Internet in spite of the firewall. Unfortunately, a couple of the programs I use from time to time support only the SOCKS &lt;STRONG&gt;5&lt;/STRONG&gt; protocol which is &lt;STRONG&gt;not&lt;/STRONG&gt; backwards compatible with the SOCKS &lt;STRONG&gt;4a&lt;/STRONG&gt; protocol... &lt;/P&gt;
&lt;P&gt;Well, after bumping into this problem again recently, I checked the &lt;A href="http://en.wikipedia.org/wiki/SOCKS" mce_href="http://en.wikipedia.org/wiki/SOCKS"&gt;SOCKS specifications on Wikipedia&lt;/A&gt; and decided it would be pretty straightforward to write a SOCKS 5 proxy server that forwarded all its traffic to a SOCKS 4a proxy server to do the real work. There's just not that much &lt;STRONG&gt;to&lt;/STRONG&gt; a proxy server - especially when you're only interested in supporting &lt;A href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol" mce_href="http://en.wikipedia.org/wiki/Transmission_Control_Protocol"&gt;TCP/IP&lt;/A&gt; streams and aren't hoping for production-quality code. :) &lt;/P&gt;
&lt;P&gt;So I dashed off a program called Socks5to4a that does exactly what I envisioned. I just run it on my machine, tell it how to connect to the network's SOCKS 4a server, and point my SOCKS 5 applications at &lt;CODE&gt;localhost&lt;/CODE&gt;. The programs all think they're talking to a real SOCKS 5 server and the network's SOCKS 4a server thinks it's talking to a real SOCKS 4a client - and they're &lt;STRONG&gt;almost&lt;/STRONG&gt; right! &lt;/P&gt;
&lt;P&gt;With Socks5to4a, things couldn't be simpler - here's what it looks like in action: &lt;/P&gt;&lt;PRE&gt;D:\T&amp;gt;Socks5to4a myproxy 1080 fallback.example.com
0: Listening on localhost:1080 with fall-back to fallback.example.com...
1: Accepted connection.
1: Reading client request...
1: Client requests fallback.example.com:1234.
1: Connecting to proxy...
1: Connected.
1: Forwarding request...
1: Connected.
1: Sending response...
1: Proxying data...
2: Accepted connection.
2: Reading client request...
2: Client requests fallback.example.com:1234.
2: Connecting to proxy...
2: Connected.
2: Forwarding request...
2: Connected.
2: Sending response...
2: Proxying data...
3: Accepted connection.
3: Reading client request...
3: Client requests 192.168.1.6:2345.
3: Connecting to proxy...
3: Connected.
3: Forwarding request...
3: Connect failed.
3: Retrying with fallback.example.com:2345...
3: Connected.
3: Sending response...
3: Proxying data...
3: Connection closed.
1: Connection closed.
2: Connection closed.
&lt;/PRE&gt;
&lt;P&gt;If you paid close attention to the above trace, you probably noticed the "fall-back" behavior. What's going on is that one of the applications I use connects to a server that &lt;A href="http://en.wikipedia.org/wiki/192.168.1.1" mce_href="http://en.wikipedia.org/wiki/192.168.1.1"&gt;misreports its public IP address&lt;/A&gt; - so subsequent attempts to connect to that IP fail. What I did is add a bit of smarts to Socks5to4a so I can specify an optional fall-back server when I run it; and then any connection failures are automatically (and seamlessly) retried using the fall-back server. Because the fall-back server is used &lt;STRONG&gt;only&lt;/STRONG&gt; when necessary, this &lt;A href="http://en.wikipedia.org/wiki/Kludge" mce_href="http://en.wikipedia.org/wiki/Kludge"&gt;kludge&lt;/A&gt; stays out of the way until it's needed. At which point it's elegant and icky at the same time... :) &lt;/P&gt;
&lt;P&gt;Socks5to4a is something I wrote to solve a specific problem I was having - but if it's interesting to you, please go ahead and have a look or give it a try. However, please remember that I specifically did &lt;STRONG&gt;not&lt;/STRONG&gt; set out to create the world's best or fastest SOCKS 5 server - the code I wrote works well enough for my scenarios, but may need a bit of tweaking for yours. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/Socks5to4a/Socks5to4a.zip" mce_href="http://cesso.org/Samples/Socks5to4a/Socks5to4a.zip"&gt;[Click here to download the Socks5to4a application along with its complete source code.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Happy proxying! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9551229" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /></entry></feed>