<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Delay's Blog : Silverlight</title><link>http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx</link><description>Tags: Silverlight</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Wrap music [A more flexible balanced WrapPanel implementation for Silverlight and WPF!]</title><link>http://blogs.msdn.com/delay/archive/2009/12/13/wrap-music-a-more-flexible-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx</link><pubDate>Mon, 14 Dec 2009 07:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9936399</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9936399.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9936399</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/12/08/that-s-a-wrappanel-and-i-am-outta-here-a-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/12/08/that-s-a-wrappanel-and-i-am-outta-here-a-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx"&gt;In my last post&lt;/A&gt;, I told the story of a customer who asked for an easy way to make the Silverlight/WPF &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.aspx"&gt;WrapPanel&lt;/A&gt; use all available space to spread its children out evenly instead of bunching them up together. The following sample shows off the default WrapPanel behavior on top - and my alternate &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; behavior on the bottom: &lt;/P&gt;&lt;IMG alt="BalancedWrapPanel, Horizontal, ItemWidth and ItemHeight set" src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalWidth.png" width=386 height=390 mce_src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalWidth.png"&gt; 
&lt;P&gt;The default &lt;CODE&gt;WrapPanel&lt;/CODE&gt; behavior fills each horizontal (or vertical) line as much as it can before moving on to the next line, but leaves any extra space at the end of each line. &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; began as a copy of the WrapPanel code (available as part of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;) and contains a modified copy of one of the helper methods that instead distributes the unsightly chunk of extra space evenly through the entire column (or row). That was what I set out to do with &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt;, so I was fairly happy with the results. Unfortunately, the customer wasn't 100% satisfied... &lt;/P&gt;
&lt;P&gt;In particular, the desire was for those items in the last line to align with the items above instead of centering like they do in my initial implementation. It's a perfectly reasonable request - and something I thought about when I first started on &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt;! But things are a little tricky because those orderly columns only show up when the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemwidth.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemwidth.aspx"&gt;ItemWidth&lt;/A&gt; and/or &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemheight.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemheight.aspx"&gt;ItemHeight&lt;/A&gt; properties are set. In fact, the &lt;CODE&gt;WrapPanel&lt;/CODE&gt; code doesn't actually have any concept of columns at all! Rather, the columns you see are a natural consequence of the algorithm laying out lots of constant-width items within constant-width bounds. So the columns are very real, but the code doesn't really know anything about them. And they don't even exist when &lt;CODE&gt;ItemWidth&lt;/CODE&gt;/&lt;CODE&gt;ItemHeight&lt;/CODE&gt; aren't set; despite each column of this vertically-oriented &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; being vertically balanced, there are no overall rows in the horizontal direction because all the elements are different sizes: &lt;/P&gt;&lt;IMG alt="BalancedWrapPanel, Vertical, ItemWidth and ItemHeight not set" src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-VerticalNan.png" width=340 height=349 mce_src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-VerticalNan.png"&gt; 
&lt;P&gt;When I was first thinking about this scenario, it seemed to me that I'd need to add some code to track the columns and then do things differently for the last line in order to keep everything aligned properly. I was afraid this additional code would overly complicate the original sample, and decided not to implement it until and unless someone asked. Besides, it's called &lt;CODE&gt;&lt;STRONG&gt;Balanced&lt;/STRONG&gt;WrapPanel&lt;/CODE&gt;, so it seemed natural that everything should be balanced! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P&gt;But now that I had a specific request, I thought more carefully and realized that not only was it easy to align the last items, but that it was also a tad more efficient to do so! I didn't want to change the current behavior of &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; (because I think that's what people expect), but I wanted to enable the new aligning behavior, too. So I added a new property to align the last items, but it only works when &lt;CODE&gt;ItemWidth&lt;/CODE&gt;/&lt;CODE&gt;ItemHeight&lt;/CODE&gt; are set (otherwise it has no effect because items can be all different sizes and don't line up to begin with). I considered trying to explain this technicality in the name of the new property, but everything I came up with was long and cumbersome. So the new property is simply named &lt;CODE&gt;AlignLastItems&lt;/CODE&gt; - setting it to &lt;CODE&gt;True&lt;/CODE&gt; changes the first example to look like this instead: &lt;/P&gt;&lt;IMG alt="BalancedWrapPanel, Horizontal, ItemWidth and ItemHeight set, AlignLastItems set" src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalAlign.png" width=386 height=376 mce_src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalAlign.png"&gt; 
&lt;P&gt;Notice how the basic &lt;CODE&gt;WrapPanel&lt;/CODE&gt; behavior is maintained, but the items are spread out evenly and there are no gaping holes. And there you have it - a balanced &lt;CODE&gt;WrapPanel&lt;/CODE&gt; implementation that should work for most common scenarios. What's more, the customer is satisfied and maybe other folks will start using &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; in their projects, too! &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/BalancedWrapPanel/BalancedWrapPanel.zip" mce_href="http://cesso.org/Samples/BalancedWrapPanel/BalancedWrapPanel.zip"&gt;Click here to download the source code for BalancedWrapPanel and the Silverlight/WPF demo application.&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;PS&lt;/STRONG&gt; - Please refer to &lt;A href="http://blogs.msdn.com/delay/archive/2009/12/08/that-s-a-wrappanel-and-i-am-outta-here-a-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/12/08/that-s-a-wrappanel-and-i-am-outta-here-a-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx"&gt;my previous BalancedWrapPanel post&lt;/A&gt; for information about why I coded it like I did along with some other details. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PPS&lt;/STRONG&gt; - As I mention above, the changes from what I'd already written were surprisingly minimal. Other than adding the &lt;CODE&gt;AlignLastItems&lt;/CODE&gt; DependencyProperty, the only differences are highlighted below: &lt;/P&gt;&lt;PRE&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ArrangeLine(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lineStart, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lineEnd, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;? directDelta, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; directMaximum, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; indirectOffset, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; indirectGrowth)
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; o = Orientation;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; isHorizontal = o == &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Horizontal;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElementCollection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; children = Children;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; directLength = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a52a2a"&gt;0.0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;    double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; itemCount = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a52a2a"&gt;0.0&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; itemLength = isHorizontal ? ItemWidth : ItemHeight;

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (AlignLastItems &amp;amp;&amp;amp; !itemLength.IsNaN())
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Length is easy to calculate in this case
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        itemCount = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Math&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Floor(directMaximum / itemLength);
        directLength = itemCount * itemLength;
    }
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;else&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Make first pass to calculate the slack space
&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #000000"&gt;        itemCount = lineEnd - lineStart;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;
        for&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; index = lineStart; index &amp;lt; lineEnd; index++)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the size of the element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element = children[index];
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; elementSize = &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;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(o, element.DesiredSize.Width, element.DesiredSize.Height);

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine if we should use the element's desired size or the
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// fixed item width or height
&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; directGrowth = directDelta != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ?
                directDelta.Value :
                elementSize.Direct;

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Update total length
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            directLength += directGrowth;
        }
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine slack
&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; directSlack = directMaximum - directLength;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; directSlackSlice = directSlack / (&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;itemCount&lt;/SPAN&gt; + &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a52a2a"&gt;1.0&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; directOffset = directSlackSlice;

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Make second pass to arrange items
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;for&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; index = lineStart; index &amp;lt; lineEnd; index++)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the size of the element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element = children[index];
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; elementSize = &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;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(o, element.DesiredSize.Width, element.DesiredSize.Height);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine if we should use the element's desired size or the
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// fixed item width or height
&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; directGrowth = directDelta != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ?
            directDelta.Value :
            elementSize.Direct;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Arrange the element
&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; bounds = isHorizontal ?
            &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;(directOffset, indirectOffset, directGrowth, indirectGrowth) :
            &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;(indirectOffset, directOffset, indirectGrowth, directGrowth);
        element.Arrange(bounds);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Update offset for next time
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        directOffset += directGrowth + directSlackSlice;
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9936399" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category></item><item><title>That's a WrapPanel and I am outta here... [A balanced WrapPanel implementation for Silverlight and WPF!]</title><link>http://blogs.msdn.com/delay/archive/2009/12/08/that-s-a-wrappanel-and-i-am-outta-here-a-balanced-wrappanel-implementation-for-silverlight-and-wpf.aspx</link><pubDate>Wed, 09 Dec 2009 06:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9934427</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9934427.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9934427</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;A customer contacted me a few days ago asking whether there was an easy way to make the Silverlight/WPF &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.aspx"&gt;WrapPanel&lt;/A&gt; use all available space to spread its children out evenly instead of bunching them up against each other as it usually does. Instead of trying to explain what I mean by that, please have a look at the top half of the following screen shot: &lt;/P&gt;&lt;IMG alt="BalancedWrapPanel, Horizontal, ItemWidth and ItemHeight set" src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalWidth.png" width=386 height=390 mce_src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-HorizontalWidth.png"&gt; 
&lt;P&gt;The default &lt;CODE&gt;WrapPanel&lt;/CODE&gt; behavior fills each horizontal (or vertical) line as much as it can before moving on to the next line - but it leaves all the extra space at the end of the line. That big, vertical gap of empty space at the right of the colored boxes is a bit unsightly, so what would be nice is if &lt;CODE&gt;WrapPanel&lt;/CODE&gt; distributed the extra space across the &lt;STRONG&gt;entire&lt;/STRONG&gt; line - kind of like you see in the bottom half of the window above! &lt;/P&gt;
&lt;P&gt;My reply to the customer was that I didn't know of a way to do this with &lt;CODE&gt;WrapPanel&lt;/CODE&gt; as-is, but that it should be pretty straightforward to modify the code and &lt;STRONG&gt;add&lt;/STRONG&gt; the balancing logic. Well, I got curious on the bus yesterday, so I went ahead and implemented &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt;, the control I used in the second example above. &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/BalancedWrapPanel/BalancedWrapPanel.zip" mce_href="http://cesso.org/Samples/BalancedWrapPanel/BalancedWrapPanel.zip"&gt;Click here to download the source code for BalancedWrapPanel and the Silverlight/WPF demo application.&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To implement this alternate behavior, I started with the &lt;CODE&gt;WrapPanel&lt;/CODE&gt; source code that comes with the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt;. For WPF 3.5 (or Silverlight 4), I needed to copy &lt;CODE&gt;WrapPanel.cs&lt;/CODE&gt;, &lt;CODE&gt;OrientedSize.cs&lt;/CODE&gt;, and &lt;CODE&gt;NumericExtensions.cs&lt;/CODE&gt;. For Silverlight 3 (which doesn't have &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.lengthconverter.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.lengthconverter.aspx"&gt;LengthConverter&lt;/A&gt;) I also needed to copy &lt;CODE&gt;LengthConverter.cs&lt;/CODE&gt; and &lt;CODE&gt;TypeConverters.cs&lt;/CODE&gt;. I renamed "WrapPanel" to "BalancedWrapPanel" everywhere, linked the copied files into a new Visual Studio solution containing sample projects for Silverlight 3 and WPF 3.5, and compiled successfully. After that, it was just a matter of tweaking the code a bit, and I was done! &lt;/P&gt;
&lt;P&gt;I've highlighted my additions to the existing helper method below: &lt;/P&gt;&lt;PRE&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ArrangeLine(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lineStart, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; lineEnd, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;? directDelta, &lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow; COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow; COLOR: #000000"&gt; directMaximum, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; indirectOffset, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; indirectGrowth
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; o = Orientation;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; isHorizontal = o == &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Orientation&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Horizontal;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElementCollection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; children = Children;

&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #008000"&gt;    // Make first pass to calculate the slack space
&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; directLength = 0.0;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;for&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; index = lineStart; index &amp;lt; lineEnd; index++)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the size of the element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element = children[index];
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; elementSize = &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;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(o, element.DesiredSize.Width, element.DesiredSize.Height);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine if we should use the element's desired size or the
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// fixed item width or height
&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; directGrowth = directDelta != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ?
            directDelta.Value :
            elementSize.Direct;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Update total length
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        directLength += directGrowth;
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine slack
&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; directSlack = directMaximum - directLength;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; directSlackSlice = directSlack / (lineEnd - lineStart + 1.0);
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; directOffset = directSlackSlice;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;

    // Make second pass to arrange items
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;for&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; index = lineStart; index &amp;lt; lineEnd; index++)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Get the size of the element
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UIElement&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; element = children[index];
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; elementSize = &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;OrientedSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(o, element.DesiredSize.Width, element.DesiredSize.Height);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Determine if we should use the element's desired size or the
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// fixed item width or height
&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; directGrowth = directDelta != &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ?
            directDelta.Value :
            elementSize.Direct;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Arrange the element
&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; bounds = isHorizontal ?
            &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;(directOffset, indirectOffset, directGrowth, indirectGrowth) :
            &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;(indirectOffset, directOffset, indirectGrowth, directGrowth);
        element.Arrange(bounds);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Update offset for next time
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        directOffset += directGrowth &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;+ directSlackSlice&lt;/SPAN&gt;;
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;That's all there is to it: a few simple changes, a wave of the magic compiler wand, and &lt;STRONG&gt;POOF!&lt;/STRONG&gt; a more pleasing layout for both platforms. &lt;/P&gt;
&lt;P&gt;Woot! &lt;NOBR&gt;:)&lt;/NOBR&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;
&lt;P&gt;I could have refactored the method above for a slightly more efficient solution, but decided the code would be easier to understand if I changed as little as possible and kept the edits distinct. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;Alternatively, I could have subclassed &lt;CODE&gt;WrapPanel&lt;/CODE&gt; and implemented my changes in &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.arrangeoverride.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.arrangeoverride.aspx"&gt;ArrangeOverride&lt;/A&gt;. This would have had the benefit of requiring fewer files from the Silverlight Toolkit, but would have required somewhat more code on my part. I didn't see a particularly compelling argument for either option, so I chose copy+edit because it demonstrates how really &lt;STRONG&gt;easy&lt;/STRONG&gt; it is to reuse code from the Silverlight Toolkit, because it's more flexible in general, and because it makes it easy to add further enhancements in the future. &lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;The example screen shot above uses &lt;CODE&gt;WrapPanel&lt;/CODE&gt;'s &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemwidth.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemwidth.aspx"&gt;ItemWidth&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemheight.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.itemheight.aspx"&gt;ItemHeight&lt;/A&gt; properties to specify that all items should take up the same space. That seemed like the most likely case for someone who wants to use the new balancing behavior. However, the changes I've made work just as well when these properties are unset (i.e., &lt;CODE&gt;NaN&lt;/CODE&gt;). They &lt;STRONG&gt;also&lt;/STRONG&gt; work well when using a vertically-oriented &lt;CODE&gt;BalancedWrapPanel&lt;/CODE&gt; - as the following screen shot shows: &lt;/P&gt;&lt;IMG alt="BalancedWrapPanel, Vertical, ItemWidth and ItemHeight not set" src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-VerticalNan.png" width=340 height=349 mce_src="http://blogs.msdn.com/blogfiles/delay/BalancedWrapPanel-VerticalNan.png"&gt; &lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If you download the source code and build for Silverlight 4, you'll get the following warning because Silverlight 4 adds support for &lt;CODE&gt;LengthConverter&lt;/CODE&gt;: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;warning CS0436: The type 'System.Windows.LengthConverter' in '...\LengthConverter.cs' conflicts with the imported type 'System.Windows.LengthConverter' in '...\System.Windows.Controls.Toolkit.dll'. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can either ignore the warning or remove the files &lt;CODE&gt;LengthConverter.cs&lt;/CODE&gt; and &lt;CODE&gt;TypeConverters.cs&lt;/CODE&gt; from the project. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9934427" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category></item><item><title>Two birds, squared! [Silverlight/WPF Data Visualization Development Release 3 and a DataVisualizationDemos update]</title><link>http://blogs.msdn.com/delay/archive/2009/11/30/two-birds-squared-silverlight-wpf-data-visualization-development-release-3-and-a-datavisualizationdemos-update.aspx</link><pubDate>Mon, 30 Nov 2009 20:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9930348</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9930348.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9930348</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;We shipped the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"&gt;November 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; a little over a week ago and it includes a &lt;A href="http://blogs.msdn.com/delay/archive/2009/11/18/silverlight-4-beta-is-out-and-the-toolkit-has-it-covered-silverlight-toolkit-november-2009-release-now-available-for-silverlight-3-and-4.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/11/18/silverlight-4-beta-is-out-and-the-toolkit-has-it-covered-silverlight-toolkit-november-2009-release-now-available-for-silverlight-3-and-4.aspx"&gt;handful of improvements to the Data Visualization assembly&lt;/A&gt;. It also adds support for the new &lt;A href="http://www.silverlight.net/getstarted/silverlight-4-beta/" mce_href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&gt;Silverlight 4 Beta&lt;/A&gt;! And while &lt;STRONG&gt;we&lt;/STRONG&gt; were busy getting the October/November Toolkits out the door, the &lt;STRONG&gt;WPF&lt;/STRONG&gt; team previewed WPF 4 along with the &lt;A href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" mce_href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;.NET 4 and Visual Studio 2010 Beta&lt;/A&gt;! &lt;/P&gt;
&lt;P&gt;Which means there are now &lt;STRONG&gt;four&lt;/STRONG&gt; platforms of interest to developers: &lt;U&gt;Silverlight 3&lt;/U&gt;, &lt;U&gt;Silverlight 4&lt;/U&gt;, &lt;U&gt;WPF 3.5&lt;/U&gt;, and &lt;U&gt;WPF 4&lt;/U&gt;. And the Silverlight/WPF Data Visualization assembly supports them &lt;STRONG&gt;all&lt;/STRONG&gt;! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Silverlight/WPF Data Visualization Development Release 3 &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;As with previous &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx"&gt;Data Visualization Development Releases&lt;/A&gt;, I've updated to the most recent Toolkit code. And like &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx"&gt;last time&lt;/A&gt;, the Silverlight Toolkit shipped most recently so the code in the new Development Release is identical to what just went out with the Silverlight 3/4 Toolkits. However, people using Data Visualization on WPF 3.5 or 4 can take advantage of the latest changes by updating to the binaries included with this Development Release or by compiling the corresponding code themselves. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip" mce_href="http://cesso.org/Samples/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip"&gt;[Click here to download the SilverlightWpfDataVisualization solution including complete source code and pre-compiled binaries for all four platforms.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notes: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;This is the first release I know of that supports four different platforms with distinct implementations on each. While the code and XAML are 99+% identical across the platforms, each has at least one customization that makes it unique. [Bonus points for identifying them all! &lt;NOBR&gt;:)&lt;/NOBR&gt; ] &lt;/LI&gt;
&lt;LI&gt;Previously, there was a single Visual Studio 2008 &lt;CODE&gt;SilverlightWpfDataVisualization.sln&lt;/CODE&gt; file for both Silverlight 3 and WPF 3.5. Because Silverlight 4 and WPF 4 use Visual Studio 2010, there's a new &lt;CODE&gt;SilverlightWpfDataVisualization&lt;STRONG&gt;4&lt;/STRONG&gt;.sln&lt;/CODE&gt; file for those two platforms. The two solutions (and the projects within) look and act exactly the same - they're separate because they compile with different tools and because separation lets people who haven't upgraded continue to use the VS 2008 solution. &lt;/LI&gt;
&lt;LI&gt;I always strive for code that builds with no compile or code analysis warnings, and that's still the case when compiling for Silverlight 3, WPF 3.5, and Silverlight 4 (though the last is a bit of a cheat because code analysis doesn't work there yet). But the new .NET 4 tools include some improvements, and there were three new kinds of warnings when I first compiled for WPF 4. Two of them were easily addressed with trivial changes I already made, but the third requires a bit more (potentially destabilizing) work that was &lt;STRONG&gt;not&lt;/STRONG&gt; done for this release: &lt;EM&gt;Warning 2 CA1062 : Microsoft.Design : In externally visible method 'Foo', validate parameter 'Bar' before using it.&lt;/EM&gt; As it happens, there was already a work item for this task because we knew we weren't checking everywhere we should. So if you see this warning when compiling the WPF 4 assembly, please don't be alarmed! &lt;/LI&gt;
&lt;LI&gt;Whereas it used to be fine to wrap platform-specific code in &lt;CODE&gt;#if SILVERLIGHT&lt;/CODE&gt; blocks, that doesn't work anymore because there are now cross-version changes &lt;STRONG&gt;within&lt;/STRONG&gt; each platform. Therefore, I've switched to the form &lt;CODE&gt;#if !NO_FEATURE&lt;/CODE&gt; instead. It's usually best to avoid double-negatives, but their use here is a consequence of a deliberate decision. My goal is that, by default, the code tries to use every feature it supports and if the target platform doesn't implement something, there's a compile error. At which point it's easy to identify the problem and add the relevant &lt;CODE&gt;#define&lt;/CODE&gt; to the project file to "turn off" the unsupported feature. This seem better to me than forcing developers to know all the relevant flags and use them to "turn on" features for each platform. Just another example of the &lt;A href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx" mce_href="http://blogs.msdn.com/brada/archive/2003/10/02/50420.aspx"&gt;pit of success&lt;/A&gt;, really... &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/LI&gt;
&lt;LI&gt;WPF 4 includes the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager(VS.100).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.visualstatemanager(VS.100).aspx"&gt;Visual State Manager&lt;/A&gt; classes in the framework, so the WPF 4 Data Visualization assembly no longer has a dependency on the WPF Toolkit! &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;IMG alt="DataVisualizationDemos on WPF 4" src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-WPF4.png" width=405 height=381 mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-WPF4.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;DataVisualizationDemos Sample Project Updated &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The DataVisualizationDemos application is a collection of all the Data Visualization samples I've posted to my blog. Like the Data Visualization assembly itself, the demo application runs on Silverlight 3 and 4 as well as WPF 3.5 and 4 and shares the same code and XAML across all &lt;STRONG&gt;four&lt;/STRONG&gt; platforms. Not only is it a convenient way to look at a variety of sample code, it also has links back to the relevant blog posts for more detail about each sample. &lt;/P&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 cross-platform DataVisualizationDemos sample application.&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notes: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I've followed the same dual-solution and &lt;CODE&gt;#if&lt;/CODE&gt; approaches that I describe above. &lt;/LI&gt;
&lt;LI&gt;Because WPF 4 now supports &lt;A href="http://msdn.microsoft.com/en-us/library/cc189019(VS.96).aspx#easing_functions" mce_href="http://msdn.microsoft.com/en-us/library/cc189019(VS.96).aspx#easing_functions"&gt;easing functions&lt;/A&gt;, the "Gelatin Sales" example on the "Charting Introduction" tab runs on that platform - as does the entire "Jelly Charting" demo. And boy, is it smooth on WPF! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the release of Silverlight/WPF Data Visualization Development Release 3, it's easy for anyone to compile and run the Data Visualization assembly on any of Microsoft's four premier development platforms. So what are you waiting for? &lt;NOBR&gt;;)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9930348" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>Sharing isn't easy for anyone [Tricks for sharing the same XAML files across Silverlight and WPF]</title><link>http://blogs.msdn.com/delay/archive/2009/11/23/sharing-isn-t-easy-for-anyone-tricks-for-sharing-the-same-xaml-files-across-silverlight-and-wpf.aspx</link><pubDate>Tue, 24 Nov 2009 07:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9927747</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9927747.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9927747</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;I casually mentioned &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx"&gt;two tricks for sharing the same XAML across Silverlight and WPF&lt;/A&gt; in the notes of a post a couple weeks ago. I used both techniques in my &lt;CODE&gt;DataVisualizationDemos&lt;/CODE&gt; project (which compiles for Silverlight and WPF from the same source code) and wanted to call them out for others in similar situations. The feedback I got was quite positive - until &lt;A href="http://blog.elgaard.com/" mce_href="http://blog.elgaard.com/"&gt;Brian Elgaard Bennett&lt;/A&gt; tried the subclassing trick with &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx"&gt;HierarchicalDataTemplate&lt;/A&gt;. While there's no reason that shouldn't work, it doesn't. &lt;/P&gt;
&lt;P&gt;What's going on is that WPF doesn't support subclassing &lt;CODE&gt;DataTemplate&lt;/CODE&gt; or any of its children. What's worse, nobody expects this when they bump into it! [I know a few of us have independently reported the same issue to the WPF team - it's kind of like a rite of passage. &lt;NOBR&gt;:)&lt;/NOBR&gt; ] So the right people are aware of the problem, and maybe - just maybe - the new XAML parser in .NET 4 will help fix things. But that doesn't matter for WPF 3.5 development today - and because my XAML sharing trick &lt;STRONG&gt;relies&lt;/STRONG&gt; on subclassing, the situation seems pretty dire. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'm stubborn, so I thought about the situation a little and foolishly said I had an idea that should work. Unfortunately - like most of my ideas - it didn't work the first time. Or the second time. Or the third. Or... &lt;/P&gt;
&lt;P&gt;I think it was something like the ninety-ninth idea that finally worked. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;"Genius is one percent inspiration, ninety-nine percent perspiration."&lt;/EM&gt; - Thomas Edison &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Well, I won't claim this is genius or anything, but the ratio sure seems right. &lt;NOBR&gt;:)&lt;/NOBR&gt; &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/SharingXamlSilverlightWpf/SharingXamlSilverlightWpf.zip" mce_href="http://cesso.org/Samples/SharingXamlSilverlightWpf/SharingXamlSilverlightWpf.zip"&gt;[Click here to download the complete source code for the SharingXamlSilverlightWpf sample.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way I've solved the &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt; problem is a lot like the way I went about things before. However, I've implemented it a little differently this time around, so if you want a quick-and-dirty solution and don't care about &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt;, then do it the way I did in my &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx"&gt;previous post&lt;/A&gt;. But if you want a more complete, more comprehensive solution, please keep reading... &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, here's the XAML we'll be sharing. There's nothing fancy, just some standard controls that are part of the core framework for &lt;STRONG&gt;WPF&lt;/STRONG&gt;, and part of the SDK/&lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Toolkit&lt;/A&gt; for &lt;STRONG&gt;Silverlight&lt;/STRONG&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;UserControl&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;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="SharingXamlSilverlightWpf_SL.MainPage"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;x&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="http://schemas.microsoft.com/winfx/2006/xaml"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;systemWindows&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="clr-namespace:System.Windows;assembly=PresentationFramework"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="clr-namespace:System.Windows.Controls;assembly=PresentationFramework"&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DockPanel&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Inside a DockPanel"/&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DockPanel&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Viewbox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="40"&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Inside a ViewBox"/&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Viewbox&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeView&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeViewItem
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;               &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Header&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Inside a TreeView(Item)"
&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; IsExpanded&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeViewItem.ItemTemplate&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;systemWindows&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;HierarchicalDataTemplate&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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;systemWindows&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;HierarchicalDataTemplate&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeViewItem.ItemTemplate&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeViewItem&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;systemWindowsControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;TreeView&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;UserControl&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: In the ideal world, we wouldn't need to use an XML namespace prefix under Silverlight and therefore this problem would never come up in the first place. Unfortunately, Silverlight 3 and the Silverlight 4 Beta don't support &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.markup.xmlnsdefinitionattribute.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.markup.xmlnsdefinitionattribute.aspx"&gt;XmlnsDefinitionAttribute&lt;/A&gt;, so the fact that the SDK/Toolkit assemblies already properly implement it doesn't help us. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;The interesting thing to note above is that all the relevant controls (&lt;CODE&gt;DockPanel&lt;/CODE&gt;, &lt;CODE&gt;Viewbox&lt;/CODE&gt;, &lt;CODE&gt;TreeView&lt;/CODE&gt;, &lt;CODE&gt;TreeViewItem&lt;/CODE&gt;, and &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt;) have a prefix and that things look just like you'd expect them to under WPF if you went to the trouble of specifying the namespace explicitly. And, in fact, that's all there is for WPF - just be explicit with the XAML and you're done! &lt;/P&gt;
&lt;P&gt;So what's the magic that makes this work on Silverlight? Well, it's nothing in the application project there, either - just like with WPF there are no special changes required! However, there &lt;STRONG&gt;is&lt;/STRONG&gt; an &lt;STRONG&gt;extra&lt;/STRONG&gt; assembly on the Silverlight side... &lt;/P&gt;
&lt;P&gt;Before I totally spoil the surprise, here's the code for that assembly: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;extern&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;alias&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SWC;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;extern&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;alias&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SWCT;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; System.Windows.Markup;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SystemWindows = SWC::System.Windows;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SystemWindowsControls = SWC::System.Windows.Controls;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;using&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SystemWindowsControlsToolkit = SWCT::System.Windows.Controls;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; System.Windows
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Stub class for HierarchicalDataTemplate
&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;HierarchicalDataTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : SystemWindows.HierarchicalDataTemplate
    {
    }
}

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;namespace&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; System.Windows.Controls
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Stub class for DockPanel
&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;DockPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : SystemWindowsControlsToolkit.DockPanel
    {
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Stub class for TreeView
&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;TreeView&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : SystemWindowsControls.TreeView
    {
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Stub class for TreeViewItem
&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;TreeViewItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : SystemWindowsControls.TreeViewItem
    {
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Stub class for Viewbox
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Silverlight's Viewbox is sealed, so simulate it with a ContentControl wrapper
&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;Viewbox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ContentControl
&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; Viewbox()
        {
            Template = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ControlTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;XamlReader&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Load(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"
                &amp;lt;ControlTemplate
                    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
                    xmlns:controls=""clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit""&amp;gt;
                    &amp;lt;controls:Viewbox&amp;gt;
                        &amp;lt;ContentPresenter/&amp;gt;
                    &amp;lt;/controls:Viewbox&amp;gt;
                &amp;lt;/ControlTemplate&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Aside from some &lt;A href="http://msdn.microsoft.com/en-us/library/ms173212.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms173212.aspx"&gt;extern alias&lt;/A&gt;/&lt;A href="http://msdn.microsoft.com/en-us/library/zhdeatwt.aspx" mce_href="http://msdn.microsoft.com/en-us/library/zhdeatwt.aspx"&gt;using&lt;/A&gt; stuff at the top to disambiguate references, there's nothing here we didn't see last time around - in fact, the subclassing trick for &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt; looks just like it does for the other classes. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;But I thought that trick didn't work for HierarchicalDataTemplate? &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Right, it doesn't work on WPF - but this assembly is &lt;STRONG&gt;Silverlight-only&lt;/STRONG&gt;. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Then you need a matching assembly for WPF or else the project won't compile because of the XMLNS reference. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Unless the corresponding assembly &lt;STRONG&gt;already exists&lt;/STRONG&gt; on WPF. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Oh, no you didn't... &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Oh, yes I did! :) &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The Silverlight-only assembly is named &lt;CODE&gt;PresentationFramework.dll&lt;/CODE&gt;, the &lt;STRONG&gt;same&lt;/STRONG&gt; name as the platform assembly that contains the actual implementations of the controls for WPF. The Silverlight platform doesn't have a &lt;CODE&gt;PresentationFramework.dll&lt;/CODE&gt;, and this latest trick takes advantage of that fact to sneak one in. Because Silverlight doesn't suffer from the same &lt;CODE&gt;DataTemplate&lt;/CODE&gt; subclassing bug, it's perfectly okay to subclass &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt; there. &lt;/P&gt;
&lt;P&gt;So the original subclassing trick does 95% of what we want, the control wrapping trick adds &lt;CODE&gt;Viewbox&lt;/CODE&gt;, and the &lt;CODE&gt;PresentationFramework&lt;/CODE&gt; trick adds &lt;CODE&gt;HierarchicalDataTemplate&lt;/CODE&gt; - which means we're &lt;STRONG&gt;100%&lt;/STRONG&gt; covered! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Well, at least until someone contacts me to report another problem. Which would no doubt be interesting to debug and I'd certainly want to have a look. &lt;/P&gt;
&lt;P&gt;But not right now. Adding that same-named assembly has left me feeling a little slimy and I think I need a shower before I spend more time on this. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9927747" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category></item><item><title>Silverlight 4 Beta is out - and the Toolkit has it covered! [Silverlight Toolkit November 2009 release now available for Silverlight 3 and 4!]</title><link>http://blogs.msdn.com/delay/archive/2009/11/18/silverlight-4-beta-is-out-and-the-toolkit-has-it-covered-silverlight-toolkit-november-2009-release-now-available-for-silverlight-3-and-4.aspx</link><pubDate>Wed, 18 Nov 2009 19:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9924635</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9924635.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9924635</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;We've just published the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=36060"&gt;November 09&lt;/A&gt; release of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; in conjunction with today's unveiling of the &lt;A href="http://www.silverlight.net/getstarted/silverlight-4-beta/" mce_href="http://www.silverlight.net/getstarted/silverlight-4-beta/"&gt;Silverlight 4 Beta&lt;/A&gt;! The Silverlight 4 Beta offers a bunch of neat new features which enable even more compelling online (and offline!) applications. Stuff like &lt;STRONG&gt;bi-directional text&lt;/STRONG&gt;,&lt;STRONG&gt; web cam and microphone&lt;/STRONG&gt; support, a &lt;STRONG&gt;RichTextArea&lt;/STRONG&gt; control, &lt;STRONG&gt;clipboard&lt;/STRONG&gt; access, &lt;STRONG&gt;ICommand&lt;/STRONG&gt;, an &lt;STRONG&gt;elevated-trust&lt;/STRONG&gt; model, &lt;STRONG&gt;printing&lt;/STRONG&gt;, &lt;STRONG&gt;notifications&lt;/STRONG&gt;, &lt;STRONG&gt;right-click&lt;/STRONG&gt;, and &lt;STRONG&gt;more&lt;/STRONG&gt;! &lt;/P&gt;
&lt;P&gt;Of course, the big news for &lt;STRONG&gt;this&lt;/STRONG&gt; post is a new version of the Silverlight Toolkit that's perfectly suited for developing great applications on Silverlight 4. And though it seems like just yesterday that we finished off the October 09 release, there are some neat, new things in today's release for Silverlight 3, as well. You can be confident that the Silverlight Toolkit has your back &lt;STRONG&gt;whichever&lt;/STRONG&gt; platform you choose! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My announcements are usually all about the &lt;A href="http://cesso.org/r/DVLinks" mce_href="http://cesso.org/r/DVLinks"&gt;Toolkit's Data Visualization assembly&lt;/A&gt; - and there &lt;STRONG&gt;are&lt;/STRONG&gt; some improvements in that area - but it wasn't my primary focus this time around. If you have a look at the &lt;A href="http://silverlight.codeplex.com/wikipage?title=Silverlight%20Toolkit%20November%202009%20change%20list" mce_href="http://silverlight.codeplex.com/wikipage?title=Silverlight%20Toolkit%20November%202009%20change%20list"&gt;official release notes&lt;/A&gt;, you'll see there are all kinds of new things across the board. I'm not going to repeat everything here, but I do want to highlight a few things: &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Partial Release Notes &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: orange"&gt;SL3&lt;/STRONG&gt;/&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: We've added a new control, &lt;STRONG&gt;BusyIndicator&lt;/STRONG&gt;, based on the &lt;CODE&gt;ActivityControl&lt;/CODE&gt; found in the RIA Services project template and samples. &lt;CODE&gt;BusyIndicator&lt;/CODE&gt; makes it easy to add a "Please wait..." progress indicator to applications and does so in a way that's easy to customize. It's a simple control, but a handy one. I have a few examples below; please see &lt;A href="http://www.davidpoll.com/" mce_href="http://www.davidpoll.com/"&gt;David Poll's blog&lt;/A&gt; for more. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: orange"&gt;SL3&lt;/STRONG&gt;/&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: Minor tweaks to &lt;STRONG&gt;Data Visualization&lt;/STRONG&gt;: Support more flexible subclassing scenarios of core classes, provide more helpful exception messages in some scenarios, tweak default Chart template to respect Padding, change type of Chart.LegendItems collection items to &lt;CODE&gt;object&lt;/CODE&gt; for flexibility, convert &lt;CODE&gt;Legend&lt;/CODE&gt; to a &lt;CODE&gt;HeaderedItemsControl&lt;/CODE&gt; for consistency. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: orange"&gt;SL3&lt;/STRONG&gt;/&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: It's now possible to collect &lt;STRONG&gt;code coverage&lt;/STRONG&gt; statistics when running unit tests with the Silverlight Unit Test Framework! Jeff spent some time this release productizing some clever hackery Ted Glaza originally did about a year ago, and this new capability fills a pretty big hole in the unit testing story for Silverlight. We're also including a couple of the &lt;STRONG&gt;custom build actions&lt;/STRONG&gt; that we use internally - now you'll be able to use them in your projects! And we're including the XML files to make it easy for customers to enable &lt;STRONG&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd833069(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd833069(VS.95).aspx"&gt;Application Library Caching&lt;/A&gt;&lt;/STRONG&gt; for their projects. For more information on these topics, please have a look at &lt;A href="http://www.jeff.wilcox.name/" mce_href="http://www.jeff.wilcox.name/"&gt;Jeff Wilcox's blog&lt;/A&gt;. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: We've modified all the Toolkit/SDK control visuals and input handlers to behave correctly for &lt;STRONG&gt;right-to-left cultures&lt;/STRONG&gt; and added &lt;STRONG&gt;mouse wheel support&lt;/STRONG&gt; in some of the obvious places. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: We've removed &lt;STRONG&gt;ImplicitStyleManager&lt;/STRONG&gt; because Silverlight 4 supports implicit styles natively. Correspondingly, we've modified the &lt;CODE&gt;Theme&lt;/CODE&gt;-based wrapper classes (&lt;CODE&gt;TwilightBlue&lt;/CODE&gt;, &lt;CODE&gt;ShinyRed&lt;/CODE&gt;, etc.) to use implicit styles. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: &lt;STRONG&gt;Viewbox&lt;/STRONG&gt; has moved into the Silverlight 4 core (i.e., it's available in the &lt;CODE&gt;System.Windows.dll&lt;/CODE&gt; assembly that every Silverlight 4 install includes), so it has been removed from the Silverlight 4 Toolkit. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG style="BACKGROUND-COLOR: lime"&gt;SL4&lt;/STRONG&gt;: Along with the new &lt;A href="http://mef.codeplex.com/" mce_href="http://mef.codeplex.com/"&gt;MEF (Managed Extensibility Framework)&lt;/A&gt; features in the Silverlight 4 SDK, there's an experimental &lt;STRONG&gt;System.ComponentModel.Composition.Packaging.Toolkit&lt;/STRONG&gt; assembly in the Toolkit that adds support for downloading secondary XAP’s and loading them into a MEF catalog. For more information, please have a look at &lt;A href="http://weblogs.asp.net/whaggard" mce_href="http://weblogs.asp.net/whaggard"&gt;Wes Haggard's blog&lt;/A&gt;. &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;BusyIndicator is in the house...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;At its core, &lt;CODE&gt;BusyIndicator&lt;/CODE&gt; is a simple wrapper control into which you put whatever makes up the UI of your application. (You can think of it as a special kind of &lt;CODE&gt;Border&lt;/CODE&gt; with special abilities.) &lt;CODE&gt;BusyIndicator&lt;/CODE&gt; exposes an &lt;CODE&gt;IsBusy&lt;/CODE&gt; property which should be set to &lt;CODE&gt;true&lt;/CODE&gt; (possibly via data binding) whenever the relevant portion of the application is busy and won't respond to user input. When this happens, &lt;CODE&gt;BusyIndicator&lt;/CODE&gt; automatically disables its content and shows a simple UI to let the user know what's going on. It's really quite simple! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P&gt;Here's the most basic scenario: &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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IsBusy&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; MyBusyProperty&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;!-- Content goes here... --&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;And this is how it looks when &lt;CODE&gt;IsBusy&lt;/CODE&gt; is set: &lt;/P&gt;&lt;IMG alt="Default BusyIndicator" src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-Default.png" width=200 height=100 mce_src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-Default.png"&gt; 
&lt;P&gt;The most common change is to customize the message, and of course that's simple to do: &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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IsBusy&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; MyBusyProperty&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; BusyContent&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="My custom message..."&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Content goes here... --&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Yielding: &lt;/P&gt;&lt;IMG alt="BusyIndicator with custom message" src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-CustomMessage.png" width=200 height=100 mce_src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-CustomMessage.png"&gt; 
&lt;P&gt;Note that the &lt;CODE&gt;BusyContent&lt;/CODE&gt; property is of type &lt;CODE&gt;object&lt;/CODE&gt;, so we could have used other UI elements (like &lt;CODE&gt;Grid&lt;/CODE&gt;, &lt;CODE&gt;Image&lt;/CODE&gt;, and &lt;CODE&gt;Button&lt;/CODE&gt;) for a message with more than just text. Of course, sometimes you want things to be &lt;STRONG&gt;totally&lt;/STRONG&gt; custom - so there are some straightforward ways to do that which don't require you to completely re-Template: &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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;   &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; IsBusy&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; MyBusyProperty&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; BusyContent&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: #008000"&gt;&amp;lt;!-- Provide custom UI for busy display --&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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator.BusyContentTemplate&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;DataTemplate&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Downloading Email"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; FontWeight&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Bold"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Center"/&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: #ff0000"&gt; Margin&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="6"&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; MyStatus&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;ProgressBar&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;Binding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; MyProgress&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="15"/&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;Button&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Cancel"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; HorizontalAlignment&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Center"/&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;DataTemplate&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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator.BusyContentTemplate&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;!-- Remove unnecessary default ProgressBar --&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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator.ProgressBarStyle&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;="ProgressBar"&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;="Visibility"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Collapsed"/&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;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator.ProgressBarStyle&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;!-- Content goes here... --&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;controlsToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;BusyIndicator&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Which looks like: &lt;/P&gt;&lt;IMG alt="BusyIndicator with custom UI" src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-CustomTemplate.png" width=230 height=150 mce_src="http://blogs.msdn.com/blogfiles/delay/BusyIndicator-CustomTemplate.png"&gt; 
&lt;P&gt;Another property to be aware of is the &lt;CODE&gt;DisplayAfter&lt;/CODE&gt; property which lets you configure the initial delay before the busy indicator is shown - to avoid the annoying "on/off" flicker that would otherwise result from a lot of quick operations in succession. The &lt;CODE&gt;BusyIndicator&lt;/CODE&gt; page of the &lt;A href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html"&gt;public sample project&lt;/A&gt; has an interactive section where you can experiment with various delays and durations to see how this looks in action. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;ImplicitStyleManager has left the building...&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I wanted to show how to convert an existing application using &lt;CODE&gt;ImplicitStyleManager&lt;/CODE&gt; over to using Silverlight 4's new implicit styling support. Because I made this change for the 11 Toolkit themes, I can tell you it is quite easy. &lt;NOBR&gt;:)&lt;/NOBR&gt; Basically, it's just a matter of removing the &lt;CODE&gt;ImplicitStyleManager&lt;/CODE&gt; attached property/properties and - where relevant - moving the &lt;CODE&gt;ResourceDictionary&lt;/CODE&gt; of &lt;CODE&gt;Style&lt;/CODE&gt;s into the &lt;CODE&gt;Resources&lt;/CODE&gt; section of the parent element (or all the way up to &lt;CODE&gt;App.xaml&lt;/CODE&gt;). Also, be sure to go through and remove any explicit assignments to the &lt;CODE&gt;Style&lt;/CODE&gt; property or it's friends (e.g., &lt;CODE&gt;ItemContanerStyle&lt;/CODE&gt;). (This probably isn't common in most applications, but the Toolkit Themes did it all over the place.) &lt;/P&gt;
&lt;P&gt;To make that a little more concrete, here's a simplified "before" example that makes &lt;CODE&gt;Button&lt;/CODE&gt;s have blue text and &lt;CODE&gt;ListBoxItem&lt;/CODE&gt;s purple: &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;StackPanel&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #ff0000"&gt;controlsThemingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;ImplicitStyleManager.ApplyMode&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="OneTime"&lt;/SPAN&gt;&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;!-- Styles for controls --&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.Resources&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;="Button"&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;="Foreground"&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;Style&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="ListBoxItem"&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;="Foreground"&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;StackPanel.Resources&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;!-- Styled controls --&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;Button&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&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: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ListBox&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;ListBoxItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Item 1"/&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;ListBoxItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Content&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Item 2"/&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;ListBox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;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;/PRE&gt;
&lt;P&gt;To convert this XAML over to Silverlight 4's implicit style support, just remove the highlighted portion above. The visuals will look exactly the same, but everything is more efficient because the platform is handling it internally. And what's more, various scenarios that were tricky to get working with &lt;CODE&gt;ImplicitStyleManager&lt;/CODE&gt; (like styling the contents of a &lt;CODE&gt;TabControl&lt;/CODE&gt;) now "just work" thanks to the new framework support for implicit styles! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Silverlight 4 has a lot of great improvements that really raise the bar for rich, interactive web applications. I encourage everyone to check it out today and start thinking about how to take advantage of all the new stuff! &lt;NOBR&gt;:)&lt;/NOBR&gt; And when you're done with that, please check out the live Toolkit samples for &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; or &lt;A href="http://silverlight.net/samples/sl4/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl4/toolkitcontrolsamples/run/default.html"&gt;Silverlight 4&lt;/A&gt;, download the Toolkit installer(s) for the platform/platforms of your choice, and &lt;STRONG&gt;enjoy&lt;/STRONG&gt;! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9924635" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category></item><item><title>As the platform evolves, so do the workarounds [Better SetterValueBindingHelper makes Silverlight Setters better-er!]</title><link>http://blogs.msdn.com/delay/archive/2009/11/02/as-the-platform-evolves-so-do-the-workarounds-better-settervaluebindinghelper-makes-silverlight-setters-better-er.aspx</link><pubDate>Mon, 02 Nov 2009 18:24:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9916283</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9916283.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9916283</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;Back in May, I mentioned that Silverlight 2 and 3 don't support putting a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding(VS.95).aspx"&gt;Binding&lt;/A&gt; in the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.setter.value(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.setter.value(VS.95).aspx"&gt;Value&lt;/A&gt; of a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.setter(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.setter(VS.95).aspx"&gt;Setter&lt;/A&gt;. I explained why this is useful (ex: MVVM, &lt;CODE&gt;TreeView&lt;/CODE&gt; expansion, developer/designer separation, etc.) and &lt;A href="http://blogs.msdn.com/delay/archive/2009/05/07/one-more-platform-difference-more-or-less-tamed-settervaluebindinghelper-makes-silverlight-setters-better.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/05/07/one-more-platform-difference-more-or-less-tamed-settervaluebindinghelper-makes-silverlight-setters-better.aspx"&gt;shared a helper class I wrote to implement the intended functionality on Silverlight&lt;/A&gt;. My workaround supported setters for normal &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;s as well as attached ones, so it covered all the bases. It worked well on both flavors of Silverlight and a bunch of you went off and used &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; successfully in your own projects. &lt;/P&gt;
&lt;P&gt;The sun was shining, birds were chirping, and all was right with (that part of) the world... &lt;/P&gt;&lt;IMG alt="SetterValueBindingHelperDemo sample" src="http://blogs.msdn.com/blogfiles/delay/SetterValueBindingHelperDemo.png" width=488 height=380 mce_src="http://blogs.msdn.com/blogfiles/delay/SetterValueBindingHelperDemo.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now flash forward to a few days ago when I was contacted by fellow Silverlight team members &lt;A href="http://www.sitechno.com/blog/" mce_href="http://www.sitechno.com/blog/"&gt;RJ Boeke&lt;/A&gt; and Vinoo Cherian with a report that certain uses of &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; which worked fine on Silverlight 2 and 3 were likely to break if used in a possible future version of Silverlight that was more consistent with WPF's handling of such things. You can imagine my astonishment and dismay... &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Important aside&lt;/STRONG&gt;: The Silverlight team takes backward compatibility &lt;STRONG&gt;very&lt;/STRONG&gt; seriously, so running any Silverlight 2 or 3 application with &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; on such a future version of Silverlight would continue to work in the expected manner. The Silverlight team makes a concerted effort to ensure that each version of Silverlight is "bug compatible" with previous versions to prevent existing applications from suddenly breaking when a new version of Silverlight comes out. &lt;STRONG&gt;However&lt;/STRONG&gt;, were someone to recompile such an application to target a newer release of Silverlight, that application would no longer be subject to the backwards compatibility quirks and would begin seeing the new (more correct/consistent) platform behavior. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;RJ and Vinoo pointed out that a more WPF-consistent handling of &lt;CODE&gt;Style&lt;/CODE&gt;s would break one of the samples that was part of my original blog post. Specifically, the following example would &lt;STRONG&gt;not&lt;/STRONG&gt; have the first &lt;CODE&gt;Binding&lt;/CODE&gt; applied (note: per convention, code in &lt;EM&gt;italics&lt;/EM&gt; is wrong): &lt;/P&gt;&lt;EM&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;/EM&gt;
&lt;P&gt;What's important to note is that two &lt;CODE&gt;Setter&lt;/CODE&gt;s are both setting the &lt;STRONG&gt;same&lt;/STRONG&gt; &lt;CODE&gt;Property&lt;/CODE&gt; (&lt;CODE&gt;local:SetterValueBindingHelper.PropertyBinding&lt;/CODE&gt;) and WPF optimizes this scenario to only apply the last &lt;CODE&gt;Value&lt;/CODE&gt; it sees. Clearly, it was time to think about how tweak &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; so it would work with this theoretical future release of Silverlight... &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Tangential aside&lt;/STRONG&gt;: This kind of platform change wouldn't affect just &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; - &lt;STRONG&gt;any&lt;/STRONG&gt; place where multiple &lt;CODE&gt;Setter&lt;/CODE&gt;s targeted the same &lt;CODE&gt;Property&lt;/CODE&gt; would behave differently. But that difference won't matter 99% of the time - &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; is fairly unique in its need that every &lt;CODE&gt;Value&lt;/CODE&gt; be applied. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One idea for a fix is to expose something like &lt;CODE&gt;PropertyBinding&lt;U&gt;2&lt;/U&gt;&lt;/CODE&gt; from &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; and treat it just like another &lt;CODE&gt;PropertyBinding&lt;/CODE&gt;. While that would definitely work, how do we know that two properties is enough? What if you need three or four? No, despite its simplicity, this is not the flexible solution we're looking for. &lt;/P&gt;
&lt;P&gt;Taking a step back, what we really want is to somehow provide an arbitrary number of &lt;CODE&gt;Property&lt;/CODE&gt;/&lt;CODE&gt;Binding&lt;/CODE&gt; pairs instead of being limited to just one. And if you read that last sentence and thought &lt;EM&gt;"Collection!"&lt;/EM&gt;, I like the way you think. &lt;NOBR&gt;:)&lt;/NOBR&gt; Specifically, what if the same &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; class we're already using to provide the attached &lt;CODE&gt;DependencyProperty&lt;/CODE&gt; &lt;STRONG&gt;and&lt;/STRONG&gt; the data for it were &lt;STRONG&gt;also&lt;/STRONG&gt; capable of storing a collection of other &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; objects? Yeah, sure, that would work! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So let's lay a few ground rules to help guide us: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Every current use of &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; should continue to be valid after we make our changes. In other words, upgrading should be a simple matter of dropping in the new &lt;CODE&gt;SetterValueBindingHelper.cs&lt;/CODE&gt; file and that's all. &lt;/LI&gt;
&lt;LI&gt;The new &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; syntax should work correctly for the current Silverlight 3 release as well as this mythical future version of Silverlight with the WPF-consistent &lt;CODE&gt;Style&lt;/CODE&gt; changes. &lt;/LI&gt;
&lt;LI&gt;The new collection syntax should be easy to use and easy to understand. &lt;/LI&gt;
&lt;LI&gt;Arbitrary nesting is unnecessary; either someone's using a &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; on its own, or else they're using it as a container for a single, nested layer of &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; children. &lt;/LI&gt;
&lt;LI&gt;We could try to be fancy and let children inherit things from their parent, but it's not actually as useful as it seems. Let's not go there and instead keep everything simple and consistent. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Keeping these guidelines in mind, the resulting changes to &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; give us the following alternate representation of the above XAML which works fine on Silverlight 3 today and will also give the desired effect on a possible future version of Silverlight with the WPF optimization: &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;="delay: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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;delay&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: #0000ff"&gt;&amp;gt;&lt;/SPAN&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;delay&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;delay&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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;delay&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: #0000ff"&gt;&amp;gt;&lt;/SPAN&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;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: The two different ways of identifying &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid(VS.95).aspx"&gt;Grid&lt;/A&gt; above are part of the original sample showing that both ways work - in practice, both instances would use the simple "Grid" form. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other than the namespace change to "delay" (for consistency with my other samples), the only change here is the extra &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt; wrapper you see &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;highlighted&lt;/SPAN&gt;. Everything else is pretty much the same &lt;STRONG&gt;and&lt;/STRONG&gt; now it works on imaginary versions of Silverlight, too! &lt;NOBR&gt;:)&lt;/NOBR&gt; So if you're working on an app and you find yourself needing &lt;CODE&gt;SetterValueBindingHelper&lt;/CODE&gt;, please use this latest version; you can rest assured that you're future-proof. &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 its 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;Here's the updated code in its entirety. Please note that I have used a normal (i.e., non-observable) collection, so dynamic updates to the &lt;CODE&gt;Values&lt;/CODE&gt; property are not supported. This was a deliberate decision to minimize complexity. (And besides, I've never heard of anyone modifying the contents of a &lt;CODE&gt;Style&lt;/CODE&gt; dynamically.) &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: #000000"&gt;[&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ContentProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Values"&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;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; Collection of SetterValueBindingHelper instances to apply to the
&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; target element.
&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;remarks&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; Used when multiple Bindings need to be applied to the same element.
&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;/remarks&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;Collection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; Values
    {
        &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;// Defer creating collection until needed
&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; == _values)
            {
                _values = &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;Collection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt;();
            }
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;return&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _values;
        }
    }
    &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;Collection&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;SetterValueBindingHelper&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; _values;

    &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.Values) || (0 == item.Values.Count))
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// No children; apply the relevant binding
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            ApplyBinding(element, item);
        }
        &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;// Apply the bindings of each child
&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; child &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; item.Values)
            {
                &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;"A SetterValueBindingHelper with Values may not have its Property or Binding set."&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; (0 != child.Values.Count)
                {
                    &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;"Values of a SetterValueBindingHelper may not have Values themselves."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
                }
                ApplyBinding(element, child);
            }
        }
    }

    &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; Applies the Binding represented by the 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; &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 to apply the Binding to.&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;SetterValueBindingHelper representing the Binding.&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; ApplyBinding(&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; item)
    {
        &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 requsted 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=9916283" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category></item><item><title>My new home page, revised [Updated collection of great Silverlight/WPF Data Visualization resources!]</title><link>http://blogs.msdn.com/delay/archive/2009/10/28/my-new-home-page-revised-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx</link><pubDate>Wed, 28 Oct 2009 17:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9914196</guid><dc:creator>Delay</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/delay/comments/9914196.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9914196</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;In the time since sharing &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx"&gt;my last collection of Silverlight/WPF Charting links&lt;/A&gt;, there have been some great new articles I'd like to highlight. And in case you haven't heard, we published the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514"&gt;October 09&lt;/A&gt; release of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; last week, so please consider upgrading if you haven't already! &lt;/P&gt;
&lt;P&gt;Here are the latest links (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://blog.ecofic.com/?p=133" mce_href="http://blog.ecofic.com/?p=133"&gt;Silverlight - 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 style="COLOR: gray"&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;LI style="COLOR: gray"&gt;&lt;A href="http://jeffblankenburg.com/2009/07/day-15-silverlight-charting.aspx" mce_href="http://jeffblankenburg.com/2009/07/day-15-silverlight-charting.aspx"&gt;Day #15: Silverlight Charting&lt;/A&gt; - &lt;STRONG&gt;Jeff Blankenburg&lt;/STRONG&gt; gives a nice overview of Charting and demonstrates how easy it is to switch series types along the way. &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://blog.ecofic.com/?p=155" mce_href="http://blog.ecofic.com/?p=155"&gt;Silverlight - 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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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;LI style="COLOR: gray"&gt;&lt;A href="http://www.eggheadcafe.com/tutorials/aspnet/2d803e3c-081f-437c-8ee6-8584c1f63683/silverlight-3-displaying.aspx" mce_href="http://www.eggheadcafe.com/tutorials/aspnet/2d803e3c-081f-437c-8ee6-8584c1f63683/silverlight-3-displaying.aspx"&gt;Silverlight 3: Displaying and Charting with TwitterCounter&lt;/A&gt; - &lt;STRONG&gt;Peter Bromberg&lt;/STRONG&gt; shows off an application to display Twitter statistics along with a chart of followers over time. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blog.ecofic.com/?p=130" mce_href="http://blog.ecofic.com/?p=130"&gt;Silverlight - Drill Down Charts Walkthrough&lt;/A&gt; - &lt;STRONG&gt;Chad Campbell&lt;/STRONG&gt; gives a great overview of creating "drill-down" charts - in video form! &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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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;LI style="COLOR: gray"&gt;&lt;A href="http://leeontech.wordpress.com/2009/05/27/interacting-with-charts-2/" mce_href="http://leeontech.wordpress.com/2009/05/27/interacting-with-charts-2/"&gt;Interacting with charts-2&lt;/A&gt; - &lt;STRONG&gt;Lee&lt;/STRONG&gt; shows off a proof-of-concept implementation to add an overlay for the plot area with grippers that enable interactive zooming on an axis. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=353" mce_href="http://bea.stollnitz.com/blog/?p=353"&gt;How can I add labels to a WPF pie chart?&lt;/A&gt; - &lt;STRONG&gt;Bea Stollnitz&lt;/STRONG&gt; begins her three-part series about adding annotations to a pie chart with an overview. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=363" mce_href="http://bea.stollnitz.com/blog/?p=363"&gt;How can I add labels to a WPF pie chart? - Implementation details&lt;/A&gt; - &lt;STRONG&gt;Bea Stollnitz&lt;/STRONG&gt;'s second post explains how she implemented her pie chart annotations on WPF. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=366" mce_href="http://bea.stollnitz.com/blog/?p=366"&gt;How can I port the WPF labeled pie chart to Silverlight?&lt;/A&gt; - &lt;STRONG&gt;Bea Stollnitz&lt;/STRONG&gt;'s final post of the trilogy details how she ported the WPF implementation to Silverlight. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://reyntjes.blogspot.com/2009/09/freeing-axes-of-microsoft-toolkit.html" mce_href="http://reyntjes.blogspot.com/2009/09/freeing-axes-of-microsoft-toolkit.html"&gt;Freeing the axes of the Microsoft toolkit charting control &lt;/A&gt;- &lt;STRONG&gt;Robert&lt;/STRONG&gt; provides an in-depth description of how he created a custom axis behavior and used it to produce a nice stacked chart display. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.cplotts.com/2009/10/09/wpf-silverlight-charting-a-logarithmic-axis/" mce_href="http://www.cplotts.com/2009/10/09/wpf-silverlight-charting-a-logarithmic-axis/"&gt;WPF &amp;amp; Silverlight Charting: A Logarithmic Axis&lt;/A&gt; - &lt;STRONG&gt;Cory Plotts&lt;/STRONG&gt; took it upon himself to write - and share - a LogarithmicAxis implementation that should make some of you very happy! &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Team Member 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; - &lt;STRONG&gt;Jafar Husain&lt;/STRONG&gt; gives some deep, technical detail about the observable model that Charting uses to enable its rich dynamic data support. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&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; - &lt;STRONG&gt;Jafar Husain&lt;/STRONG&gt; provides 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 style="COLOR: gray"&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; - &lt;STRONG&gt;Jafar Husain&lt;/STRONG&gt; explains all that it takes to completely implement a custom chart type using only the public interfaces! &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/marlat/archive/2009/07/10/treemap-control-comes-to-silverlight-toolkit.aspx" mce_href="http://blogs.msdn.com/marlat/archive/2009/07/10/treemap-control-comes-to-silverlight-toolkit.aspx"&gt;TreeMap control is coming to Silverlight Toolkit&lt;/A&gt; - &lt;STRONG&gt;Marek Latuskiewicz&lt;/STRONG&gt; introduces the new TreeMap control, explains what Interpolators are, and shows how they work. &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/gpde/pages/treemap-released-in-silverlight-toolkit.aspx" mce_href="http://blogs.msdn.com/gpde/pages/treemap-released-in-silverlight-toolkit.aspx"&gt;Treemap released in Silverlight Toolkit &lt;/A&gt;- &lt;STRONG&gt;Gareth Bradshaw&lt;/STRONG&gt; gives a great TreeMap overview that touches on all the common scenarios. &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/marlat/archive/2009/08/06/treemap-in-silverlight-toolkit-how-to-write-your-own-interpolator.aspx" mce_href="http://blogs.msdn.com/marlat/archive/2009/08/06/treemap-in-silverlight-toolkit-how-to-write-your-own-interpolator.aspx"&gt;TreeMap in Silverlight Toolkit: How to write your own interpolator&lt;/A&gt; - &lt;STRONG&gt;Marek Latuskiewicz&lt;/STRONG&gt; explains more about what Interpolators are, how they're actually used by the TreeMap control, and how to write one yourself! &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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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 style="COLOR: gray"&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;LI style="COLOR: gray"&gt;&lt;A 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" mce_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"&gt;Pineapple upside-down chart [How to: Invert the axis of a chart for "smaller is better" scenarios]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A 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" mce_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"&gt;Chart tweaking made easy [How to: Make four simple color/ToolTip changes with Silverlight/WPF Charting]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&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;Peanut butter jelly time [How to: Create a pleasing visual effect with Silverlight/WPF Charting]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&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;WPF Charting: It's official! [June 2009 release of the WPF Toolkit is now available!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A 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" mce_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"&gt;Silverlight Charting gets an update - and a TreeMap! [Silverlight Toolkit July 2009 release now available!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI style="COLOR: gray"&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx"&gt;Bringing the Silverlight Toolkit's TreeMap to WPF [Silverlight/WPF Data Visualization Development Release 0]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx"&gt;Simple column labels you can create at home! [Re-Templating the Silverlight/WPF Data Visualization ColumnDataPoint to add annotations]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;A preview of upcoming Charting changes [Silverlight/WPF Data Visualization Development Release 1]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx"&gt;Silverlight (and WPF) Data Visualization classes unsealed [Silverlight Toolkit October 2009 release now available!]&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx"&gt;Two birds, one stone [Silverlight/WPF Data Visualization Development Release 2 and DataVisualizationDemos update]&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Many, many thanks to everyone who's spent time helping others learn how to use Silverlight/WPF Data Visualization! &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 good stuff! &lt;NOBR&gt;:)&lt;/NOBR&gt; 
&lt;P&gt;&lt;STRONG&gt;PPS - The most recent version of this collection will always be pointed to by &lt;A href="http://cesso.org/r/DVLinks" mce_href="http://cesso.org/r/DVLinks"&gt;http://cesso.org/r/DVLinks&lt;/A&gt;. If you're going to link to this post, please use that URL so you'll always be up to date. &lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9914196" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>Two birds, one stone [Silverlight/WPF Data Visualization Development Release 2 and DataVisualizationDemos update]</title><link>http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx</link><pubDate>Wed, 21 Oct 2009 19:02:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9910837</guid><dc:creator>Delay</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/delay/comments/9910837.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9910837</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;The &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514"&gt;October 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; came out on Monday and the Data Visualization assembly includes some nice updates. &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx"&gt;I discussed the details of the new release&lt;/A&gt; then and promised to revise my samples to run on the new bits. While I anticipated doing things separately, it turned out to be easier to do everything at once. Here goes! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Silverlight/WPF Data Visualization Development Release 2 &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In the grand tradition of &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx"&gt;Data Visualization Development Releases&lt;/A&gt;, I've updated things to match the most recently released Toolkit code. In this case, that's the Silverlight Toolkit, so the code in the new Development Release is identical to what just went out with the Silverlight Toolkit. That means there's a bunch of &lt;STRONG&gt;new&lt;/STRONG&gt; code for WPF here! People using Data Visualization on WPF can take advantage of the latest changes by updating to the binaries included with this Development Release or by compiling the corresponding code themselves. The &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx"&gt;release notes&lt;/A&gt; detail all the changes; there's nothing to call out here. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;A href="http://cesso.org/Samples/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip" mce_href="http://cesso.org/Samples/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip"&gt;[Click here to download the SilverlightWpfDataVisualization solution including complete source code and pre-compiled binaries for both platforms.]&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;DataVisualizationDemos Sample Project Updated &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;The DataVisualizationDemos application is a collection of all the Data Visualization samples I've posted to my blog. Like the Data Visualization assembly itself, the demo application runs on Silverlight and WPF and shares the same code and XAML across both platforms. Not only is it a convenient way to look at a variety of sample code, it also has links back to the relevant blog posts for more detail about each sample. &lt;/P&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 cross-platform DataVisualizationDemos 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;&lt;STRONG&gt;Notes: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;New to this release of the DataVisualizationDemos is my &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx"&gt;simple Column annotations&lt;/A&gt; sample. &lt;/LI&gt;
&lt;LI&gt;I've added &lt;A href="http://msdn.microsoft.com/en-us/library/dd550721(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd550721(VS.95).aspx"&gt;out-of-browser support&lt;/A&gt; to the Silverlight version of DataVisualizationDemos so users can easily install it and/or run it outside the browser. &lt;/LI&gt;
&lt;LI&gt;Both flavors of DataVisualizationDemos now take advantage of custom icons for a little bit of added flair: &lt;IMG alt="DataVisualizationDemos icon" align=top src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-32.png" width=32 height=32 mce_src="http://blogs.msdn.com/blogfiles/delay/DataVisualizationDemos-32.png"&gt; &lt;/LI&gt;
&lt;LI&gt;Because this version of the Data Visualization assembly contains a breaking change, the DataVisualizationDemos project can no longer use the assembly that shipped with the WPF Toolkit (or else both platforms wouldn't be able to share the same samples). Therefore, DataVisualizationDemos uses the WPF assembly from Data Visualization Development Release 2. &lt;/LI&gt;
&lt;LI&gt;Which means TreeMap (added after the WPF Toolkit release) can now be part of the WPF version of DataVisualizationDemos! &lt;/LI&gt;
&lt;LI&gt;
&lt;P&gt;If you're doing cross-platform development, sometimes you'll come across a control that lives in two different places. When that happens, it's hard to share the same XAML for both platforms - unless you know a trick! My usual technique for this is to declare my own same-named subclass in code (which automatically resolves to the right platform-specific class thanks to the namespace): &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;DockPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : System.Windows.Controls.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DockPanel
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;And then use my "custom" control (after adding the corresponding XML namespace declaration): &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;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;DockPanel&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt; ... /&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;That works swell most of the time - except for when the class is sealed like &lt;CODE&gt;Viewbox&lt;/CODE&gt; is on Silverlight... So I came up with a slight tweak of this strategy that solves the problem: &lt;/P&gt;&lt;PRE&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; SILVERLIGHT
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Silverlight's Viewbox is sealed; simulate it with a ContentControl wrapper
&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;Viewbox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ContentControl
&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; Viewbox()
        {
            Template = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ControlTemplate&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;XamlReader&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Load(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;@"
                &amp;lt;ControlTemplate
                    xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""
                    xmlns:controls=""clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit""&amp;gt;
                    &amp;lt;controls:Viewbox&amp;gt;
                        &amp;lt;ContentPresenter/&amp;gt;
                    &amp;lt;/controls:Viewbox&amp;gt;
                &amp;lt;/ControlTemplate&amp;gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }
    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;#else
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;    public class Viewbox : System.Windows.Controls.Viewbox
    {
    }
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;#endif
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;And then just use it the same as above: &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;local&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Viewbox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt; ... /&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The latest Data Visualization release has some nice improvements - I hope these two updates help people understand the new functionality and make it even easier to upgrade! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9910837" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>Silverlight (and WPF) Data Visualization classes unsealed [Silverlight Toolkit October 2009 release now available!]</title><link>http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx</link><pubDate>Mon, 19 Oct 2009 17:22:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9909244</guid><dc:creator>Delay</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/delay/comments/9909244.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9909244</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;We've just published the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514" mce_href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=30514"&gt;October 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; as part of today's &lt;A href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" mce_href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;.NET 4 and Visual Studio 2010's Beta 2 release&lt;/A&gt;! One of the big things we've done with this release of the Toolkit is to add rich support for Visual Studio 2010's &lt;STRONG&gt;vastly improved&lt;/STRONG&gt; Silverlight design-time experience. In fact, the new VS 2010 design-time experience has gotten &lt;STRONG&gt;so&lt;/STRONG&gt; good that some developers have stopped using Blend altogether! &lt;NOBR&gt;:)&lt;/NOBR&gt; I encourage everyone to have a look at the live samples for the latest release of the &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 Toolkit&lt;/A&gt;, download the Toolkit installer, and try for yourself! &lt;/P&gt;
&lt;P&gt;Other big news for this release is the introduction of comprehensive, WPF-compatible drag-and-drop support for Silverlight! Although this support doesn't extend outside the web browser (that would require changes to Silverlight itself), it enables full-fidelity drag-and-drop experiences within the browser using the same API that WPF users are already accustomed to. And if that wasn't enough, there are also a collection of drag-and-drop-friendly "wrapper controls" for common scenarios (ex: &lt;CODE&gt;ListBox&lt;/CODE&gt;, &lt;CODE&gt;TreeView&lt;/CODE&gt;, and &lt;CODE&gt;DataGrid&lt;/CODE&gt;) that make it trivial to add support for drag-and-drop to an existing control. Dragging and dropping within a control (to re-order items) or between controls (to move items around) is now just a few lines of XAML away! (Note: &lt;STRONG&gt;No&lt;/STRONG&gt; code changes necessary!) But wait, there's more: There's also a wrapper for Charting's &lt;CODE&gt;DataPointSeries&lt;/CODE&gt; that enables drag-and-drop into and out of a live &lt;CODE&gt;Chart&lt;/CODE&gt; control! This really needs to be seen to be believed, so please visit the "Drag and Drop" page of the &lt;A href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html" mce_href="http://silverlight.net/samples/sl3/toolkitcontrolsamples/run/default.html"&gt;public samples&lt;/A&gt; for a great example of this. Then go read &lt;A href="http://themechanicalbride.blogspot.com/2009/08/new-with-silverlight-toolkit-drag-and.html" mce_href="http://themechanicalbride.blogspot.com/2009/08/new-with-silverlight-toolkit-drag-and.html"&gt;Jafar's post about the new drag/drop support&lt;/A&gt; for all the juicy details! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Note&lt;/STRONG&gt;: The October 09 release of the Silverlight Toolkit includes binaries for Silverlight 3 only. Now that Silverlight 3 has been out for a few months and is fully backward-compatible with all Silverlight 2 applications, we expect that everyone has upgraded from Silverlight 2 and are therefore no longer actively developing the Toolkit for Silverlight 2. Of course, if some of you have a specific need for Silverlight 2 Toolkit bits, previous releases continue to be available to download from CodePlex! &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With the introductory stuff out of the way, let's move on to the details of changes to the Data Visualization assembly and the corresponding improvements to &lt;A href="http://cesso.org/r/DVLinks" mce_href="http://cesso.org/r/DVLinks"&gt;Silverlight and WPF Charting&lt;/A&gt;. My recent post on &lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;Data Visualization Development Release 1&lt;/A&gt; has already discussed most of these changes at length, so I'm just going to include the change descriptions here. For more detail on the motivation behind these changes or their implications for current and future possibilities, please refer back to that post. &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;Unsealed (i.e., removed the "sealed" modifier from) all core Data Visualization classes.&lt;/STRONG&gt; Although we aren't yet completely settled on the public-facing API for Data Visualization and reserve the right to make breaking changes in the future, these classes are being unsealed now to help simplify a wide variety of user scenarios that are being actively developed and that are cumbersome without the ability to subclass (without needing to create a private build of the assembly solely for the purpose of unsealing these classes). Other changes were kept to a minimum, but a couple of methods have been changed to protected virtual for consistency and/or convenience as well as some tweaks that resulted due to new code analysis warnings due to explicit interface implementations in an unsealed class. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Introduced ISeries interface to Charting as "base interface" for all Series.&lt;/STRONG&gt; This allows users to write &lt;CODE&gt;ItemsControl&lt;/CODE&gt;-based &lt;CODE&gt;Series&lt;/CODE&gt; which will automatically leverage all of the &lt;CODE&gt;ItemsControl&lt;/CODE&gt; infrastructure for creating points, tracking data changes, etc. and also gives us a safe root for a future 3D series hierarchy. As part of this change, some interfaces have been cleaned up a bit (&lt;CODE&gt;IStyleDispenser&lt;/CODE&gt;, &lt;CODE&gt;ISeriesHost&lt;/CODE&gt;) and others have been created (&lt;CODE&gt;IStyleDispenser.StylesChanged&lt;/CODE&gt; event). Also, some public methods with little justification have been removed/made private/moved lower (&lt;CODE&gt;Chart.Refresh&lt;/CODE&gt;, &lt;CODE&gt;Chart.ResetStyles&lt;/CODE&gt;, &lt;CODE&gt;StyleDispenser.ResetStyles&lt;/CODE&gt;) and some vestigial code has been removed (&lt;CODE&gt;ISeriesHost.GlobalSeriesIndexesInvalidated&lt;/CODE&gt;). &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Various usability improvements.&lt;/STRONG&gt; Updated &lt;CODE&gt;Series&lt;/CODE&gt; to look for "LegendItemStyle" in their &lt;CODE&gt;ResourceDictionary&lt;/CODE&gt; for increased customizability. Added &lt;CODE&gt;Owner&lt;/CODE&gt; property to &lt;CODE&gt;LegendItem&lt;/CODE&gt; pointing to owning &lt;CODE&gt;Series&lt;/CODE&gt; instance to simplify &lt;CODE&gt;LegendItem&lt;/CODE&gt;-based user scenarios. Added &lt;CODE&gt;ActualDataPointStyle&lt;/CODE&gt; and &lt;CODE&gt;ActualLegendItemStyle&lt;/CODE&gt; properties and used &lt;CODE&gt;Bindings&lt;/CODE&gt; to automatically propagate changes to the right places. (Aside: This fixes a bug that was reported against the WPF Toolkit &lt;EM&gt;as I was making the change&lt;/EM&gt;!) Moved code so that &lt;CODE&gt;PieSeries&lt;/CODE&gt; now has the &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; property like the other &lt;CODE&gt;Series&lt;/CODE&gt;. Updated &lt;CODE&gt;LegendItem&lt;/CODE&gt; default &lt;CODE&gt;Template&lt;/CODE&gt; to include standard &lt;CODE&gt;TemplateBindings&lt;/CODE&gt; for &lt;CODE&gt;Background&lt;/CODE&gt;/&lt;CODE&gt;BorderBrush&lt;/CODE&gt;/&lt;CODE&gt;BorderThickness&lt;/CODE&gt; for more friendly designer experience. &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;Renamed Charting's StylePalette to Palette (for clarity) AND changed its type to IEnumerable&amp;lt;ResourceDictionary&amp;gt; (from IEnumerable&amp;lt;Style&amp;gt;) for a significant flexibility boost.&lt;/STRONG&gt; Performed related renamings (many internal/private): &lt;CODE&gt;IStyleDispenser&lt;/CODE&gt;-&amp;gt;&lt;CODE&gt;IResourceDictionaryDispenser&lt;/CODE&gt;, &lt;CODE&gt;StylePalette&lt;/CODE&gt;-&amp;gt;&lt;CODE&gt;ResourceDictionaryCollection&lt;/CODE&gt;, &lt;CODE&gt;StyleDispensedEventArgs&lt;/CODE&gt;-&amp;gt;&lt;CODE&gt;ResourceDictionaryDispensedEventArgs&lt;/CODE&gt;, &lt;CODE&gt;StyleDispenser&lt;/CODE&gt;-&amp;gt;&lt;CODE&gt;ResourceDictionaryDispenser&lt;/CODE&gt;, &lt;CODE&gt;StyleEnumerator&lt;/CODE&gt;-&amp;gt;&lt;CODE&gt;ResourceDictionaryEnumerator&lt;/CODE&gt;. &lt;BR&gt;&lt;BR&gt;Most notably, this change makes it possible to associate MULTIPLE things with a palette entry and enables designers to easily and flexibly customize things like the &lt;CODE&gt;LineSeries&lt;/CODE&gt; &lt;CODE&gt;PolyLineStyle&lt;/CODE&gt; in the &lt;CODE&gt;Palette&lt;/CODE&gt;. Additionally it enables the use of &lt;CODE&gt;DynamicResource&lt;/CODE&gt; (currently only supported by the WPF platform) to let users customize their &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; &lt;EM&gt;without&lt;/EM&gt; inadvertently losing the default/custom Palette colors. (Note: A &lt;STRONG&gt;very&lt;/STRONG&gt; popular request!) Thanks to merged &lt;CODE&gt;ResourceDictionaries&lt;/CODE&gt;, this also enables the addition of arbitrary resources at the &lt;CODE&gt;Palette&lt;/CODE&gt; level (like &lt;CODE&gt;Brushes&lt;/CODE&gt;) which can then be referenced by &lt;CODE&gt;DataPoints&lt;/CODE&gt;, etc.. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Changed return value of Charting's IAxis.GetPlotAreaCoordinate from UnitValue? to UnitValue to better support custom Axis implementations.&lt;/STRONG&gt; Specifically, some numeric axis types (logarithmic axis, for example) don't support all numeric values and need a way to indicate that certain values (ex: &amp;lt;= 0 for logarithmic) are "not supported" for plotting. This was previously done by returning a &lt;CODE&gt;null&lt;/CODE&gt; value, but now the code should return a &lt;CODE&gt;UnitValue&lt;/CODE&gt; with &lt;CODE&gt;Value=double.NaN&lt;/CODE&gt;. Convenience method &lt;CODE&gt;UnitValue.NaN&lt;/CODE&gt; has been added to create such values easily. Because the &lt;CODE&gt;Series&lt;/CODE&gt; implementations already need to handle &lt;CODE&gt;NaN&lt;/CODE&gt; values, this change collapses two different edge cases into one and simplifies the code accordingly. Added code to &lt;CODE&gt;Series&lt;/CODE&gt; to handle this situation by hiding (via &lt;CODE&gt;Visibility=Collapsed&lt;/CODE&gt;) &lt;CODE&gt;DataPoints&lt;/CODE&gt; on coordinates that are not valid. &lt;/P&gt;
&lt;P&gt;One notable consequence of this change is that the &lt;CODE&gt;Visibility&lt;/CODE&gt; of &lt;CODE&gt;DataPoint&lt;/CODE&gt;s is now controlled by the &lt;CODE&gt;Series&lt;/CODE&gt; and will be set to &lt;CODE&gt;Visible&lt;/CODE&gt; or &lt;CODE&gt;Collapsed&lt;/CODE&gt; as necessary. Therefore, any customizations that directly set this property may no longer work, but there are other simple ways of achieving the same effect and this change is not expected to cause any difficulty. For example, the "Sparkline" demo of the samples project was affected by this change because it provided a custom &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; that set &lt;CODE&gt;Visibility&lt;/CODE&gt; to &lt;CODE&gt;Collapsed&lt;/CODE&gt;. The fix is not only trivial, but an improvement: change the &lt;CODE&gt;Style&lt;/CODE&gt; to specify a &lt;CODE&gt;null&lt;/CODE&gt; &lt;CODE&gt;Template&lt;/CODE&gt; instead! &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;Remove unnecessary code.&lt;/STRONG&gt; Moved duplicated &lt;CODE&gt;DependencyProperties&lt;/CODE&gt; &lt;CODE&gt;IRangeAxis&lt;/CODE&gt; &lt;CODE&gt;DependentRangeAxis&lt;/CODE&gt; and &lt;CODE&gt;IAxis&lt;/CODE&gt; &lt;CODE&gt;IndependentAxis&lt;/CODE&gt; from &lt;CODE&gt;ColumnSeries&lt;/CODE&gt; and &lt;CODE&gt;BarSeries&lt;/CODE&gt; into common base class &lt;CODE&gt;ColumnBarBaseSeries&lt;/CODE&gt;. Moved duplicated &lt;CODE&gt;DependencyProperties&lt;/CODE&gt; &lt;CODE&gt;IRangeAxis&lt;/CODE&gt; &lt;CODE&gt;DependentRangeAxis&lt;/CODE&gt; and &lt;CODE&gt;IAxis&lt;/CODE&gt; &lt;CODE&gt;IndependentAxis&lt;/CODE&gt; from &lt;CODE&gt;AreaSeries&lt;/CODE&gt; and &lt;CODE&gt;LineSeries&lt;/CODE&gt; into common base class &lt;CODE&gt;LineAreaBaseSeries&lt;/CODE&gt;. Made similar changes for methods &lt;CODE&gt;OnApplyTemplate&lt;/CODE&gt; and &lt;CODE&gt;UpdateDataPoint&lt;/CODE&gt; and half of &lt;CODE&gt;UpdateShape&lt;/CODE&gt;. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Simplified default Palette Brushes by removing ScaleTransform and TranslateTransform and replacing with RadialBrush.&lt;/STRONG&gt; The on-screen visuals remain the same, but the XAML is considerably smaller and simpler - and should be a bit quicker to render as well! &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Various other small changes.&lt;/STRONG&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Of the two breaking changes, only the rename to &lt;CODE&gt;Palette&lt;/CODE&gt; is likely to affect most people. Fortunately, converting existing code/XAML is really quite simple - which you can see as I recycle the example I gave &lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;previously&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;The &lt;STRONG&gt;old&lt;/STRONG&gt; way: &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;chartingToolkit&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: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Statistics (Custom Palette)"&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.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;visualizationToolkit&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;="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;="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;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;="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;="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;="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;visualizationToolkit&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.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;chartingToolkit&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;And the &lt;STRONG&gt;new&lt;/STRONG&gt; way (with changes highlighted): &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;chartingToolkit&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: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Statistics (Custom Palette)"&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;Palette&lt;/SPAN&gt;&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;visualizationToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;ResourceDictionaryCollection&lt;/SPAN&gt;&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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&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="BACKGROUND-COLOR: yellow"&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;="DataPointStyle"&lt;/SPAN&gt;&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;="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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&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;ResourceDictionary&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; 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;="DataPointStyle"&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;="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;ResourceDictionary&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;ResourceDictionary&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; 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;="DataPointStyle"&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;="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;ResourceDictionary&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;visualizationToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;ResourceDictionaryCollection&lt;/SPAN&gt;&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;Palette&lt;/SPAN&gt;&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;chartingToolkit&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's pretty clear that once you've done this once, it'll be easy to do anywhere else your project requires. I explained the motivations for this change previously, so I won't repeat myself here - I just wanted to call out how straightforward the upgrade is expected to be. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Clearly, the big news for Data Visualization is the unsealing of the primary charting classes! Because I went into great detail on this &lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;earlier&lt;/A&gt;, I won't spend a lot of time on that here. Instead, I'd like to call out a particularly timely and relevant use of the new subclassing ability: &lt;A href="http://www.cplotts.com/" mce_href="http://www.cplotts.com/"&gt;Cory Plotts'&lt;/A&gt; &lt;A href="http://www.cplotts.com/2009/10/09/wpf-silverlight-charting-a-logarithmic-axis/" mce_href="http://www.cplotts.com/2009/10/09/wpf-silverlight-charting-a-logarithmic-axis/"&gt;LogarithmicAxis implementation for WPF and Silverlight&lt;/A&gt;! What's great about what he's done is that logarithmic axis support is one of our most requested features, and something we haven't had a chance to implement yet. I've always hoped that somebody in the community would be able to step up and share something here, so I was really excited to see Cory's blog post. If you're one of the users who's been waiting for a logarithmic axis, please have a look at Cory's implementation and see if it does what you need! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: You might be wondering why we haven't gotten to logarithmic axis ourselves... Well, as you may be aware, we've been operating under severe resource constraints from the beginning, and that forces us to try to choose our investments carefully. When we're trying to decide between two features and one of them constitutes a change to the core of the Charting framework while the other is something that derives from an existing class to build on top of the framework, we'll tend to make the core framework change and hope that the community is able to help with the subclassing change. Honestly, this seems like the right balance to me and is a large part of why we're unsealing now even though the Charting APIs aren't completely set in stone. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Along similar lines, I encourage people who have been wanting to annotate their &lt;CODE&gt;PieSeries&lt;/CODE&gt; charts to have a look at the fantastic work &lt;A href="http://bea.stollnitz.com/blog/" mce_href="http://bea.stollnitz.com/blog/"&gt;Bea Stollnitz&lt;/A&gt; has done: &lt;A href="http://bea.stollnitz.com/blog/?p=353" mce_href="http://bea.stollnitz.com/blog/?p=353"&gt;Part 1&lt;/A&gt;, &lt;A href="http://bea.stollnitz.com/blog/?p=363" mce_href="http://bea.stollnitz.com/blog/?p=363"&gt;Part 2&lt;/A&gt;, &lt;A href="http://bea.stollnitz.com/blog/?p=366" mce_href="http://bea.stollnitz.com/blog/?p=366"&gt;Part 3&lt;/A&gt;. Bea built on top of the sealed Charting hierarchy using some pretty clever tricks and techniques. But now that we've unsealed, it's my hope that she'll be able to take advantage of that to spend more time working on the great features she's adding and less time trying to jump through artificial hoops. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two other things I'd like to call out here: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;I'll post an updated version of 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;DataVisualizationDemos sample application&lt;/A&gt; in the next couple of days to make sure people have lots of good Charting examples using the new &lt;CODE&gt;Palette&lt;/CODE&gt; syntax. &lt;/LI&gt;
&lt;LI&gt;I'll post a new &lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;Silverlight/WPF Data Visualization Development Release&lt;/A&gt; shortly after that to give anyone who wants pre-compiled binaries for WPF (or an easy way to compile for both platforms at once) what they need to be successful. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As always, if you have any questions or feedback, the right places to start are the &lt;A href="http://forums.silverlight.net/forums/35.aspx" mce_href="http://forums.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 mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Thanks very much for your interest in Silverlight and WPF Data Visualization - I hope you like the improvements!&lt;/STRONG&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9909244" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>If it walks like a duck and talks like a duck, it must be a ... TreeGrid! [A simple, XAML-only TreeGrid UI for WPF]</title><link>http://blogs.msdn.com/delay/archive/2009/09/23/if-it-walks-like-a-duck-and-talks-like-a-duck-it-must-be-a-treegrid-a-simple-xaml-only-treegrid-ui-for-wpf.aspx</link><pubDate>Thu, 24 Sep 2009 08:14:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9898803</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9898803.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9898803</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;If you've done much work with WPF or Silverlight, chances are you already know what a &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; is and what a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid(VS.100).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid(VS.100).aspx"&gt;DataGrid&lt;/A&gt; is. You know that a &lt;CODE&gt;TreeView&lt;/CODE&gt; is good for showing hierarchical data and a &lt;CODE&gt;DataGrid&lt;/CODE&gt; is good for showing tabular data. But you may not know about their hybrid love child, the &lt;CODE&gt;TreeGrid&lt;/CODE&gt; - and that's what this post is about. &lt;/P&gt;
&lt;P&gt;Sometimes you've got data that's basically tabular in nature, yet also has a hierarchical aspect, and you'd like to leverage that to give people control over the level of detail they're seeing. Most commonly, you'll see a &lt;CODE&gt;TreeGrid&lt;/CODE&gt; used when the tabular data can be nicely summarized (or "rolled up") into hierarchical groupings. For example, a list of people's name and address would &lt;STRONG&gt;not&lt;/STRONG&gt; make a good &lt;CODE&gt;TreeGrid&lt;/CODE&gt;, because there's no natural grouping that makes sense (you can't combine addresses). However, a list of people's company and salary &lt;STRONG&gt;might&lt;/STRONG&gt; make a good &lt;CODE&gt;TreeGrid&lt;/CODE&gt; because it's natural to group by job and the aggregated salary information could be informative (either as an average or as a sum). &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: You might wonder if &lt;A href="http://timheuer.com/blog/archive/2009/04/08/grouping-in-silverlight-datagrid.aspx" mce_href="http://timheuer.com/blog/archive/2009/04/08/grouping-in-silverlight-datagrid.aspx"&gt;DataGrid's native support for grouping&lt;/A&gt; would be useful here. In my experience, &lt;CODE&gt;DataGrid&lt;/CODE&gt;s don't tend to summarize the grouped data like we want - but if you have examples to the contrary, I'd love to see them. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;So with all this talk about &lt;CODE&gt;TreeGrid&lt;/CODE&gt;, you might expect to find one in the Silverlight or WPF framework, or perhaps as part of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; or &lt;A href="http://wpf.codeplex.com/" mce_href="http://wpf.codeplex.com/"&gt;WPF Toolkit&lt;/A&gt;. But you won't - it's just not used frequently enough to have made it to the big leagues yet. The good news is that a bit of &lt;A href="http://www.bing.com/search?q=TreeGrid+and+%28WPF+or+Silverlight%29&amp;amp;form=QBRE&amp;amp;qs=n" mce_href="http://www.bing.com/search?q=TreeGrid+and+%28WPF+or+Silverlight%29&amp;amp;form=QBRE&amp;amp;qs=n"&gt;web&lt;/A&gt; &lt;A href="http://www.google.com/search?hl=en&amp;amp;q=TreeGrid+and+%28WPF+or+Silverlight%29&amp;amp;aq=f&amp;amp;oq=&amp;amp;aqi=" mce_href="http://www.google.com/search?hl=en&amp;amp;q=TreeGrid+and+%28WPF+or+Silverlight%29&amp;amp;aq=f&amp;amp;oq=&amp;amp;aqi="&gt;searching&lt;/A&gt; will turn up some third-party &lt;CODE&gt;TreeGrid&lt;/CODE&gt; options that definitely seem worth evaluating. But because I'm cheap and a show-off - and occasionally fall victim to a little &lt;A href="http://en.wikipedia.org/wiki/Not_Invented_Here" mce_href="http://en.wikipedia.org/wiki/Not_Invented_Here"&gt;NIH&lt;/A&gt; - I decided to craft a &lt;CODE&gt;TreeGrid&lt;/CODE&gt;-like experience using only the WPF &lt;CODE&gt;TreeView&lt;/CODE&gt; control, a couple of &lt;CODE&gt;Grid&lt;/CODE&gt;s, and some XAML. &lt;/P&gt;
&lt;P&gt;That's right - &lt;STRONG&gt;no&lt;/STRONG&gt; code, just XAML! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how my SimpleTreeGridUX sample looks with some data I made up about the schedule of a fictional developer: &lt;/P&gt;&lt;IMG alt="SimpleTreeGridUX sample" src="http://blogs.msdn.com/blogfiles/delay/SimpleTreeGridUX.png" width=380 height=339 mce_src="http://blogs.msdn.com/blogfiles/delay/SimpleTreeGridUX.png"&gt; 
&lt;P&gt;And here's the complete XAML: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- TreeGrid "Control" --&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BorderBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Black"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BorderThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Resources --&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;Border.Resources&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; 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;="TextBlockStyle"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&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;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TextBlock&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;="Margin"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="3 0 3 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;Style&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;="TextBlockBoldStyle"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TargetType&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;Type&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BasedOn&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; TextBlockStyle&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;="FontWeight"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Value&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;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;Border.Resources&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;!-- Content --&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;Grid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.IsSharedSizeScope&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;Grid.RowDefinitions&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;RowDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Auto"/&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;RowDefinition&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;Grid.RowDefinitions&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;!-- Column headers --&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;TreeViewItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Row&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BorderThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"&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;TreeViewItem.Header&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;Grid&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;Grid.ColumnDefinitions&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Task"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Placeholders for two columns of ToggleButton --&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Toggle"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Toggle"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Duration"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Notes"/&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;Grid.ColumnDefinitions&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Task"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockBoldStyle&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;!-- Empty TreeViewItem to measure the size of its ToggleButton into the "Toggle" group--&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;TreeViewItem&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Padding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="3"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Duration"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockBoldStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="4"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Notes"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockBoldStyle&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;Grid&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;TreeViewItem.Header&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;TreeViewItem&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;!-- Data rows --&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;TreeView&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Row&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="1"&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: #ff0000"&gt; SubItems&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BorderBrush&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Gray"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; BorderThickness&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0 1 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;TreeView.ItemTemplate&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;!-- Level 0 template leaves space for 2 child "Toggle" levels --&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;HierarchicalDataTemplate&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: #ff0000"&gt; SubItems&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;Grid&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;Grid.ColumnDefinitions&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Task"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Toggle"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Toggle"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Duration"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Notes"/&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;Grid.ColumnDefinitions&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Task&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="3"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Duration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="4"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Notes&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;Grid&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;!-- Level 1 template leaves space for 1 child "Toggle" level --&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;HierarchicalDataTemplate.ItemTemplate&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;HierarchicalDataTemplate&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: #ff0000"&gt; SubItems&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;Grid&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;Grid.ColumnDefinitions&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Task"/&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;ColumnDefinition&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Toggle"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Duration"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Notes"/&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;Grid.ColumnDefinitions&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Task&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="3"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Duration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="4"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Notes&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;Grid&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;!-- Level 2 template has no children --&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;HierarchicalDataTemplate.ItemTemplate&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;HierarchicalDataTemplate&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: #ff0000"&gt; SubItems&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;Grid&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;Grid.ColumnDefinitions&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Task"/&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;ColumnDefinition&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;ColumnDefinition&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Duration"/&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;ColumnDefinition&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; SharedSizeGroup&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Notes"/&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;Grid.ColumnDefinitions&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Task&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="3"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Duration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;TextBlock&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Grid.Column&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="4"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Text&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; Notes&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;}"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Style&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; TextBlockStyle&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;Grid&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;HierarchicalDataTemplate&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;HierarchicalDataTemplate.ItemTemplate&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;HierarchicalDataTemplate&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;HierarchicalDataTemplate.ItemTemplate&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;HierarchicalDataTemplate&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;TreeView.ItemTemplate&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;TreeView&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;Grid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Border&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;Notes: &lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;There are two "tricks" I use to get &lt;CODE&gt;DataGrid&lt;/CODE&gt;-like behavior from a &lt;CODE&gt;TreeView&lt;/CODE&gt;. The first is the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.issharedsizescope.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.issharedsizescope.aspx"&gt;Grid.IsSharedSizeScope&lt;/A&gt; attached &lt;CODE&gt;DependencyProperty&lt;/CODE&gt; and its partner-in-crime &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.definitionbase.sharedsizegroup.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.definitionbase.sharedsizegroup.aspx"&gt;DefinitionBase.SharedSizeGroup&lt;/A&gt;. (Both available only on WPF for now.) By setting &lt;CODE&gt;IsSharedSizeScope&lt;/CODE&gt; on a parent element and &lt;CODE&gt;SharedSizeGroup&lt;/CODE&gt; on some of the column/row definitions of &lt;CODE&gt;Grid&lt;/CODE&gt;s within it, it's possible to "link" the sizes of cells across different &lt;CODE&gt;Grid&lt;/CODE&gt;s. In the scenario above, that sharing takes place across the separate &lt;CODE&gt;Grid&lt;/CODE&gt;s of the column headers and each &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; row of data. In this manner, same-width columns are created for the "Task", "Duration", and "Notes" fields so they all line up properly. Except that they wouldn't actually line up if it weren't for... &lt;/LI&gt;
&lt;LI&gt;The "Toggle" shared size group which is used to offset &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; children to take into account the indent that &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; parents automatically impose on them. The following diagram of the default &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; layout should help explain what I mean: 
&lt;TABLE style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BACKGROUND-COLOR: white; MARGIN: 10px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid" cellSpacing=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: cyan; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; PADDING-TOP: 4px"&gt;◊&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: lime; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; PADDING-TOP: 4px"&gt;Header&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD style="BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: orange; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 1px; PADDING-TOP: 4px"&gt;Children&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;You see, each collection of children is offset to the right by exactly the width of the &lt;CODE&gt;TreeViewItem&lt;/CODE&gt;'s toggle element. So if all we did was make each column's cells the same width, things wouldn't actually line up because of this offset showing up in different amounts everywhere: 
&lt;TABLE style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BACKGROUND-COLOR: white; MARGIN: 10px; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid" cellSpacing=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: cyan; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; PADDING-TOP: 4px"&gt;◊&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: lime; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; PADDING-TOP: 4px"&gt;Header&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD style="BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: orange; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 1px; PADDING-TOP: 4px"&gt;
&lt;TABLE style="BORDER-BOTTOM: black 1px solid; BORDER-LEFT: black 1px solid; BACKGROUND-COLOR: white; BORDER-TOP: black 1px solid; BORDER-RIGHT: black 1px solid" cellSpacing=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: cyan; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-LEFT-WIDTH: 1px; PADDING-TOP: 4px"&gt;◊&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: 1px solid; BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: lime; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; PADDING-TOP: 4px"&gt;Header&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;/TD&gt;
&lt;TD style="BORDER-LEFT: 1px solid; PADDING-BOTTOM: 4px; BORDER-RIGHT-WIDTH: 1px; BACKGROUND-COLOR: orange; PADDING-LEFT: 4px; PADDING-RIGHT: 4px; BORDER-TOP-WIDTH: 1px; BORDER-BOTTOM-WIDTH: 1px; PADDING-TOP: 4px"&gt;Children&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;So what I've done is add a special shared size group with exactly the same width as the toggle (this is what the empty &lt;CODE&gt;TreeViewItem&lt;/CODE&gt; in the header section of the XAML is for). Having done that, the "Toggle" size group can be used to simulate the width of the actual toggle anywhere it's needed. Therefore, I'm able to insert the appropriate counter-offset for each level of the tree - and everything lines up beautifully! &lt;/LI&gt;
&lt;LI&gt;You've probably noticed that there's an unfortunate amount of XAML duplication above - each of the three &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.hierarchicaldatatemplate.aspx"&gt;HierarchicalDataTemplate&lt;/A&gt;s are very nearly identical. In fact, the &lt;STRONG&gt;only&lt;/STRONG&gt; difference among them is whether the second and third &lt;CODE&gt;ColumnDefinition&lt;/CODE&gt; have the &lt;CODE&gt;SharedSizeGroup&lt;/CODE&gt; property or not. Now, I strive to stay as &lt;A href="http://en.wikipedia.org/wiki/DRY" mce_href="http://en.wikipedia.org/wiki/DRY"&gt;DRY&lt;/A&gt; as the next guy, and I tried to come up with a way to collapse the three templates into one. But while I could do so quite easily using a bit of code, I couldn't come up with a nice way that was pure XAML. 
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: Converting the template contents to a &lt;CODE&gt;UserControl&lt;/CODE&gt; gets close, but there's still the problem of toggling that property based on external input. And while it would definitely be possible to decorate the (view) model with information about each element's level, I considered that to be "cheating" for the purposes of this exercise. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/BLOCKQUOTE&gt;&lt;/LI&gt;&lt;/UL&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/SimpleTreeGridUX/SimpleTreeGridUX.zip" mce_href="http://cesso.org/Samples/SimpleTreeGridUX/SimpleTreeGridUX.zip"&gt;[Click here to download the complete source code for the SimpleTreeGridUX sample.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just in case it's not really obvious by now, what I describe here is &lt;STRONG&gt;not&lt;/STRONG&gt; a true &lt;CODE&gt;TreeGrid&lt;/CODE&gt; control! While I'll suggest that it &lt;STRONG&gt;looks&lt;/STRONG&gt; like a real &lt;CODE&gt;TreeGrid&lt;/CODE&gt;, behaves mostly like one, and is probably good enough for many scenarios, I'm also the first to acknowledge it's not a &lt;STRONG&gt;true&lt;/STRONG&gt; &lt;CODE&gt;TreeGrid&lt;/CODE&gt;. A true &lt;CODE&gt;TreeGrid&lt;/CODE&gt; would probably have an extensive API for managing columns and rows, allow sorting and arbitrary nesting, and end up with an object model pretty similar to &lt;CODE&gt;DataGrid&lt;/CODE&gt;'s. So if you came here looking for a proper &lt;CODE&gt;TreeGrid&lt;/CODE&gt; control, I'm sorry to disappoint you - but if you came here hoping to learn more about solving real-world problems with WPF, I hope this has been educational! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9898803" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category></item><item><title>I get by with a little help from my friends [PieSeries annotations trilogy complete!]</title><link>http://blogs.msdn.com/delay/archive/2009/09/21/i-get-by-with-a-little-help-from-my-friends-pieseries-annotations-trilogy-complete.aspx</link><pubDate>Mon, 21 Sep 2009 10:37:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9897448</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9897448.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9897448</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;Friend and fellow Charting fan &lt;A href="http://bea.stollnitz.com/blog/" mce_href="http://bea.stollnitz.com/blog/"&gt;Bea Stollnitz&lt;/A&gt; has just completed a 3-post series describing how to add annotations to pie charts created by the Data Visualization package that's part of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; and &lt;A href="http://wpf.codeplex.com/" mce_href="http://wpf.codeplex.com/"&gt;WPF Toolkit&lt;/A&gt;. Because annotations are a feature that we'd love to implement ourselves (but haven't had time for yet), I'm delighted that someone in the community has taken this task on - and shared the experience for the benefit of others! &lt;/P&gt;
&lt;P&gt;Here are direct links to Bea's posts: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=353" mce_href="http://bea.stollnitz.com/blog/?p=353"&gt;How can I add labels to a WPF pie chart?&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=363" mce_href="http://bea.stollnitz.com/blog/?p=363"&gt;How can I add labels to a WPF pie chart? – Implementation details&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://bea.stollnitz.com/blog/?p=366" mce_href="http://bea.stollnitz.com/blog/?p=366"&gt;How can I port the WPF labeled pie chart to Silverlight?&lt;/A&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;My thanks go out to Bea for sharing her time and expertise here - I hope others find this as cool as I do! :) &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PS&lt;/STRONG&gt; - Please note that while a number of WPF-to-Silverlight incompatibilities are identified in the third post, &lt;STRONG&gt;none&lt;/STRONG&gt; of them come from the Data Visualization assembly. We've specifically spent a good bit of effort to make the Silverlight and WPF code/XAML experience identical for Data Visualization; it's the success of projects like this one that are the reason and reward! &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PPS&lt;/STRONG&gt; - In the next release of the Data Visualization assembly (&lt;A href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx"&gt;which you can preview now!&lt;/A&gt;), the core Charting classes will no longer be sealed and some of the inconvenience mentioned in the second post should go away. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PPPS&lt;/STRONG&gt; - &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/27/simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx"&gt;Here's my own take on a quick-and-easy way to add simple annotations to ColumnSeries.&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PPPPS&lt;/STRONG&gt; - If you're looking for more information about the Silverlight/WPF Data Visualization assembly, &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx"&gt;I've collected a bunch of links from across the web - including all of my own introductions and notes&lt;/A&gt;. &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897448" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>A preview of upcoming Charting changes [Silverlight/WPF Data Visualization Development Release 1]</title><link>http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx</link><pubDate>Mon, 14 Sep 2009 09:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9894842</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9894842.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9894842</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;It was about two months ago that I posted about &lt;A href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx"&gt;Silverlight/WPF Data Visualization Development Release 0&lt;/A&gt;. At the time, I explained how I was hoping to do occasional, out-of-band releases of the Data Visualization assembly that's part of the &lt;A href="http://silverlight.codeplex.com/" mce_href="http://silverlight.codeplex.com/"&gt;Silverlight Toolkit&lt;/A&gt; and &lt;A href="http://wpf.codeplex.com/" mce_href="http://wpf.codeplex.com/"&gt;WPF Toolkit&lt;/A&gt; in order to give people an early glimpse of upcoming changes and maybe get a bit of feedback along the way. &lt;/P&gt;
&lt;P&gt;It's that time again... &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Announcing &lt;STRONG&gt;Silverlight/WPF Data Visualization Development Release 1&lt;/STRONG&gt;! &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As usual, there have been plenty of distractions these past weeks to keep us, um..., distracted - but we've still managed to make some significant architectural tweaks that I think people are going to appreciate. Maybe a little less so in the short term because there are a couple of breaking changes, but definitely in the long term because these changes enable some very interesting scenarios and should do a lot to make it easier to develop with the Data Visualization framework. &lt;/P&gt;
&lt;P&gt;Please bear in mind that this is just a development release, so it hasn't gone through the same level of scrutiny that our official releases get. Therefore, there may be some behavioral anomalies - and if there are, I apologize in advance. So if you &lt;STRONG&gt;do&lt;/STRONG&gt; find an issue, please contact me (by leaving a comment below or by clicking the &lt;A href="http://blogs.msdn.com/delay/contact.aspx" mce_href="http://blogs.msdn.com/delay/contact.aspx"&gt;Email&lt;/A&gt; link on my blog) as I'd love to fix whatever I can before the next official release! &lt;/P&gt;
&lt;P&gt;Because I'm trying to keep the cost of doing Development Releases down, I'm not doing my usual long-winded write up of new features. Instead, I'm going to include the notable changeset descriptions from our source control system along with a few brief notes. If that isn't enough detail to get you excited, then you're probably not the target audience for these Development Releases. &lt;NOBR&gt;;)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Notable Changes (from the check-in comments)&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Unseal (i.e., remove the "sealed" modifier) from all Data Visualization classes that were previously sealed. Although we aren't yet completely settled on the public-facing API for Data Visualization and reserve the right to make breaking changes in the future, these classes are being unsealed now to help simplify a wide variety of user scenarios that are being actively developed and that are cumbersome without the ability to subclass (without needing to create a private build of the assembly solely for the purpose of unsealing these classes). Other changes were kept to a minimum, but a couple of methods have been changed to protected virtual for consistency and/or convenience as well as some tweaks that resulted due to new code analysis warnings due to explicit interface implementations in an unsealed class. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;While this is the most controversial change, I think it's the right thing for us to do now. The concern is that people will take our unsealing as encouragement to go off and subclass everything - and then be disappointed/frustrated when they need to change their code after we make some subsequent breaking change to the API. And I sympathize with this concern - so &lt;STRONG&gt;if you're worried about this happening to you, just pretend everything's still sealed for now&lt;/STRONG&gt;. The official indication that the API has stabilized will be when the classes in the Data Visualization assembly change &lt;A href="http://silverlight.codeplex.com/Wiki/View.aspx?title=Quality%20Bands" mce_href="http://silverlight.codeplex.com/Wiki/View.aspx?title=Quality%20Bands"&gt;quality bands&lt;/A&gt; from &lt;CODE&gt;Preview&lt;/CODE&gt; (their current band) to &lt;CODE&gt;Stable&lt;/CODE&gt;. That's not happening yet, so please be aware that there's a certain amount of risk when making the decision to build on the current API. &lt;/P&gt;
&lt;P&gt;That said, I'm of the opinion that we have little to lose with this because the decision is entirely in the customers' hands. If you don't want the risk, don't take it. But if you're doing something cool with Charting and wish you could subclass to avoid a bunch of additional effort, then this change is for you. &lt;NOBR&gt;:)&lt;/NOBR&gt; For instance, &lt;A href="http://bea.stollnitz.com/blog/?p=363" mce_href="http://bea.stollnitz.com/blog/?p=363"&gt;Bea Stollnitz is doing some cool stuff with adding annotations to PieSeries&lt;/A&gt; - and she's basically called us out in that post for making her task harder because our classes are sealed. Well, discouraging folks from using the Data Visualization assembly is the &lt;STRONG&gt;last&lt;/STRONG&gt; thing I'm trying to do - so we're unsealing now to help make the platform as friendly as possible. &lt;/P&gt;
&lt;P&gt;And while you're busy taking advantage of the new ability to subclass, I fully expect there will be places we haven't exposed all the extensibility points people want. When that happens, &lt;STRONG&gt;please let me know&lt;/STRONG&gt;, and we'll look into addressing that oversight in a future release. Think of it as the "You scratch our backs, we'll scratch yours" model of software development... &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Introduce ISeries interface to Charting as "base interface" for all Series. This will allow users to write ItemsControl-based Series which will automatically leverage all of the ItemsControl infrastructure for creating points, tracking data changes, etc. and also gives us a safe root for a future 3D series hierarchy. As part of this change, some interfaces have been cleaned up a bit (IStyleDispenser, ISeriesHost) and others have been created (IStyleDispenser.StylesChanged event). Also, some public methods with little justification have been removed/made private/moved lower (Chart.Refresh, Chart.ResetStyles, StyleDispenser.ResetStyles) and some vestigial code has been removed (ISeriesHost.GlobalSeriesIndexesInvalidated). Aside from adjusting for renamed/deleted functionality, all tests continue to pass as-is. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are two pretty big wins from this change - so go back and re-read that paragraph if you weren't paying attention. We've prototyped &lt;STRONG&gt;both&lt;/STRONG&gt; an &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;-based &lt;CODE&gt;PieSeries&lt;/CODE&gt; and a (WPF-only) &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.viewport3d.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.viewport3d.aspx"&gt;Viewport3D&lt;/A&gt;-based &lt;CODE&gt;PieSeries&lt;/CODE&gt; and the results are very promising! Simply by changing our base &lt;CODE&gt;Series&lt;/CODE&gt; contract from a class to an interface, we give people with simple needs the ability to leverage the existing &lt;CODE&gt;ItemsControl&lt;/CODE&gt; framework and significantly decrease the amount of code they need to understand and interact with. (&lt;STRONG&gt;Aside&lt;/STRONG&gt;: There have even been suggestions to change our existing series over to use this model!) And the benefits for 3D are also compelling - though further off in the future due to a variety of open issues and unanswered questions. I'm not going to dwell on the implications of this change more right now, but there are obviously some cool possibilities that I'd love to see folks start to explore. (&lt;EM&gt;Hint, hint, friends of Charting...&lt;/EM&gt;) &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Rename Charting's StylePalette to Palette (for clarity) AND change its type to IEnumerable&amp;lt;ResourceDictionary&amp;gt; (from IEnumerable&amp;lt;Style&amp;gt;) for a significant flexibility boost. Perform related renamings (many internal/private): IStyleDispenser-&amp;gt;IResourceDictionaryDispenser, StylePalette-&amp;gt;ResourceDictionaryCollection, StyleDispensedEventArgs-&amp;gt;ResourceDictionaryDispensedEventArgs, StyleDispenser-&amp;gt;ResourceDictionaryDispenser, StyleEnumerator-&amp;gt;ResourceDictionaryEnumerator. Modify all code, comments, tests, samples, themes, etc. accordingly. &lt;BR&gt;&lt;BR&gt;Most notably, this change gives us the ability to associate MULTIPLE things with a palette entry and enables designers to easily and flexibly customize things like LineSeries PolyLineStyle in the Palette. Additionally it enables the use of DynamicResource (currently only supported by the WPF platform) to let users customize their DataPointStyle *without* inadvertently losing the default/custom Palette colors. Due to merged ResourceDictionaries, this also enables the addition of arbitrary resources at the Palette level (like Brushes) which can be referenced by DataPoints, etc.. &lt;BR&gt;&lt;BR&gt;Also: Simplify default Background Brushes by removing ScaleTransform and TranslateTransform and replacing with RadialBrush properties, and more... &lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is going to be the most painful change for existing users of Data Visualization - sorry! If you've ever customized a &lt;CODE&gt;StylePalette&lt;/CODE&gt;, your XAML is going to need to change. However, the opportunities this change opens up seem sufficiently compelling that we've decided to make it now (while we still have the freedom to do so). The good news is that the migration is really quite simple - and once you've seen it done once, you can mindlessly apply the change everywhere it's needed. &lt;/P&gt;
&lt;P&gt;To prove it, here's a sample of the "old" way from &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;my original Charting Introduction post&lt;/A&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;chartingToolkit&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: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Statistics (Custom Palette)"&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.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;visualizationToolkit&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;="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;="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;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;="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;="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;="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;visualizationToolkit&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.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;chartingToolkit&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;And here's that same XAML converted to the "new" way of doing things (I've highlighted the changes): &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;chartingToolkit&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: #ff0000"&gt; Title&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Statistics (Custom Palette)"&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;Palette&lt;/SPAN&gt;&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;visualizationToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;ResourceDictionaryCollection&lt;/SPAN&gt;&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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&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="BACKGROUND-COLOR: yellow"&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;="DataPointStyle"&lt;/SPAN&gt;&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;="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="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ResourceDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&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;ResourceDictionary&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; 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;="DataPointStyle"&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;="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;ResourceDictionary&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;ResourceDictionary&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; 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;="DataPointStyle"&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;="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;ResourceDictionary&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;visualizationToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;ResourceDictionaryCollection&lt;/SPAN&gt;&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;chartingToolkit&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Chart.&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;Palette&lt;/SPAN&gt;&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;chartingToolkit&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;Yes, the new syntax is a little bit longer, no doubt about that - but the ability to associate multiple resources with a single palette entry addresses some very tricky problems we've been avoiding till now. And the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dynamicresourceextension.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dynamicresourceextension.aspx"&gt;DynamicResource&lt;/A&gt; benefits for WPF address the single biggest complaint people have had with &lt;CODE&gt;StylePalette&lt;/CODE&gt;: &lt;EM&gt;Why should I have to redefine the entire color palette when all I want to do is provide a new template?&lt;/EM&gt; This is a really powerful shift, and something I'll probably spend more time showing off in a future blog post. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Update Series to look for "LegendItemStyle" in their ResourceDictionary for increased customizability. Add Owner property to LegendItem pointing to owning series to simplify LegendItem-based user scenarios. Add ActualDataPointStyle and ActualLegendItemStyle properties and use Bindings to automatically propagate changes to the right places. (Aside: This fixes a bug that was reported against the WPF Toolkit *as I was making this change*!) Move code so that PieSeries now has the DataPointStyle property like the other Series. Update LegendItem default Template to include standard TemplateBindings for Background/BorderBrush/BorderThickness for more friendly designer experience. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hey, look, we're &lt;STRONG&gt;already&lt;/STRONG&gt; making use of the new &lt;CODE&gt;ResourceDictionaryCollection&lt;/CODE&gt;! &lt;NOBR&gt;:)&lt;/NOBR&gt; The other two big improvements here are the comprehensive use of bindings for the DataPointStyle property that fixes an issue a few customers have bumped into (it's confusing unless you know exactly what's going on) and the addition of &lt;CODE&gt;DataPointStyle&lt;/CODE&gt; to &lt;CODE&gt;PieSeries&lt;/CODE&gt; which is like the &lt;CODE&gt;DynamicResource&lt;/CODE&gt; change in that it should do a lot to simplify things on the WPF platform. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;Move unnecessarily duplicated DependencyProperties IRangeAxis DependentRangeAxis and IAxis IndependentAxis from ColumnSeries and BarSeries into common base class ColumnBarBaseSeries. Move unnecessarily duplicated DependencyProperties IRangeAxis DependentRangeAxis and IAxis IndependentAxis from AreaSeries and LineSeries into common base class LineAreaBaseSeries. Same for methods OnApplyTemplate and UpdateDataPoint and half of UpdateShape. Also remove an unnecessary override from CategoryAxis. No functional impact. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Less code, same features, no functional impact - 'nuff said. &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/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip" mce_href="http://cesso.org/Samples/SilverlightWpfDataVisualization/SilverlightWpfDataVisualization.zip"&gt;[Please click here to download the complete SilverlightWpfDataVisualization solution (includes all source code and pre-compiled binaries for both platforms).]&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;Release Notes&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;When you add a project reference to the Data Visualization assembly on WPF, you also need to add a reference to &lt;CODE&gt;WPFToolkit.dll&lt;/CODE&gt; or you'll get weird runtime errors because the Visual State Manager (VSM) isn't available. &lt;/LI&gt;
&lt;LI&gt;The file structure of the ZIP archive remains the same (&lt;A href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/07/16/bringing-the-silverlight-toolkit-s-treemap-to-wpf-silverlight-wpf-data-visualization-development-release-0.aspx"&gt;see my previous post for details&lt;/A&gt;). &lt;/LI&gt;
&lt;LI&gt;Design-time assemblies are not part of the Development Releases because I don't expect the target audience to need them and because they add additional complexity. &lt;/LI&gt;
&lt;LI&gt;I haven't updated 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;DataVisualizationDemos application&lt;/A&gt; for this unofficial release. &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So there you have it: the second Silverlight/WPF Data Visualization Development Release in a nutshell. Though, in many ways, this is really the &lt;STRONG&gt;first&lt;/STRONG&gt; release because the previous release didn't showcase upcoming changes like this one does (it mainly set the stage for future releases). I said before that these Development Releases are an experiment - so please let me know if you find them useful or if you'd all rather just wait for an official release and find out what's changed then. I'm hopeful that early access to the new code will be helpful to our early adopters and that we'll be able to incorporate their feedback to deliver an even more compelling, more reliable official release. &lt;/P&gt;
&lt;P&gt;So this is me trying to do my part; the ball is in &lt;STRONG&gt;your&lt;/STRONG&gt; court now, Charting fans. &lt;EM&gt;So, what's it going to be then, eh?&lt;/EM&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9894842" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx">Silverlight Toolkit</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx">WPF Toolkit</category></item><item><title>Following up on some of the attention [Live sample posted and a *very* small tweak to the Html5Canvas source code!]</title><link>http://blogs.msdn.com/delay/archive/2009/08/26/following-up-on-some-of-the-attention-live-sample-posted-and-a-very-small-tweak-to-the-html5canvas-source-code.aspx</link><pubDate>Thu, 27 Aug 2009 09:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9886598</guid><dc:creator>Delay</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/delay/comments/9886598.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9886598</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;I posted the &lt;A href="http://blogs.msdn.com/delay/archive/2009/08/24/using-one-platform-to-build-another-html-5-s-canvas-tag-implemented-using-silverlight.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/08/24/using-one-platform-to-build-another-html-5-s-canvas-tag-implemented-using-silverlight.aspx"&gt;source code for a Silverlight implementation of the HTML 5 &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; API yesterday&lt;/A&gt; and some readers have been pretty interested in the concept/implementation. Thanks for all your comments and feedback! &lt;/P&gt;
&lt;P&gt;Earlier today, kind user &lt;A href="http://www.phenxdesign.net/" mce_href="http://www.phenxdesign.net/"&gt;Fabien Ménager&lt;/A&gt; left a &lt;A href="http://blogs.msdn.com/delay/archive/2009/08/24/using-one-platform-to-build-another-html-5-s-canvas-tag-implemented-using-silverlight.aspx#9885646" mce_href="http://blogs.msdn.com/delay/archive/2009/08/24/using-one-platform-to-build-another-html-5-s-canvas-tag-implemented-using-silverlight.aspx#9885646"&gt;comment reporting an unhandled exception in the sample app&lt;/A&gt; and was generous enough to follow up by sending me the text of the exception. And as soon as I saw it, I knew the problem - both because of what it said &lt;STRONG&gt;and&lt;/STRONG&gt; because of the language it was in! &lt;/P&gt;
&lt;P&gt;Here, you give it a try: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;System.FormatException: Le format de la chaîne d'entrée est incorrect. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's a hint: the operating system's culture settings for France (and many other countries) use a ',' for the decimal separator instead of '.' (as is used in the United States). For example, while &lt;A href="http://en.wikipedia.org/wiki/Pi" mce_href="http://en.wikipedia.org/wiki/Pi"&gt;Pi&lt;/A&gt; would be written as "3.14" with the US culture settings, it would be written as "3,14" with French culture settings. And while &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; doesn't accept any user input, it &lt;STRONG&gt;does&lt;/STRONG&gt; parse some of the JavaScript input that makes up the script... Specifically, my sample application includes the following line: &lt;/P&gt;&lt;PRE&gt;context.fillStyle = "rgba(255, 127, 39, 0.8)";&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="http://dev.w3.org/html5/spec/the-canvas-element.html" mce_href="http://dev.w3.org/html5/spec/the-canvas-element.html"&gt;&lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; specification&lt;/A&gt; allows for strings to be assigned to the &lt;CODE&gt;fillStyle&lt;/CODE&gt; property, so it's necessary for &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; to parse that string. And it was the "0.8" alpha value that was the problem here. Attempting to parse that value with the &lt;STRONG&gt;user&lt;/STRONG&gt;'s culture settings will fail for a culture that uses ',' as the decimal separator. This is actually a common problem for text formats that are meant to be used in multiple cultures - and the typical solution is to require that the text always be written for some form of &lt;STRONG&gt;invariant&lt;/STRONG&gt; culture (which typically adheres to the US's conventions). Therefore, the trivial fix was to parse that value according to the invariant culture (i.e., always use '.' as the decimal separator) instead of using the default parsing behavior which honors the user's settings. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: The default behavior is nearly always what you want... except for very rarely when it's not... like this time! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Of course, if I'd reviewed the project's code analysis warnings a few days ago, I would have found this issue earlier. And while I usually do that for all my sample code, I skipped it this time because it was proof-of-concept code and because I knew the "Naming" analysis rules threw lots of warnings for the official &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; API (mainly because JavaScript tends to follow different conventions than .NET). So as punishment for my misdeed, I went ahead and fixed (or suppressed) &lt;STRONG&gt;all&lt;/STRONG&gt; of the non-"Naming" code analysis warnings in the project! &lt;/P&gt;
&lt;P&gt;To be clear, there is &lt;STRONG&gt;no&lt;/STRONG&gt; functional change because of this - but now the code is just a little bit cleaner. &lt;NOBR&gt;:)&lt;/NOBR&gt; &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/Html5Canvas/Html5Canvas.zip" mce_href="http://cesso.org/Samples/Html5Canvas/Html5Canvas.zip"&gt;[Please click here to download the updated source code to Html5Canvas and its 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;And while I was at it, I decided to post the sample application in runnable form just in case there were some people who wanted to watch the &lt;A href="http://en.wikipedia.org/wiki/Hypotrochoid" mce_href="http://en.wikipedia.org/wiki/Hypotrochoid"&gt;Hypotrochoid&lt;/A&gt; draw itself, but didn't want to compile the sample themselves. &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/Html5Canvas/TestPage.html" mce_href="http://cesso.org/Samples/Html5Canvas/TestPage.html"&gt;[Click here or on the image below to run the sample application in your browser.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://cesso.org/Samples/Html5Canvas/TestPage.html" mce_href="http://cesso.org/Samples/Html5Canvas/TestPage.html"&gt;&lt;IMG alt="Sample application in IE" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-IE.png" width=366 height=457 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-IE.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It has been great to see all the interest in this project over the past couple of days - thanks very much for everyone's support, feedback, and kind words!! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9886598" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx">Technical</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Using one platform to build another [HTML 5's canvas tag implemented using Silverlight!]</title><link>http://blogs.msdn.com/delay/archive/2009/08/24/using-one-platform-to-build-another-html-5-s-canvas-tag-implemented-using-silverlight.aspx</link><pubDate>Mon, 24 Aug 2009 23:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9882952</guid><dc:creator>Delay</dc:creator><slash:comments>12</slash:comments><comments>http://blogs.msdn.com/delay/comments/9882952.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9882952</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;&lt;STRONG&gt;Background&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There's been some buzz about the upcoming &lt;A href="http://en.wikipedia.org/wiki/Html5" mce_href="http://en.wikipedia.org/wiki/Html5"&gt;HTML 5&lt;/A&gt; standard over the past few months. In particular, there are a couple of new features that people are looking forward to. One of them is the new &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; element which introduces a 2D drawing API offering a pretty rich set of functionality. If you've worked with HTML much, you can probably imagine some of the things that become possible with this. In fact, those are probably some of the same things that &lt;A href="http://en.wikipedia.org/wiki/Adobe_Flash" mce_href="http://en.wikipedia.org/wiki/Adobe_Flash"&gt;Flash&lt;/A&gt; and &lt;A href="http://en.wikipedia.org/wiki/Microsoft_Silverlight" mce_href="http://en.wikipedia.org/wiki/Microsoft_Silverlight"&gt;Silverlight&lt;/A&gt; are being used for today! So some people have gone as far as to suggest HTML 5 could eliminate the need for Flash and Silverlight... &lt;/P&gt;
&lt;P&gt;I didn't know much about the &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; element and I wanted to understand the situation better, so I did some research. The specification for &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; is available from two sources: the &lt;A href="http://dev.w3.org/html5/spec/the-canvas-element.html" mce_href="http://dev.w3.org/html5/spec/the-canvas-element.html"&gt;W3C&lt;/A&gt; and the &lt;A href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html" mce_href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html"&gt;WHATWG&lt;/A&gt;. (The two groups are working together, so the spec is the same on both sites.) The API is comprised of something close to 100 interfaces, properties, and methods and offers an &lt;A href="http://en.wikipedia.org/wiki/Immediate_mode" mce_href="http://en.wikipedia.org/wiki/Immediate_mode"&gt;immediate mode&lt;/A&gt; programming model that's superficially similar to the &lt;A href="http://en.wikipedia.org/wiki/Graphics_Device_Interface" mce_href="http://en.wikipedia.org/wiki/Graphics_Device_Interface"&gt;Windows GDI&lt;/A&gt; API. At a very high level, the following concepts are defined (though Philip Taylor did &lt;A href="http://philip.html5.org/tests/canvas/suite/tests/" mce_href="http://philip.html5.org/tests/canvas/suite/tests/"&gt;some investigation a while back&lt;/A&gt; which suggested that &lt;A href="http://philip.html5.org/tests/canvas/suite/tests/results.html" mce_href="http://philip.html5.org/tests/canvas/suite/tests/results.html"&gt;no browser offered complete support&lt;/A&gt;): &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Paths and shapes (move/line/curve/arc/clipping/etc.) &lt;/LI&gt;
&lt;LI&gt;Strokes and fills (using solid colors/gradients/images/etc.) &lt;/LI&gt;
&lt;LI&gt;Images &lt;/LI&gt;
&lt;LI&gt;Context save/restore &lt;/LI&gt;
&lt;LI&gt;Transformations (scale/rotate/translate/etc.) &lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;Compositing (&lt;/EM&gt;alpha&lt;EM&gt;/blending/etc.)&lt;/EM&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;Text (font/alignment/measure/etc.)&lt;/EM&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;Pixel-level manipulation&lt;/EM&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;EM&gt;Shadows&lt;/EM&gt; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;There's a variety of stuff there - and as I read through the list, I was struck by how much of it is natively supported by Silverlight. Pretty much all of it, in fact! &lt;NOBR&gt;:)&lt;/NOBR&gt; So I thought it might be a fun and interesting learning experience to try &lt;STRONG&gt;implementing the HTML 5 &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; specification in Silverlight&lt;/STRONG&gt;! What better way to understand the capabilities of &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; than to implement them, right? &lt;/P&gt;
&lt;P&gt;So I went off and started coding... I didn't set out to support everything and I didn't set out to write the most efficient code (in fact, some of what's there is decidedly &lt;STRONG&gt;in&lt;/STRONG&gt;efficient!) - I just set out to implement enough of the specification to run some sample apps and see how hard it was. &lt;/P&gt;
&lt;P&gt;And it turns out to have been pretty easy! Thanks to Silverlight's &lt;A href="http://msdn.microsoft.com/en-us/library/cc645076(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc645076(VS.95).aspx"&gt;HTML Bridge&lt;/A&gt;, I had no trouble creating a Silverlight object that looks just like a &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; to JavaScript code running on a web page. So similar, in fact, that I'm able to run some pretty cool sample applications on my own &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; simply by tweaking the HTML to instantiate a Silverlight &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; instead of the browser's &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt;. And as a nice side effect, Internet Explorer "magically" gains support for the &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; tag! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: Yes, I know I'm not the first person to add &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; support to IE. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Samples&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I started off easy by working my way through the &lt;A href="http://developer.mozilla.org/en/Canvas_tutorial" mce_href="http://developer.mozilla.org/en/Canvas_tutorial"&gt;Mozilla Developer Center's Canvas tutorial&lt;/A&gt; and implementing missing features until each of the samples loaded and rendered successfully. Here are three of my favorite samples as rendered by &lt;CODE&gt;Html5Canvas&lt;/CODE&gt;, my custom &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; implementation: &lt;/P&gt;&lt;IMG alt="Mozilla samples" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Mozilla.png" width=795 height=970 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Mozilla.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: It's important to note that I did NOT change the JavaScript of these (or any other) samples - I just tweaked the HTML host page to load my &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; implementation. My goal was API- and feature-level parity; a Silverlight implementation of &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; that was "plug-compatible" with the existing offerings. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After that, I knew I just &lt;STRONG&gt;had&lt;/STRONG&gt; to run &lt;A href="http://www.benjoffe.com/code/demos/canvascape/" mce_href="http://www.benjoffe.com/code/demos/canvascape/"&gt;Ben Joffe's Canvascape "3D Walker"&lt;/A&gt; because it bears a striking resemblance to one of the games I played when I was younger: &lt;/P&gt;&lt;IMG alt=Canvascape src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Canvascape.png" width=820 height=764 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Canvascape.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: Be sure to look for the "Silverlight" context menu item I've included in the image above and in the next few screen shots to prove there's no trickery going on. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next up was &lt;A href="http://billmill.org/static/canvastutorial/" mce_href="http://billmill.org/static/canvastutorial/"&gt;Bill Mill's Canvas Tutorial&lt;/A&gt; - and another shout-out to hours of misspent youth: &lt;/P&gt;&lt;IMG alt="Canvas Tutorial" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-CanvasTutorial.png" width=371 height=625 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-CanvasTutorial.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For something completely different, I got &lt;A href="http://www.blobsallad.se/" mce_href="http://www.blobsallad.se/"&gt;Bjoern Lindberg's Blob Sallad&lt;/A&gt; running: &lt;/P&gt;&lt;IMG alt="Blob Sallad" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-BlobSallad.png" width=549 height=774 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-BlobSallad.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it was on to &lt;A href="http://onecm.com/projects/canopy/" mce_href="http://onecm.com/projects/canopy/"&gt;Ryan Alexander's Chrome Canopy&lt;/A&gt; fractal zoomer (despite the note, it runs okay-ish in IE8 with my Silverlight &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt;): &lt;/P&gt;&lt;IMG alt="Chrome Canopy" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-ChromeCanopy.png" width=699 height=754 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-ChromeCanopy.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I wanted to see how the &lt;A href="http://9elements.com/io/?p=153" mce_href="http://9elements.com/io/?p=153"&gt;9elements HTML5 Canvas Experiment&lt;/A&gt; ran: &lt;/P&gt;&lt;IMG alt="Canvas Experiment" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-CanvasExperiment.png" width=573 height=624 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-CanvasExperiment.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Whew, What a rush - those apps are really cool! &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I still wanted a sample I could include with the source code download, so I also wrote a little app to exercise most of the APIs supported by &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; (thanks to Mozilla for the Hypotrochoid animation inspiration and &lt;A href="http://en.wikipedia.org/wiki/Hypotrochoid" mce_href="http://en.wikipedia.org/wiki/Hypotrochoid"&gt;Wikipedia for the equation&lt;/A&gt;). Here it is on IE: &lt;/P&gt;&lt;IMG alt="Sample application in IE" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-IE.png" width=733 height=915 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-IE.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And wouldn't it be nice to see how &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; compares to a "real" &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; implementation? Sure, here's my sample running on Firefox: &lt;/P&gt;&lt;IMG alt="Sample application in Firefox" src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-FF.png" width=772 height=927 mce_src="http://blogs.msdn.com/blogfiles/delay/Html5Canvas-Sample-FF.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Details&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;So how does it actually work? Well, I'm obviously not modifying the browser itself, so redefining the actual &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; tag isn't an option. Instead, I've written a simple &lt;CODE&gt;Html5Canvas.js&lt;/CODE&gt; file which gets referenced at the top of the HTML page: &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;script&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;="text/javascript"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;src&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Html5Canvas.js"&amp;gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Among other things, it defines the handy &lt;CODE&gt;function InsertCanvasObject(id, width, height, action)&lt;/CODE&gt; function which can be used to insert a Silverlight &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; thusly: &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;script&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;="text/javascript"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    InsertCanvasObject(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"mycanvas"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, 200, 200, onCanvasLoad);
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;script&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;That code inserts a Silverlight object running &lt;CODE&gt;Html5Canvas.xap&lt;/CODE&gt; that looks just like the &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; tag would have. Yep, it's that easy! &lt;/P&gt;
&lt;P&gt;And it brings up an important difference between &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; and a real &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt;: &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; can be used only &lt;STRONG&gt;after&lt;/STRONG&gt; the Silverlight object has loaded - whereas &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; is usable as soon as the &lt;CODE&gt;body&lt;/CODE&gt;/&lt;CODE&gt;window&lt;/CODE&gt; has loaded (which happens sooner). This distinction is important to keep in mind if you're converting an existing page, because it requires moving the initialization call from &lt;CODE&gt;onload&lt;/CODE&gt; to the &lt;CODE&gt;action&lt;/CODE&gt; parameter of &lt;CODE&gt;InsertCanvasObject&lt;/CODE&gt;. Believe it or not, that's really the only big "gotcha"! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: While I could think of a few ways to avoid exposing this difference to the developer, none of them were general enough to apply universally. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Other minor differences between &lt;CODE&gt;Html5Canvas&lt;/CODE&gt; and &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; are that Silverlight doesn't natively support the relevant repeat modes used by &lt;CODE&gt;createPattern&lt;/CODE&gt; to tile images (though I could implement them without much difficulty), Silverlight doesn't support the&lt;A href="http://en.wikipedia.org/wiki/Gif" mce_href="http://en.wikipedia.org/wiki/Gif"&gt; GIF image format&lt;/A&gt; for use with &lt;CODE&gt;drawImage&lt;/CODE&gt; (&lt;A href="http://blogs.msdn.com/jstegman/archive/2008/10/30/updated-source-for-image-samples.aspx" mce_href="http://blogs.msdn.com/jstegman/archive/2008/10/30/updated-source-for-image-samples.aspx"&gt;also easily worked around&lt;/A&gt;), and the conventional technique of JavaScript feature-detection by writing &lt;CODE&gt;if (canvas.toDataURL) { ... }&lt;/CODE&gt; doesn't work because Silverlight's HTML Bridge doesn't allow a method to be treated like a property (I could work around this, too, but the extra level of indirection was unnecessarily confusing for a sample app). &lt;/P&gt;
&lt;P&gt;Finally, let me reiterate that I did &lt;STRONG&gt;not&lt;/STRONG&gt; attempt to implement the complete &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; specification. Instead, I implemented just enough to support the first 5 (of 6 total) Mozilla sample pages as well as the handful of applications shown above. Specifically, I've implemented everything that's not in &lt;EM&gt;italics&lt;/EM&gt; in the feature list at the beginning of this post. Thinking about what it would take to add the stuff that's not implemented: &lt;A href="http://msdn.microsoft.com/en-us/library/cc189010(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc189010(VS.95).aspx"&gt;text&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.writeablebitmap(VS.95).aspx"&gt;pixel-level manipulation&lt;/A&gt; are both directly supported by Silverlight and should be pretty easy. Shadows seem like a natural fit for Silverlight's &lt;A href="http://msdn.microsoft.com/en-us/library/dd901594(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd901594(VS.95).aspx"&gt;pixel shader support&lt;/A&gt; (though I haven't played around with it yet). All that's left is layer compositing, which does worry me just a little... I haven't thought about it much, but this seems like another job for &lt;CODE&gt;WriteableBitmap&lt;/CODE&gt;, perhaps. &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/Html5Canvas/Html5Canvas.zip" mce_href="http://cesso.org/Samples/Html5Canvas/Html5Canvas.zip"&gt;[Please click here to download the complete source code to Html5Canvas and the sample application shown above.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Be sure to set the &lt;CODE&gt;Html5Canvas.Web&lt;/CODE&gt; project as the active project and run the &lt;CODE&gt;TestPage.html&lt;/CODE&gt; within it to see the sample application. &lt;/EM&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Summary&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;Html5Canvas&lt;/CODE&gt; was a fun project that definitely accomplished its goal of bringing me up to speed on HTML 5's &lt;CODE&gt;&amp;lt;canvas&amp;gt;&lt;/CODE&gt; element! The implementation proved to be fairly straightforward, though there were a couple of challenging bits that ended up being good learning opportunities. &lt;NOBR&gt;:)&lt;/NOBR&gt; The code I'm sharing here is intended to be a proof-of-concept and is &lt;STRONG&gt;not&lt;/STRONG&gt; optimized for performance. However, if there's interest in making broader use of &lt;CODE&gt;Html5Canvas&lt;/CODE&gt;, I have some ideas that should really improve things... &lt;/P&gt;
&lt;P&gt;I hope folks find this all as interesting as I did - and maybe next time you want to add browser features, you'll use Silverlight, too! &lt;NOBR&gt;;)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9882952" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx">Technical</category><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category></item><item><title>Scrolling so smooth like the butter on a muffin [How to: Animate the Horizontal/VerticalOffset properties of a ScrollViewer]</title><link>http://blogs.msdn.com/delay/archive/2009/08/04/scrolling-so-smooth-like-the-butter-on-a-muffin-how-to-animate-the-horizontal-verticaloffset-properties-of-a-scrollviewer.aspx</link><pubDate>Wed, 05 Aug 2009 08:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9857745</guid><dc:creator>Delay</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/delay/comments/9857745.aspx</comments><wfw:commentRss>http://blogs.msdn.com/delay/commentrss.aspx?PostID=9857745</wfw:commentRss><description>&lt;DIV class=delay&gt;
&lt;P&gt;Recently, I got email from two different people with the same question: &lt;EM&gt;How do I animate the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.horizontaloffset(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.horizontaloffset(VS.95).aspx"&gt;HorizontalOffset&lt;/A&gt;/&lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.verticaloffset(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.verticaloffset(VS.95).aspx"&gt;VerticalOffset&lt;/A&gt; properties of a Silverlight/WPF &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer(VS.95).aspx"&gt;ScrollViewer&lt;/A&gt; control?&lt;/EM&gt; Just in case you've never tried this yourself, I'll tell you that it's not quite as easy as you'd think; those two properties are both &lt;STRONG&gt;read-only&lt;/STRONG&gt; and therefore can't be animated by a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.doubleanimation(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.doubleanimation(VS.95).aspx"&gt;DoubleAnimation&lt;/A&gt;. The official way to accomplish this task is to call the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrolltohorizontaloffset(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrolltohorizontaloffset(VS.95).aspx"&gt;ScrollToHorizontalOffset&lt;/A&gt; or &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrolltoverticaloffset(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrolltoverticaloffset(VS.95).aspx"&gt;ScrollToVerticalOffset&lt;/A&gt; method - but of course that can't be done by a &lt;CODE&gt;DoubleAnimation&lt;/CODE&gt; either... &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: Why are HorizontalOffset and VerticalOffset read-only in the first place? Good question; I don't know! I don't see why they couldn't be writable in today's world, but I bet there was a good reason - once upon a time. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;While I didn't have the time to implement a solution myself, I &lt;STRONG&gt;did&lt;/STRONG&gt; have an idea for what to do. It was inspired by &lt;A href="http://en.wikipedia.org/wiki/File:Gnomes_plan.png" mce_href="http://en.wikipedia.org/wiki/File:Gnomes_plan.png"&gt;a rather quirky business plan&lt;/A&gt; and went like this: &lt;/P&gt;&lt;EM&gt;
&lt;OL&gt;
&lt;LI&gt;Create an attached DP for ScrollViewer of type double called SettableHorizontalOffset &lt;/LI&gt;
&lt;LI&gt;In its change handler, call scrollViewerInstance.ScrollToHorizontalOffset(newValue) &lt;/LI&gt;
&lt;LI&gt;Animate the attached DP on the ScrollViewer of your choice &lt;/LI&gt;
&lt;LI&gt;??? &lt;/LI&gt;
&lt;LI&gt;Profit &lt;/LI&gt;&lt;/OL&gt;&lt;/EM&gt;
&lt;P&gt;I cautioned at the time that my idea might not work - and sure enough, when I tried it myself, it didn't! It turns out that neither Silverlight nor WPF much like the idea of pointing &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard.targetproperty(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.storyboard.targetproperty(VS.95).aspx"&gt;Storyboard.TargetProperty&lt;/A&gt; at an &lt;STRONG&gt;attached&lt;/STRONG&gt; DependencyProperty. So much for my clever idea; I needed a different way to solve the problem... And before long I realized that I could use a &lt;A href="http://en.wikipedia.org/wiki/Mediator_pattern" mce_href="http://en.wikipedia.org/wiki/Mediator_pattern"&gt;Mediator&lt;/A&gt; just like I did for a similar situation with LayoutTransformer (see &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/09/a-bit-more-than-meets-the-eye-easily-animate-layouttransformer-with-animationmediator.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/09/a-bit-more-than-meets-the-eye-easily-animate-layouttransformer-with-animationmediator.aspx"&gt;previous&lt;/A&gt; &lt;A href="http://blogs.msdn.com/delay/archive/2009/04/10/a-bit-more-er-than-meets-the-eye-easily-animate-and-update-layouttransformer-with-animationmediator.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/04/10/a-bit-more-er-than-meets-the-eye-easily-animate-and-update-layouttransformer-with-animationmediator.aspx"&gt;posts&lt;/A&gt;). &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I created a simple class, &lt;CODE&gt;ScrollViewerOffsetMediator&lt;/CODE&gt;, which exposes a &lt;CODE&gt;ScrollViewer&lt;/CODE&gt; property that you point at a &lt;CODE&gt;ScrollViewer&lt;/CODE&gt; instance (hint: use a &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding.elementname(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.data.binding.elementname(VS.95).aspx"&gt;Binding with ElementName&lt;/A&gt; to make this easy) and a &lt;CODE&gt;VerticalOffset&lt;/CODE&gt; property which is conveniently &lt;STRONG&gt;writable&lt;/STRONG&gt;. &lt;NOBR&gt;:)&lt;/NOBR&gt; Any changes to the &lt;CODE&gt;VerticalOffset&lt;/CODE&gt; property are automatically applied to the relevant &lt;CODE&gt;ScrollViewer&lt;/CODE&gt; via a call to its &lt;CODE&gt;ScrollToVerticalOffset&lt;/CODE&gt; method - so you can animate the mediator and it'll be just like you were animating the &lt;CODE&gt;ScrollViewer&lt;/CODE&gt; itself! &lt;/P&gt;
&lt;P&gt;That solves the original problem and it's all well and good - but it doesn't &lt;EM&gt;quite&lt;/EM&gt; address a pretty common scenario: wanting to animate a ScrollViewer from top to bottom. You see, &lt;CODE&gt;VerticalOffset&lt;/CODE&gt; is expressed in &lt;STRONG&gt;pixels&lt;/STRONG&gt; and it's not easy to pass the (unknown) height of an arbitrary &lt;CODE&gt;ScrollViewer&lt;/CODE&gt; to an animation in static XAML. So I added another property called &lt;CODE&gt;ScrollableHeightMultiplier&lt;/CODE&gt; which takes a value between 0.0 and 1.0, multiplies it by the ScrollViewer's current &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrollableheight(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.controls.scrollviewer.scrollableheight(VS.95).aspx"&gt;ScrollableHeight&lt;/A&gt; and sets the &lt;CODE&gt;VerticalOffset&lt;/CODE&gt; to &lt;STRONG&gt;that&lt;/STRONG&gt; value. In this manner, animations can be written in general, pixel-independent terms, and it's easy to get the animated scrolling effect everybody wants! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: I've implemented support for only the vertical direction - doing the same thing for the horizontal direction is left as an exercise to the reader. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The sample application uses &lt;CODE&gt;ScrollableHeightMultiplier&lt;/CODE&gt; and an &lt;A href="http://msdn.microsoft.com/en-us/library/cc189019(VS.95).aspx#keyframe_animations" mce_href="http://msdn.microsoft.com/en-us/library/cc189019(VS.95).aspx#keyframe_animations"&gt;EasingFunction&lt;/A&gt; (just to show off!) and looks like this: &lt;/P&gt;&lt;IMG alt="AnimatingScrollViewerOffsets sample" src="http://blogs.msdn.com/blogfiles/delay/AnimatingScrollViewerOffsets.png" width=285 height=367 mce_src="http://blogs.msdn.com/blogfiles/delay/AnimatingScrollViewerOffsets.png"&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/AnimatingScrollViewerOffsets/AnimatingScrollViewerOffsets.zip" mce_href="http://cesso.org/Samples/AnimatingScrollViewerOffsets/AnimatingScrollViewerOffsets.zip"&gt;[Click here to download the complete AnimatingScrollViewerOffsets sample.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The XAML for the sample is quite straightforward: &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;Grid&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Height&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="200"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Width&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="150"&amp;gt;

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Trigger to start the animation when loaded --&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;Grid.Triggers&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;EventTrigger&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; RoutedEvent&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Grid.Loaded"&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;BeginStoryboard&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;BeginStoryboard.Storyboard&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;!-- Animate back and forth forever --&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;Storyboard
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; AutoReverse&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="True"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; RepeatBehavior&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Forever"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;                        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Animate from top to bottom --&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;DoubleAnimation
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Storyboard.TargetName&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Mediator"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; Storyboard.TargetProperty&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="ScrollableHeightMultiplier"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; From&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                           &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; To&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; Duration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="0:0:1"&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;DoubleAnimation.EasingFunction&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;!-- Ease in and out --&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;ExponentialEase&lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; EasingMode&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="EaseInOut"/&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;DoubleAnimation.EasingFunction&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;DoubleAnimation&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;Storyboard&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;BeginStoryboard.Storyboard&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;BeginStoryboard&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;EventTrigger&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;Grid.Triggers&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;!-- ScrollViewer that will be animated --&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;ScrollViewer
&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;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Scroller"&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;&amp;lt;!-- Arbitrary content... --&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;ItemsControl
&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; FontSize&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="32"/&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;ScrollViewer&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;!-- Mediator that forwards the property changes --&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;ScrollViewerOffsetMediator
&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;Name&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;="Mediator"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt; ScrollViewer&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; ElementName&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;=Scroller}"/&amp;gt;

&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Grid&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;Here's the complete implementation of &lt;CODE&gt;ScrollViewerOffsetMediator&lt;/CODE&gt; which naturally &lt;STRONG&gt;works perfectly well on WPF&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; Mediator that forwards Offset property changes on to a ScrollViewer
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; instance to enable the animation of Horizontal/VerticalOffset.
&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;ScrollViewerOffsetMediator&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: #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; ScrollViewer instance to forward Offset changes on to.
&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;ScrollViewer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ScrollViewer
    {
        &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: #2b91af"&gt;ScrollViewer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)GetValue(ScrollViewerProperty); }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { SetValue(ScrollViewerProperty, &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;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; ScrollViewerProperty =
        &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;"ScrollViewer"&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;ScrollViewer&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;ScrollViewerOffsetMediator&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;(OnScrollViewerChanged));
    &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; OnScrollViewerChanged(&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; mediator = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollViewerOffsetMediator&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; scrollViewer = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollViewer&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; != scrollViewer)
        {
            scrollViewer.ScrollToVerticalOffset(mediator.VerticalOffset);
        }
    }

    &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; VerticalOffset property to forward to the ScrollViewer.
&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;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; VerticalOffset
    {
        &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(VerticalOffsetProperty); }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { SetValue(VerticalOffsetProperty, &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;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; VerticalOffsetProperty =
        &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;"VerticalOffset"&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;ScrollViewerOffsetMediator&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;(OnVerticalOffsetChanged));
    &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; OnVerticalOffsetChanged(&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; mediator = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollViewerOffsetMediator&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)o;
        &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; != mediator.ScrollViewer)
        {
            mediator.ScrollViewer.ScrollToVerticalOffset((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(e.NewValue));
        }
    }

    &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; Multiplier for ScrollableHeight property to forward to the ScrollViewer.
&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;remarks&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; 0.0 means "scrolled to top"; 1.0 means "scrolled to bottom".
&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;/remarks&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;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ScrollableHeightMultiplier
    {
        &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(ScrollableHeightMultiplierProperty); }
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; { SetValue(ScrollableHeightMultiplierProperty, &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;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; ScrollableHeightMultiplierProperty =
        &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;"ScrollableHeightMultiplier"&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;ScrollViewerOffsetMediator&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;(OnScrollableHeightMultiplierChanged));
    &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; OnScrollableHeightMultiplierChanged(&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; mediator = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ScrollViewerOffsetMediator&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; scrollViewer = mediator.ScrollViewer;
        &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; != scrollViewer)
        {
            scrollViewer.ScrollToVerticalOffset((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;double&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(e.NewValue) * scrollViewer.ScrollableHeight);
        }
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;PS - Thanks to &lt;A href="http://www.hrwiki.org/wiki/Scroll_Button_Songs" mce_href="http://www.hrwiki.org/wiki/Scroll_Button_Songs"&gt;Homestar Runner's Strong Bad&lt;/A&gt; for inspiring the title of this post. &lt;/EM&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9857745" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx">WPF</category></item></channel></rss>