<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Delay's Blog</title><subtitle type="html" /><id>http://blogs.msdn.com/delay/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/delay/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-08-26T23:42:00Z</updated><entry><title>Creating something from nothing, asynchronously [Developer-friendly virtual file implementation for .NET improved!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/11/04/creating-something-from-nothing-asynchronously-developer-friendly-virtual-file-implementation-for-net-improved.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/11/04/creating-something-from-nothing-asynchronously-developer-friendly-virtual-file-implementation-for-net-improved.aspx</id><published>2009-11-05T07:38:00Z</published><updated>2009-11-05T07:38:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Last week &lt;A href="http://blogs.msdn.com/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx" mce_href="http://blogs.msdn.com/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx"&gt;I posted the code for VirtualFileDataObject, an easy-to-use implementation of virtual files for .NET and WPF&lt;/A&gt;. This code implements the standard &lt;A href="http://msdn.microsoft.com/en-us/library/ms688421(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms688421(VS.85).aspx"&gt;IDataObject COM interface&lt;/A&gt; for drag-and-drop and clipboard operations and is specifically targeted at scenarios where an application wants to allow the user to drag an element to a folder and create a file (or files) dynamically on the drop/paste. The standard .NET APIs for drag-and-drop don't support this scenario, so &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; ended up being a custom implementation of the &lt;A href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx"&gt;System.Runtime.InteropServices.ComTypes.IDataObject interface&lt;/A&gt;. Fortunately, the specifics aren't too difficult, and a series of posts by &lt;A href="http://blogs.msdn.com/oldnewthing/" mce_href="http://blogs.msdn.com/oldnewthing/"&gt;Raymond Chen&lt;/A&gt; paved the way (in native code). &lt;/P&gt;&lt;IMG alt="VirtualFileDataObjectDemo sample application" src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Demo.png" width=400 height=400 mce_src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Demo.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you read my previous post, you may recall there was an issue with the last scenario of the sample: the application became unresponsive while data for the virtual file was downloading from the web. While this unresponsiveness won't be a noticeable for scenarios involving local data, scenarios that create large files or hit the network &lt;STRONG&gt;are&lt;/STRONG&gt; at risk. Well, it's time to find a solution! &lt;/P&gt;
&lt;P&gt;And we don't have to look far: the answer is found in the MSDN documentation for &lt;A href="http://msdn.microsoft.com/en-us/library/bb776905(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb776905(VS.85).aspx"&gt;Transferring Shell Objects with Drag-and-Drop and the Clipboard&lt;/A&gt; under the heading &lt;A href="http://msdn.microsoft.com/en-us/library/bb776904(VS.85).aspx#async" mce_href="http://msdn.microsoft.com/en-us/library/bb776904(VS.85).aspx#async"&gt;Using IAsyncOperation&lt;/A&gt;. As you might expect, we're not the first to notice this behavior; the &lt;A href="http://msdn.microsoft.com/en-us/library/bb776309(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb776309(VS.85).aspx"&gt;IAsyncOperation interface&lt;/A&gt; exists to solve this very problem. So it seems like things ought to be easy - let's just define the interface, implement its five methods (none of which are very complicated), and watch as the sample application stays responsive during the time-consuming download... &lt;/P&gt;
&lt;P&gt;&lt;A href="http://failblog.org/" mce_href="http://failblog.org/"&gt;&lt;STRONG&gt;FAIL&lt;/STRONG&gt;&lt;/A&gt;. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Okay, so that didn't work out quite how we wanted it to. Maybe we defined the interface incorrectly? Maybe we implemented it incorrectly? Or maybe Windows just doesn't support this scenario?? &lt;/P&gt;
&lt;P&gt;No, no, and no. We've done everything right - it's the platform that has betrayed us. &lt;NOBR&gt;:(&lt;/NOBR&gt; Specifically, the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dragdrop.dodragdrop.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dragdrop.dodragdrop.aspx"&gt;DragDrop.DoDragDrop method&lt;/A&gt; does something sneaky under the covers: it wraps our respectable &lt;CODE&gt;System.Runtime.InteropServices.ComTypes.IDataObject&lt;/CODE&gt; instance in a &lt;CODE&gt;System.Windows.DataObject&lt;/CODE&gt; wrapper. Because this wrapper object doesn't implement or forward &lt;CODE&gt;IAsyncOperation&lt;/CODE&gt;, it's as if the interface doesn't exist! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: I have the fortune of working with some of the people who wrote this code in the first place, and I asked why this extra level of indirection was necessary. The answer is that it probably isn't - or at least nobody remembers why it's there or why it couldn't be removed now. So the good news is they'll be looking at changing this behavior in a future release of WPF. The bad news is that the change probably won't happen in time for the upcoming WPF 4 release. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Be that as it may, it looks like we're going to need to call the COM &lt;A href="http://msdn.microsoft.com/en-us/library/ms678486(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms678486(VS.85).aspx"&gt;DoDragDrop function&lt;/A&gt; directly. Fortunately, there's not much that happens between WPF's &lt;CODE&gt;DragDrop.DoDragDrop&lt;/CODE&gt; and COM's &lt;CODE&gt;DoDragDrop&lt;/CODE&gt;, so there's not much we have to duplicate. That said, we do need to define the &lt;A href="http://msdn.microsoft.com/en-us/library/ms690071(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms690071(VS.85).aspx"&gt;IDropSource interface&lt;/A&gt; and write a custom &lt;CODE&gt;DropSource&lt;/CODE&gt; implementation of its two methods. The nice thing is that both methods are pretty simple and straightforward, so our custom implementation can be private. (And for simplicity's sake, we're not going to bother raising &lt;CODE&gt;DragDrop's&lt;/CODE&gt; &lt;CODE&gt;(Preview)GiveFeedbackEvent&lt;/CODE&gt; or &lt;CODE&gt;(Preview)QueryContinueDragEvent&lt;/CODE&gt; events.) &lt;/P&gt;
&lt;P&gt;Because we've been careful to define the &lt;CODE&gt;VirtualFileDataObject.DoDragDrop&lt;/CODE&gt; replacement method with the same signature as the &lt;CODE&gt;DoDragDrop&lt;/CODE&gt; method it's replacing, updating the sample to use it is trivial. So run the sample again, and - &lt;STRONG&gt;BAM&lt;/STRONG&gt; - no more unresponsive window during the transfer! (For real, this time.) You can switch to the window, resize it, drag it, etc. all during the creation of the virtual file. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But now we've got a bit of a dilemma: if things are happening asynchronously, how can we tell when they're done? The answer lies with the &lt;A href="http://msdn.microsoft.com/en-us/library/bb776312(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb776312(VS.85).aspx"&gt;StartOperation&lt;/A&gt; and &lt;A href="http://msdn.microsoft.com/en-us/library/bb776307(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb776307(VS.85).aspx"&gt;EndOperation&lt;/A&gt; methods of the &lt;CODE&gt;IAsyncOperation&lt;/CODE&gt; interface. Per the interface contact, these methods are called at the beginning/end of the asynchronous operation. So if we just add another constructor to the &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; class, we can wire things up in the obvious manner: &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: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Initializes a new instance of the VirtualFileDataObject class.
&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="startAction"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Optional action to run at the start of the data transfer.&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="endAction"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Optional action to run at the end of the data transfer.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; VirtualFileDataObject(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; startAction, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; endAction)
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Well, almost... The catch is that while &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; now &lt;STRONG&gt;supports&lt;/STRONG&gt; asynchronous mode, there's no guarantee that the drop target will &lt;STRONG&gt;use&lt;/STRONG&gt; it. Additionally, the developer may have specifically set the &lt;CODE&gt;VirtualFileDataObject.IsAsynchronous&lt;/CODE&gt; property to &lt;CODE&gt;false&lt;/CODE&gt; to disable asynchronous mode. And when you're in synchronous mode, there aren't any handy begin/end notifications to rely on... &lt;/P&gt;
&lt;P&gt;So I've added support to &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; for calling the begin/end actions in synchronous mode based on some semi-educated guesses. In my testing, the notifications during synchronous mode behave as identically as possible to those in asynchronous mode. Granted, in some scenarios &lt;CODE&gt;startAction&lt;/CODE&gt; may run a little earlier in synchronous mode than it would have for asynchronous mode - but as far as the typical developer is concerned, &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; offers the same handy behavior for &lt;STRONG&gt;both&lt;/STRONG&gt; modes! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's celebrate by updating the sample to show a simple busy indicator during the download: &lt;/P&gt;&lt;IMG alt="VirtualFileDataObjectDemo sample application" src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Busy.png" width=400 height=400 mce_src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Busy.png"&gt; 
&lt;P&gt;Code-wise, once we've updated the call to &lt;CODE&gt;DoDragDrop&lt;/CODE&gt;: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.DoDragDrop(dragSource, virtualFileDataObject, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DragDropEffects&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Copy);&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Everything else stays the same except for the constructor: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; virtualFileDataObject = &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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// BeginInvoke ensures UI operations happen on the right thread
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    () =&amp;gt; Dispatcher.BeginInvoke((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(() =&amp;gt; BusyScreen.Visibility = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Visibility&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Visible)),
    () =&amp;gt; Dispatcher.BeginInvoke((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(() =&amp;gt; BusyScreen.Visibility = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Visibility&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Collapsed)));
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;The &lt;CODE&gt;BusyScreen&lt;/CODE&gt; variable above corresponds to a new element in the sample application that provides the simple "Busy..." UI shown above. In real life, we'd probably use MVVM and a &lt;CODE&gt;bool&lt;/CODE&gt; &lt;CODE&gt;IsBusy&lt;/CODE&gt; property on our data model to trigger this, but for a sample application, toggling &lt;CODE&gt;Visibility&lt;/CODE&gt; works fine. Because all the hard work is done by the &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; class [you're welcome! &lt;NOBR&gt;:)&lt;/NOBR&gt; ], the application remains unencumbered by complex logic for &lt;STRONG&gt;anything&lt;/STRONG&gt; related to the management of virtual files. &lt;/P&gt;
&lt;P&gt;Which is the way it should be! &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/VirtualFileDataObjectDemo/VirtualFileDataObjectDemo.zip" mce_href="http://cesso.org/Samples/VirtualFileDataObjectDemo/VirtualFileDataObjectDemo.zip"&gt;[Click here to download the complete code for VirtualFileDataObject and the sample application.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PS&lt;/STRONG&gt; - I have one more post planned on this topic demonstrating something I haven't touched on yet to help applications coordinate better with the shell. Stay tuned... &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9917797" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><title>As the platform evolves, so do the workarounds [Better SetterValueBindingHelper makes Silverlight Setters better-er!]</title><link rel="alternate" type="text/html" href="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" /><id>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</id><published>2009-11-02T18:24:00Z</published><updated>2009-11-02T18:24:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /></entry><entry><title>My new home page, revised [Updated collection of great Silverlight/WPF Data Visualization resources!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/10/28/my-new-home-page-revised-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/10/28/my-new-home-page-revised-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx</id><published>2009-10-28T17:15:00Z</published><updated>2009-10-28T17:15:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>Creating something from nothing [Developer-friendly virtual file implementation for .NET!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/10/26/creating-something-from-nothing-developer-friendly-virtual-file-implementation-for-net.aspx</id><published>2009-10-26T18:34:00Z</published><updated>2009-10-26T18:34:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Have you ever used one of those programs that lets you drag a UI widget, drop it in a folder, and - &lt;STRONG&gt;poof&lt;/STRONG&gt; - a file that didn't exist magically appears? Me, too - it's cool! But how does it work? Are they really deferring the work of creating that file until it's needed and then creating the file &lt;STRONG&gt;during&lt;/STRONG&gt; the drag-and-drop operation? Yes they are - and now you can, too! &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;EM&gt;If I have seen a little further it is by standing on the shoulders of Giants.&lt;/EM&gt;- &lt;A href="http://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants" mce_href="http://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants"&gt;Sir Isaac Newton&lt;/A&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Everything you ever needed to know about drag-and-drop in Windows can probably be found in the MSDN documentation for &lt;A href="http://msdn.microsoft.com/en-us/library/bb776905(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb776905(VS.85).aspx"&gt;Transferring Shell Objects with Drag-and-Drop and the Clipboard&lt;/A&gt;. That documentation is a great resource for specific questions, but because it covers so many topics, it's not necessarily the best way to get an overview. For that, we turn to &lt;A href="http://blogs.msdn.com/oldnewthing/" mce_href="http://blogs.msdn.com/oldnewthing/"&gt;Raymond Chen&lt;/A&gt;'s blog - specifically, a series he did called "What a drag" in March of last year. Raymond's example uses native code exclusively, but don't let that scare you away - his presentation and explanations are always engaging! Please take a moment to read (or at least skim) the following articles, or else the rest of this post might not make much sense: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/11/8080077.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/11/8080077.aspx"&gt;What a drag: Dragging text&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/12/8080101.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/12/8080101.aspx"&gt;What a drag: Dragging a Uniform Resource Locator (URL)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/13/8080135.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/13/8080135.aspx"&gt;What a drag: Dragging a Uniform Resource Locator (URL) and text&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/18/8080183.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/18/8080183.aspx"&gt;What a drag: Dragging a virtual file (HGLOBAL edition)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/19/8080215.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/19/8080215.aspx"&gt;What a drag: Dragging a virtual file (IStream edition)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/20/8080229.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/20/8080229.aspx"&gt;What a drag: Dragging a virtual file (IStorage edition)&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://blogs.msdn.com/oldnewthing/archive/2008/03/31/8344798.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2008/03/31/8344798.aspx"&gt;You can drag multiple virtual objects, you know&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Okay, so we know what we want to do and now we know how it's supposed to work! The first thing to consider is whether the WPF platform supports the virtual file scenario. And unfortunately, it doesn't seem to. &lt;NOBR&gt;:(&lt;/NOBR&gt; Specifically, the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dataobject.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dataobject.aspx"&gt;DataObject class&lt;/A&gt; is where we'd expect to find such support, but the closest it has is &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dataobject.setfiledroplist.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dataobject.setfiledroplist.aspx"&gt;SetFileDropList&lt;/A&gt;. And while that sounds promising, it's really just a list of strings with paths to &lt;STRONG&gt;existing&lt;/STRONG&gt; files. Recall that the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.dragdrop.dodragdrop.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.dragdrop.dodragdrop.aspx"&gt;DragDrop.DoDragDrop method&lt;/A&gt; is synchronous (i.e., does not return until the drag-and-drop operation is complete), and the obvious consequence is that creating a virtual file on the fly isn't practical with this API. Specifically, the bits already need to exist on disk by the time the user starts the drag operation - but you don't know what data they're going to drag until they start! It's a classic &lt;A href="http://en.wikipedia.org/wiki/Catch_22" mce_href="http://en.wikipedia.org/wiki/Catch_22"&gt;Catch-22&lt;/A&gt;... &lt;/P&gt;
&lt;P&gt;The natural next step is to consider whether subclassing &lt;CODE&gt;DataObject&lt;/CODE&gt; would help - but it's &lt;CODE&gt;sealed&lt;/CODE&gt;, so that's a pretty quick dead end. &lt;/P&gt;
&lt;P&gt;Move on to consider whether the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.idataobject.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.idataobject.aspx"&gt;System.Windows.IDataObject interface&lt;/A&gt; used by &lt;CODE&gt;DataObject&lt;/CODE&gt; would be useful. But it seems not; it's pretty much the same API as &lt;CODE&gt;DataObject&lt;/CODE&gt; which we've already dismissed. &lt;/P&gt;
&lt;P&gt;So that leaves us looking at the &lt;A href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.comtypes.idataobject.aspx"&gt;System.Runtime.InteropServices.ComTypes.IDataObject interface&lt;/A&gt; which is a simple managed representation of the actual &lt;A href="http://msdn.microsoft.com/en-us/library/ms688421(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms688421(VS.85).aspx"&gt;IDataObject COM interface&lt;/A&gt; that the shell uses directly. Clearly, anything is possible at this point, so if we can just channel our inner Raymond, we ought to be in business! &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The good news is that I've already done this for you. I've even written a simple WPF application to show how everything fits together: &lt;/P&gt;&lt;IMG alt="VirtualFileDataObjectDemo sample application" src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Demo.png" width=400 height=400 mce_src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Demo.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/VirtualFileDataObjectDemo/VirtualFileDataObjectDemo.zip" mce_href="http://cesso.org/Samples/VirtualFileDataObjectDemo/VirtualFileDataObjectDemo.zip"&gt;[Click here to download the complete code for VirtualFileDataObject and the sample application.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I've done is write a custom &lt;CODE&gt;IDataObject&lt;/CODE&gt; class called &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; that does all the hard work for you. All you need to do is provide the relevant data, and your users will be dragging-and-dropping virtual files in no time. And what's really neat is that writing the code to support drag-and-drop &lt;STRONG&gt;automatically&lt;/STRONG&gt; gives complete support for the clipboard because the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.clipboard.setdataobject.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.clipboard.setdataobject.aspx"&gt;Clipboard.SetDataObject method&lt;/A&gt; uses the same &lt;CODE&gt;IDataObject&lt;/CODE&gt; interface! &lt;/P&gt;
&lt;P&gt;Let's look at the sample scenarios to understand how &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; is used: &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Text only&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; virtualFileDataObject = &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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Provide simple text (in the form of a NULL-terminated ANSI string)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;virtualFileDataObject.SetData(
    (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetDataFormat(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Text).Id),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Default.GetBytes(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"This is some sample text\0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));

DoDragDropOrClipboardSetDataObject(e.ChangedButton, Text, virtualFileDataObject);
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;This is the simplest possible scenario - just to show off that simple things stay simple with &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt;. Here's the signature for the &lt;CODE&gt;SetData&lt;/CODE&gt; method used above: &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; Provides data for the specified data format (HGLOBAL).
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="dataFormat"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Data format.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="data"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Sequence of data.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetData(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; dataFormat, &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: #0000ff"&gt;byte&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; data)
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Note that it operates in "&lt;CODE&gt;HGLOBAL&lt;/CODE&gt; mode" where all the data is provided at the time of the call. Note also that it doesn't know anything about what the data is, so it's up to the caller to make sure it's in the right format. Specifically, the right format for &lt;CODE&gt;DataFormats.Text&lt;/CODE&gt; is a NULL-terminated ANSI string, so that's what the sample passes in. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: The &lt;CODE&gt;DoDragDropOrClipboardSetDataObject&lt;/CODE&gt; method used above is a simple helper method for the test application - it calls &lt;CODE&gt;DragDrop.DoDragDrop&lt;/CODE&gt; or &lt;CODE&gt;Clipboard.SetDataObject&lt;/CODE&gt; depending on what the user did. It's not very exciting, so I won't be showing it (or the &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; constructor) in the following examples. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Text and URL&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Provide simple text and a URL in priority order
// (both in the form of a NULL-terminated ANSI string)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;virtualFileDataObject.SetData(
    (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetDataFormat(CFSTR_INETURLA).Id),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Default.GetBytes(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/\0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));
virtualFileDataObject.SetData(
    (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetDataFormat(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Text).Id),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Default.GetBytes(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/\0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Another simple example based on Raymond's discussion of drag-and-drop into Internet Explorer. For our purposes, this example demonstrates that you can set multiple data formats and that formats other than those exposed by WPF's &lt;CODE&gt;DataFormats&lt;/CODE&gt; enumeration are easy to deal with. Per the guidelines, supported formats are provided in order by priority, with higher priority formats coming first. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Virtual file&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Provide a virtual file (generated on demand) containing the letters 'a'-'z'
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;virtualFileDataObject.SetData(&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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FileDescriptor&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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FileDescriptor
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    {
        Name = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Alphabet.txt"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        Length = 26,
        ChangeTimeUtc = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Now.AddDays(-1),
        StreamContents = stream =&amp;gt;
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; contents = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Enumerable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Range(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'a'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, 26).Select(i =&amp;gt; (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;byte&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)i).ToArray();
                stream.Write(contents, 0, contents.Length);
            }
    },
});
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;At last, something juicy! This example creates a virtual file named &lt;CODE&gt;Alphabet.txt&lt;/CODE&gt; that's 26 bytes long and appears to have been written exactly one day ago. The contents of this file aren't generated until they're actually required by the drop target, so there's no wasted effort if the user doesn't start the drag, aborts it, or whatever. When the file's contents are eventually needed, &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; calls the user-provided &lt;CODE&gt;Action&lt;/CODE&gt; (not necessarily a &lt;A href="http://msdn.microsoft.com/en-us/library/bb397687.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb397687.aspx"&gt;lambda expression&lt;/A&gt;, though I've used one here for conciseness) and passes it a write-only &lt;A href="http://msdn.microsoft.com/en-us/library/system.io.stream.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.io.stream.aspx"&gt;Stream&lt;/A&gt; instance for writing the data. The user code writes to this stream as much or as little as necessary, then returns control to &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; in order to complete the operation. &lt;/P&gt;
&lt;P&gt;The file that gets created when you drop/paste this item into a folder looks just like you'd expect. And because &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; supports the length and change time fields, Windows has all the information it needs to help the user resolve possible conflicts: &lt;/P&gt;&lt;IMG alt="Windows conflict dialog" src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Conflict.png" width=466 height=412 mce_src="http://blogs.msdn.com/blogfiles/delay/VirtualFileDataObjectDemo-Conflict.png"&gt; 
&lt;P&gt;Here's the relevant &lt;CODE&gt;SetData&lt;/CODE&gt; method (note that you can provide an arbitrary number of &lt;CODE&gt;FileDescriptor&lt;/CODE&gt; instances, so you can create as many virtual files as you want): &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; Provides data for the specified data format (FILEGROUPDESCRIPTOR/FILEDESCRIPTOR)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="fileDescriptors"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Collection of virtual files.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetData(&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;FileDescriptor&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; fileDescriptors)
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;It makes use of another &lt;CODE&gt;SetData&lt;/CODE&gt; method that's handy for dealing with "&lt;CODE&gt;ISTREAM&lt;/CODE&gt; mode": &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; Provides data for the specified data format and index (ISTREAM).
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="dataFormat"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Data format.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="index"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Index of data.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="streamData"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Action generating the data.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;remarks&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Uses Stream instead of IEnumerable(T) because Stream is more likely
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; to be natural for the expected scenarios.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/remarks&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetData(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; dataFormat, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;int&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; index, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; streamData)
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;And accepts data in the following form: &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 representing a virtual file for use by drag/drop or the clipboard.
&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;FileDescriptor
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets or sets the name of the file.
&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; Name { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets or sets the (optional) length of the file.
&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;UInt64&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;? Length { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets or sets the (optional) change time of the file.
&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;DateTime&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;? ChangeTimeUtc { &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;get&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;set&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;; }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Gets or sets an Action that returns the contents of the file.
&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;Action&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Stream&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;gt; StreamContents { &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;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Text, URL, and a virtual file!&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Provide a virtual file (downloaded on demand), its URL, and descriptive text
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;virtualFileDataObject.SetData(&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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FileDescriptor&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;VirtualFileDataObject&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;FileDescriptor
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    {
        Name = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"DelaysBlog.xml"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
        StreamContents = stream =&amp;gt;
            {
                &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; webClient = &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;WebClient&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; data = webClient.DownloadData(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/rss.xml"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
                    stream.Write(data, 0, data.Length);
                }
            }
    },
});
virtualFileDataObject.SetData(
    (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetDataFormat(CFSTR_INETURLA).Id),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Default.GetBytes(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/rss.xml\0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));
virtualFileDataObject.SetData(
    (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;short&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetDataFormat(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DataFormats&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Text).Id),
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Encoding&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Default.GetBytes(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"[The RSS feed for Delay's Blog]\0"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;));
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Finally, here's a sample that pulls everything together in a nice, fancy package with a bow on top. The text is an informative snippet, the URL is a link to an RSS feed, and the virtual file is the &lt;STRONG&gt;dynamically downloaded&lt;/STRONG&gt; content of that RSS feed! Way cool - it's like there's this big file sitting around that the user can drop anywhere they want - except that it only really exists on the web and it's always up to date whenever you drop it somewhere! &lt;/P&gt;
&lt;P&gt;As you can see, the &lt;CODE&gt;VirtualFileDataObject&lt;/CODE&gt; class makes the whole scenario really easy and approachable - even if you're not an expert on shell interoperability. It's pretty snazzy, I'd say. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's just one small problem... &lt;/P&gt;
&lt;P&gt;If you tried the drag-and-drop version of the last sample above on a machine with a slow network connection, you probably noticed that the sample application became unresponsive as soon as you dropped the virtual file and didn't recover until the download completed. This is a natural consequence of the &lt;CODE&gt;DoDragDrop&lt;/CODE&gt; method being synchronous and getting called from the UI thread (like it should be). In most scenarios, you probably won't notice this problem because generating the file's data is practically instantaneous. But when there's a delay, unresponsiveness is a possibility. The &lt;STRONG&gt;good&lt;/STRONG&gt; news is that there's an official technique for solving this problem. The &lt;STRONG&gt;bad&lt;/STRONG&gt; news is that it doesn't work for WPF apps. The &lt;STRONG&gt;good&lt;/STRONG&gt; news is that I can show you how to make it work anyway. &lt;/P&gt;
&lt;P&gt;But that's a topic for another blog post - one that I'll write in a week or so... &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9913083" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><title>Two birds, one stone [Silverlight/WPF Data Visualization Development Release 2 and DataVisualizationDemos update]</title><link rel="alternate" type="text/html" 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" /><id>http://blogs.msdn.com/delay/archive/2009/10/21/two-birds-one-stone-silverlight-wpf-data-visualization-development-release-2-and-datavisualizationdemos-update.aspx</id><published>2009-10-21T19:02:00Z</published><updated>2009-10-21T19:02:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>Silverlight (and WPF) Data Visualization classes unsealed [Silverlight Toolkit October 2009 release now available!]</title><link rel="alternate" type="text/html" 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" /><id>http://blogs.msdn.com/delay/archive/2009/10/19/silverlight-and-wpf-data-visualization-classes-unsealed-silverlight-toolkit-october-2009-release-now-available.aspx</id><published>2009-10-19T17:22:00Z</published><updated>2009-10-19T17:22:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;We've just published the &lt;A href="http://silverlight.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>Brevity is the soul of wit [A free, easy, custom URL shortening solution for ASP.NET!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/10/16/brevity-is-the-soul-of-wit-a-free-easy-custom-url-shortening-solution-for-asp-net.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/10/16/brevity-is-the-soul-of-wit-a-free-easy-custom-url-shortening-solution-for-asp-net.aspx</id><published>2009-10-16T07:47:00Z</published><updated>2009-10-16T07:47:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;I tend to write pretty long blog post titles. &lt;/P&gt;
&lt;P&gt;There, I said it. &lt;/P&gt;
&lt;P&gt;That's the first step, right? Admitting the problem? Except I don't usually think it's a problem... &lt;NOBR&gt;:)&lt;/NOBR&gt; Nobody's going to type post URLs, anyway - long ones are really only an issue in one scenario: &lt;A href="http://twitter.com/" mce_href="http://twitter.com/"&gt;Twitter&lt;/A&gt;. And there are already plenty of solutions for &lt;A href="http://en.wikipedia.org/wiki/URL_shortening" mce_href="http://en.wikipedia.org/wiki/URL_shortening"&gt;URL shortening&lt;/A&gt;, so why does the world need &lt;STRONG&gt;another&lt;/STRONG&gt; one? &lt;/P&gt;
&lt;P&gt;It probably doesn't. But I wanted one anyway. In particular, I wanted something ridiculously simple to manage that I had complete control over and that didn't depend on how my web site host configured their server. I wanted to be sure I could use human-readable aliases and never need to worry about namespace collisions (a problem with existing services because all the good names have been taken). Besides, I don't see the point in relying on someone else (or some other web site) to do something I can do for myself pretty easily. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So as long as I'm writing my own URL shortener, I might as well give it a special power or something, right? Well, one thing that seemed pretty useful (to me &lt;STRONG&gt;and&lt;/STRONG&gt; you) was an easy way to list all the supported aliases. Therefore, when you navigate to the &lt;A href="http://cesso.org/r/" mce_href="http://cesso.org/r/"&gt;root of the redirect namespace on my web site&lt;/A&gt;, that's just what you'll get: &lt;/P&gt;&lt;IMG alt="Custom URL shortener in action" src="http://blogs.msdn.com/blogfiles/delay/CustomUrlShortener.png" width=651 height=238 mce_src="http://blogs.msdn.com/blogfiles/delay/CustomUrlShortener.png"&gt; 
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, when I want to point to a blog or sample of mine, instead of linking to it like this: &lt;/P&gt;
&lt;P&gt;&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;http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;I can link to it like this: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://cesso.org/r/DVLinks" mce_href="http://cesso.org/r/DVLinks"&gt;http://cesso.org/r/DVLinks&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;What's more, because these redirects are of the &lt;A href="http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx" mce_href="http://en.wikipedia.org/wiki/URL_redirection#HTTP_status_codes_3xx"&gt;302/Found variety&lt;/A&gt;, I can update where they go when new content becomes available without having to change any existing content. This is something I've wanted for my links post(s) ever since I posted the first version! Problem solved: from now on, the &lt;CODE&gt;DVLinks&lt;/CODE&gt; alias will always take you to my most recent post of Data Visualization links. &lt;/P&gt;
&lt;P&gt;Some of the aliases above use &lt;CODE&gt;MixedCase&lt;/CODE&gt; and some use &lt;CODE&gt;ALLCAPS&lt;/CODE&gt; - there's actually meaning behind that. When I create an alias I intend to be widely useful and expect to use more than once, I'll use mixed case like I did with &lt;CODE&gt;DVLinks&lt;/CODE&gt;. But when I'm creating an alias just so I can post it to Twitter, I'll use all caps like I did for &lt;CODE&gt;TWITTER&lt;/CODE&gt;. This way, it's easy to browse my list of aliases and pick out the particularly interesting ones. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the complete code for the &lt;A href="http://msdn.microsoft.com/en-us/library/system.web.ihttpmodule.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.web.ihttpmodule.aspx"&gt;IHttpModule&lt;/A&gt;-based URL shortener I wrote last night. It's standard ASP.NET and doesn't use any .NET 3.5 features, so it should work fine on pretty much any ASP.NET server. &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;UrlShortener&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IHttpModule
&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; The prefix (directory/namespace) for all redirect requests.
&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;const&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; RedirectPrefix = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"~/r/"&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; Maintains a mapping from alias to Uri for all redirect entries.
&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: #2b91af"&gt;IDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&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;&amp;gt; _aliases =
         &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;SortedDictionary&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&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;&amp;gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;StringComparer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.OrdinalIgnoreCase);

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Initializes the IHttpModule instance.
&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="context"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;HttpApplication instance.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Init(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HttpApplication&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Populate the alias mappings
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        AddAlias(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"ChartBuilder"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://cesso.org/Samples/ChartBuilder/"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        AddAlias(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"DVLinks"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,      &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/archive/2009/07/19/my-new-home-page-enhanced-updated-collection-of-great-silverlight-wpf-data-visualization-resources.aspx"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        AddAlias(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"SLHash"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,       &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://cesso.org/Samples/ComputeFileHashes/"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        AddAlias(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"TWITTER"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,      &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"http://blogs.msdn.com/delay/archive/2009/10/13/if-all-my-friends-jumped-off-a-bridge-apparently-i-would-too-just-created-a-twitter-account-davidans.aspx"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);

        context.BeginRequest += &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;EventHandler&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(HttpApplication_BeginRequest);
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Adds an alias/Uri pair and validates it.
&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="alias"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Alias to add.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;param name="uri"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Uri to associate with the alias.&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; AddAlias(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; alias, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; uri)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Validate the URI when adding it
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        _aliases.Add(alias, &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;(uri, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;UriKind&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Absolute));
    }

    &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; Handles the HttpApplication's BeginRequest event.
&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="source"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;HttpApplication source.&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;Event 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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; HttpApplication_BeginRequest(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; source, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Check if the request is a redirect attempt
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HttpApplication&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HttpApplication&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)source;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; requestPath = context.Request.AppRelativeCurrentExecutionFilePath;
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (requestPath.StartsWith(RedirectPrefix, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;StringComparison&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.OrdinalIgnoreCase))
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Extract the alias
&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; alias = requestPath.Substring(RedirectPrefix.Length);
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (_aliases.ContainsKey(alias))
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Known alias; redirect the user there
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                context.Response.Redirect(_aliases[alias].ToString());
            }
            &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;// Invalid alias; write a simple list of all known aliases
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                &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: #2b91af"&gt;HtmlTextWriter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; writer = &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;HtmlTextWriter&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(context.Response.Output, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;))
                {
                    writer.RenderBeginTag(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterTag&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Html);
                    writer.RenderBeginTag(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterTag&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Head);
                    writer.RenderBeginTag(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterTag&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Title);
                    writer.Write(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Supported Aliases"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                    writer.RenderBeginTag(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterTag&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Body);
                    &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;string&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; key &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _aliases.Keys)
                    {
                        writer.AddAttribute(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterAttribute&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Href, _aliases[key].ToString());
                        writer.RenderBeginTag(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HtmlTextWriterTag&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.A);
                        writer.Write(key);
                        writer.RenderEndTag();
                        writer.WriteBreak();
                        writer.WriteLine();
                    }
                    writer.RenderEndTag();
                    writer.RenderEndTag();
                }
                context.Response.End();
            }
        }
    }

    &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; Disposes of resources.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Dispose()
    {
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;To enable this URL shortener for &lt;A href="http://en.wikipedia.org/wiki/Internet_Information_Services" mce_href="http://en.wikipedia.org/wiki/Internet_Information_Services"&gt;IIS 7&lt;/A&gt;, just save the code above to a .CS file, put that file in the &lt;CODE&gt;App_Code&lt;/CODE&gt; directory at the root of your web site, and register it in &lt;CODE&gt;web.config&lt;/CODE&gt; with something like the following: &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;xml&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;version&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: #0000ff"&gt;1.0&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;?&amp;gt;
&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;configuration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
    &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;system.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
        &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;modules&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
            &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;add&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;=&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;UrlShortener&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #ff0000"&gt;type&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: #0000ff"&gt;UrlShortener&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;/&amp;gt;
        &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;modules&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
    &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;system.webServer&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;configuration&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;&amp;gt;
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;(For IIS 6, you'll need to change &lt;CODE&gt;system.webServer&lt;/CODE&gt; to &lt;CODE&gt;system.web&lt;/CODE&gt; and &lt;CODE&gt;modules&lt;/CODE&gt; to &lt;CODE&gt;httpModules&lt;/CODE&gt; - otherwise it's just the same.)&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9908006" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /></entry><entry><title>If all my friends jumped off a bridge, apparently I would, too [Just created a Twitter account: DavidAns]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/10/13/if-all-my-friends-jumped-off-a-bridge-apparently-i-would-too-just-created-a-twitter-account-davidans.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/10/13/if-all-my-friends-jumped-off-a-bridge-apparently-i-would-too-just-created-a-twitter-account-davidans.aspx</id><published>2009-10-14T05:08:00Z</published><updated>2009-10-14T05:08:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;Until today, I'd never gotten around to signing up for &lt;A href="http://twitter.com/" mce_href="http://twitter.com/"&gt;Twitter&lt;/A&gt;. After all, there are only so many hours in the day... But then &lt;A href="http://community.irritatedvowel.com/blogs/pete_browns_blog/" mce_href="http://community.irritatedvowel.com/blogs/pete_browns_blog/"&gt;Pete Brown&lt;/A&gt; (or should I say &lt;A href="http://twitter.com/Pete_Brown" mce_href="http://twitter.com/Pete_Brown"&gt;Pete_Brown&lt;/A&gt;??) stopped by my office for a quick visit and the topic of Twitter came up. Pete explained that he thought that Twitter would be a good way to help get the word out about Charting - and interact more directly with customers in general. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Sigh...&lt;/EM&gt; he had me at "charting". So I've finally created a Twitter account: I'm &lt;STRONG&gt;&lt;A href="http://twitter.com/DavidAns" mce_href="http://twitter.com/DavidAns"&gt;DavidAns&lt;/A&gt;&lt;/STRONG&gt;. &lt;/P&gt;
&lt;P&gt;To set expectations appropriately, it is &lt;STRONG&gt;not&lt;/STRONG&gt; intended to be a personal account (just like &lt;A href="http://blogs.msdn.com/delay/" mce_href="http://blogs.msdn.com/delay/"&gt;this&lt;/A&gt; is not a personal blog). You're not going to see posts about what I ate for breakfast, what bar I'm drinking at, or what I think about the guy who cut me off in traffic. Instead, my intent is to use Twitter like my blog - as a way to share cool coding tricks, .NET development tidbits, handy tools, and the like. &lt;/P&gt;
&lt;P&gt;That said, I realize Twitter is a more socially interactive environment than a blog, so I can't promise &lt;STRONG&gt;everything&lt;/STRONG&gt; I write will be 100% educational. &lt;NOBR&gt;:)&lt;/NOBR&gt; But I'll definitely try to bias things way more toward signal than noise. &lt;/P&gt;
&lt;P&gt;So if you're on Twitter and have a question for me you've been dying to ask, this is your lucky day. If not, don't worry - I'll continue to blog and answer any questions that come up there! &lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9906989" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Miscellaneous" scheme="http://blogs.msdn.com/delay/archive/tags/Miscellaneous/default.aspx" /></entry><entry><title>Give your computer insomnia [Free tool and source code to temporarily prevent a machine from going to sleep!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/09/30/give-your-computer-insomnia-free-tool-and-source-code-to-temporarily-prevent-a-machine-from-going-to-sleep.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/09/30/give-your-computer-insomnia-free-tool-and-source-code-to-temporarily-prevent-a-machine-from-going-to-sleep.aspx</id><published>2009-10-01T06:41:00Z</published><updated>2009-10-01T06:41:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;The default power settings for Windows are set up so a computer will go to sleep after 15 to 30 minutes of inactivity (i.e., no mouse or keyboard input). This is great because a computer that's not being used doesn't need to be running at full power. By letting an idle machine enter sleep mode, the user benefits from a significant reduction in electricity use, heat generation, component wear, etc.. And because sleep mode preserves the state of everything in memory, it's quick to enter, quick to exit, and doesn't affect the user's work-flow. All the same applications continue running, windows stay open and where they were, etc.. So sleep mode is a &lt;EM&gt;Good Thing&lt;/EM&gt; and I'm a fan. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;However&lt;/STRONG&gt;, sometimes a computer is busy even though someone isn't actively using the mouse and keyboard; common examples include playing a movie, burning a DVD, streaming music, etc.. In these cases, you don't want the machine to go to sleep because you're using it - even though you're not &lt;STRONG&gt;actually&lt;/STRONG&gt; using it! So most media players and disc burners tell Windows not to go to sleep while they're running. In fact, there's a dedicated API for exactly this purpose: the &lt;A href="http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa373208(VS.85).aspx"&gt;SetThreadExecutionState Win32 Function&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;But what about those times when the computer is busy doing something and the relevant program doesn't suppress the default sleep behavior? For example, it might be downloading a large file, re-encoding a music collection, backing up the hard drive, or hashing the entire contents of the disk. You don't want the machine to go to sleep &lt;STRONG&gt;for now&lt;/STRONG&gt;, but are otherwise happy with the default sleep behavior. Unfortunately, the easiest way I know of to temporarily suppress sleeping is to go to Control Panel, open the Power Options page, change the power plan settings, commit them - and then remember to undo everything once the task is finished. It's not hard; but it's kind of annoying... &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So here's a better way: &lt;/P&gt;&lt;IMG alt="Insomnia application" src="http://blogs.msdn.com/blogfiles/delay/Insomnia.png" width=310 height=210 mce_src="http://blogs.msdn.com/blogfiles/delay/Insomnia.png"&gt; 
&lt;P&gt;Insomnia is a simple WPF application that calls the &lt;CODE&gt;SetThreadExecutionState&lt;/CODE&gt; API to disable sleep mode for as long as it's running. (Note that the display can still power off during this time - it's just sleep for the &lt;STRONG&gt;computer&lt;/STRONG&gt; that's blocked.) Closing the Insomnia window immediately restores whatever sleep mode was in effect before it was run. &lt;EM&gt;It couldn't be easier!&lt;/EM&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/Insomnia/Insomnia.zip" mce_href="http://cesso.org/Samples/Insomnia/Insomnia.zip"&gt;[Click here to download the Insomnia application along with its complete source code.]&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;Insomnia basically boils down to a single function call - but to a function that's a Win32 API and is not part of the .NET Framework. This is where a very powerful feature saves the day: &lt;A href="http://msdn.microsoft.com/en-us/library/sd10k43k.aspx" mce_href="http://msdn.microsoft.com/en-us/library/sd10k43k.aspx"&gt;Platform Invoke&lt;/A&gt;. For those who aren't familiar with it, P/Invoke (as it's called) lets a managed application call into the APIs exposed by a native DLL. All it takes is a dash of the &lt;A href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.dllimportattribute.aspx"&gt;DllImport&lt;/A&gt; attribute and a little bit of translation from the Win32 types to their managed counterparts. The MSDN documentation goes into lots of detail here, and I encourage interested parties to go there. &lt;/LI&gt;
&lt;LI&gt;One popular resource for P/Invoke assistance is &lt;A href="http://pinvoke.net/" mce_href="http://pinvoke.net/"&gt;PInvoke.net&lt;/A&gt;, where you can find managed definitions for hundreds of native APIs. But I usually just end up creating my own - if nothing else, it's a good learning exercise. &lt;NOBR&gt;:)&lt;/NOBR&gt; &lt;/LI&gt;
&lt;LI&gt;The Insomnia window has its &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.window.topmost.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.window.topmost.aspx"&gt;Topmost&lt;/A&gt; property set to &lt;CODE&gt;True&lt;/CODE&gt; so it's always visible and people will be less likely to accidentally leave their computers sleep-less. Other than taking up a small bit of screen space and memory, Insomnia consumes no system resources, so it won't get in the way of whatever else is running. &lt;/LI&gt;
&lt;LI&gt;It is considered polite to leave things the way you found them, so Insomnia makes an extra call to &lt;CODE&gt;SetThreadExecutionState&lt;/CODE&gt; when it's closed in order to restore things to how they were. However, this is really more for show than anything else, because the execution state is clearly per-thread and Insomnia's thread is about to die anyway. &lt;/LI&gt;
&lt;LI&gt;I did a quick web search for similar tools before I wrote Insomnia and there are a few out there. Most of what I found was for Linux and Mac for some reason, but I'm sure Insomnia isn't the first of its kind for Windows. However, that doesn't stop it from being a nice introduction to P/Invoke - and besides, I'm always happier running my own code! &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;Finally, here's the implementation: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;partial&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window1&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; : &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window
&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;uint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; m_previousExecutionState;

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Window1()
    {
        InitializeComponent();

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Set new state to prevent system sleep (note: still allows screen saver)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        m_previousExecutionState = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NativeMethods&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetThreadExecutionState(
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NativeMethods&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.ES_CONTINUOUS | &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NativeMethods&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.ES_SYSTEM_REQUIRED);
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (0 == m_previousExecutionState)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MessageBox&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Show(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Call to SetThreadExecutionState failed unexpectedly."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;,
                Title, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MessageBoxButton&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.OK, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MessageBoxImage&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Error);
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// No way to recover; fail gracefully
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            Close();
        }
    }

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;protected&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;override&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; OnClosed(System.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;base&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.OnClosed(e);

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Restore previous state
&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 == &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NativeMethods&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.SetThreadExecutionState(m_previousExecutionState))
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// No way to recover; already exiting
&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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; Hyperlink_RequestNavigate(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;RequestNavigateEventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Start an instance of the NavigateUri (in a browser window)
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Process&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Start(((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Hyperlink&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)sender).NavigateUri.ToString());
    }
}

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;internal&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;NativeMethods
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Import SetThreadExecutionState Win32 API and necessary flags
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    [&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;DllImport&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"kernel32.dll"&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;extern&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;uint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; SetThreadExecutionState(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;uint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; esFlags);
    &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;const&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;uint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ES_CONTINUOUS = 0x80000000;
    &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;const&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;uint&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; ES_SYSTEM_REQUIRED = 0x00000001;
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9901642" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><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 rel="alternate" type="text/html" href="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" /><id>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</id><published>2009-09-24T08:14:00Z</published><updated>2009-09-24T08:14:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><title>I get by with a little help from my friends [PieSeries annotations trilogy complete!]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/09/21/i-get-by-with-a-little-help-from-my-friends-pieseries-annotations-trilogy-complete.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/09/21/i-get-by-with-a-little-help-from-my-friends-pieseries-annotations-trilogy-complete.aspx</id><published>2009-09-21T10:37:00Z</published><updated>2009-09-21T10:37:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>A preview of upcoming Charting changes [Silverlight/WPF Data Visualization Development Release 1]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/09/13/a-preview-of-upcoming-charting-changes-silverlight-wpf-data-visualization-development-release-1.aspx</id><published>2009-09-14T09:40:00Z</published><updated>2009-09-14T09:40:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /><category term="Silverlight Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight+Toolkit/default.aspx" /><category term="WPF Toolkit" scheme="http://blogs.msdn.com/delay/archive/tags/WPF+Toolkit/default.aspx" /></entry><entry><title>When framework designers outsmart themselves [How to: Perform streaming HTTP uploads with .NET]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/09/08/when-framework-designers-outsmart-themselves-how-to-perform-streaming-http-uploads-with-net.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/09/08/when-framework-designers-outsmart-themselves-how-to-perform-streaming-http-uploads-with-net.aspx</id><published>2009-09-09T08:31:00Z</published><updated>2009-09-09T08:31:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;As part of a personal project, I had a scenario where I expected to be doing large HTTP uploads (ex: &lt;A href="http://en.wikipedia.org/wiki/Http#Request_methods" mce_href="http://en.wikipedia.org/wiki/Http#Request_methods"&gt;PUT&lt;/A&gt;) over a slow network connection. The typical user experience here is to show a progress bar, and that's exactly what I wanted to do. So I wrote some code to start the upload and then write to the resulting &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.sockets.networkstream.aspx"&gt;NetworkStream&lt;/A&gt; in small chunks, updating the progress bar UI after each chunk was sent. In theory (and my test harness), this approach worked perfectly; in practice, it did &lt;STRONG&gt;not&lt;/STRONG&gt;... &lt;/P&gt;
&lt;P&gt;What I saw instead was that the progress bar would quickly go from 0% to 100% - then the application would stall for a long time before completing the upload. Which is &lt;STRONG&gt;not&lt;/STRONG&gt; a good user experience, I'm afraid. I'll show what I did wrong in a bit, but first let's take a step back to look at the sample application I've written for this post. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The core of the sample app is a simple &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.httplistener.aspx"&gt;HttpListener&lt;/A&gt; that logs a message whenever it begins an operation, reads an uploaded byte, and finishes reading a request: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Create a simple HTTP listener
&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; listener = &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;HttpListener&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;())
{
    listener.Prefixes.Add(_uri);
    listener.Start();

    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// ...

&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Trivially handle each action's incoming request
&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; i = 0; i &amp;lt; actions.Length; i++)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; context = listener.GetContext();
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; request = context.Request;
        Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'S'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Got "&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; + request.HttpMethod + &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;" request"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        &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 = request.InputStream)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;while&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (-1 != stream.ReadByte())
            {
                Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'S'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Read request byte"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
            }
            Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'S'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Request complete"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        }
        context.Response.Close();
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: The code is straightforward, but it's important to note that &lt;CODE&gt;HttpListener&lt;/CODE&gt; is only able to start listening when run with &lt;CODE&gt;Administrator&lt;/CODE&gt; privileges (otherwise it throws "HttpListenerException: Access is denied"). So if you're going to try the sample yourself, please remember to run it from an elevated Visual Studio or Command Prompt instance. &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With our test harness in place, let's start with the simplest possible code to upload some data: &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; Test action that uses WebClient's UploadData to do the PUT.
&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;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; PutWithWebClient()
{
    &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; client = &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;WebClient&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;())
    {
        Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Start WebClient.UploadData"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
        client.UploadData(_uri, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"PUT"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, _data);
        Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"End WebClient.UploadData"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Here's the resulting output from the &lt;CODE&gt;C&lt;/CODE&gt;lient and &lt;CODE&gt;S&lt;/CODE&gt;erver pieces): &lt;/P&gt;&lt;PRE&gt;09:27:07.72 &amp;lt;C&amp;gt; Start WebClient.UploadData
09:27:07.76 &amp;lt;S&amp;gt; Got PUT request
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:07.76&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:07.76&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:07.76&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:07.76&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:07.76&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
09:27:07.76 &amp;lt;S&amp;gt; Request complete
09:27:07.76 &amp;lt;C&amp;gt; End WebClient.UploadData&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.webclient.aspx"&gt;WebClient&lt;/A&gt;'s &lt;A href="http://msdn.microsoft.com/en-us/library/ms144223.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms144223.aspx"&gt;UploadData&lt;/A&gt; method offers a super-simple way of performing an upload that's a great choice when it works for your scenario. However, all the upload data must be passed as a parameter to the method call, and that's not always desirable (especially for large amounts of data like I was dealing with). Furthermore, it's all sent to the server in arbitrarily large chunks, so our attempt at frequent progress updates isn't likely to work out very well. And while there's the &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadprogresschanged.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.webclient.uploadprogresschanged.aspx"&gt;OnUploadProgressChanged&lt;/A&gt; event for getting status information about an upload, &lt;CODE&gt;WebClient&lt;/CODE&gt; doesn't offer the granular level of control that's often nice to have. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So &lt;CODE&gt;WebClient&lt;/CODE&gt; is a great entry-level API for uploading - but if you're looking for more control, you probably want to upgrade to &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx"&gt;HttpWebRequest&lt;/A&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; Test action that uses a normal HttpWebRequest to do the PUT.
&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;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; PutWithNormalHttpWebRequest()
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; request = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HttpWebRequest&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WebRequest&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Create(_uri));
    request.Method = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"PUT"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
    Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Start normal HttpWebRequest"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    &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 = request.GetRequestStream())
    {
        &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; b &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _data)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Sleep(1000);
            Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Writing byte"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
            stream.WriteByte(b);
        }
    }
    Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"End normal HttpWebRequest"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    ((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IDisposable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(request.GetResponse())).Dispose();
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Aside from the &lt;A href="http://msdn.microsoft.com/en-us/library/d00bd51t.aspx" mce_href="http://msdn.microsoft.com/en-us/library/d00bd51t.aspx"&gt;Sleep&lt;/A&gt; call I've added to simulate client-side processing delays, this is quite similar to the code I wrote for my original scenario. Here's the output: &lt;/P&gt;&lt;PRE&gt;09:27:08.78 &amp;lt;C&amp;gt; Start normal HttpWebRequest
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:09.79&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:10.81&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:11.82&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:12.83&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
09:27:13.85 &amp;lt;C&amp;gt; End normal HttpWebRequest
09:27:13.85 &amp;lt;S&amp;gt; Got PUT request
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:13.85&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
09:27:13.85 &amp;lt;S&amp;gt; Request complete
&lt;/PRE&gt;
&lt;P&gt;Although I've foreshadowed this unsatisfactory result, maybe you can try to act a &lt;STRONG&gt;little&lt;/STRONG&gt; surprised that it didn't work the way we wanted... &lt;NOBR&gt;:)&lt;/NOBR&gt; The data bytes got written at 1 second intervals over the span of 5 seconds to simulate a gradual upload from the client - but on the server side it all arrived at the &lt;STRONG&gt;same&lt;/STRONG&gt; time after the client was completely finished making its request. This is exactly the behavior I was seeing in my application, so it's nice that we've managed to reproduce the problem. &lt;/P&gt;
&lt;P&gt;But what in the world is going on here? Why is that data sitting around on the client for so long? &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer lies in the documentation for the &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.allowwritestreambuffering.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.allowwritestreambuffering.aspx"&gt;AllowWriteStreamBuffering&lt;/A&gt; property (default value: &lt;CODE&gt;True&lt;/CODE&gt;): &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Remarks&lt;/STRONG&gt;&lt;BR&gt;When &lt;CODE&gt;AllowWriteStreamBuffering&lt;/CODE&gt; is &lt;CODE&gt;true&lt;/CODE&gt;, the data is buffered in memory so it is ready to be resent in the event of redirections or authentication requests. &lt;BR&gt;&lt;BR&gt;&lt;STRONG&gt;Notes to Implementers:&lt;/STRONG&gt;&lt;BR&gt;Setting &lt;CODE&gt;AllowWriteStreamBuffering&lt;/CODE&gt; to &lt;CODE&gt;true&lt;/CODE&gt; might cause performance problems when uploading large datasets because the data buffer could use all available memory. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;In trying to save me from the hassle of redirects and authentication requests, &lt;CODE&gt;HttpWebRequest&lt;/CODE&gt; has broken my cool streaming scenario. &lt;NOBR&gt;:(&lt;/NOBR&gt; Fortunately, it's easy to fix - just set the property to &lt;CODE&gt;False&lt;/CODE&gt;, right? &lt;/P&gt;
&lt;P&gt;Wrong; that'll get you one of these: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;ProtocolViolationException&lt;/STRONG&gt;: When performing a write operation with AllowWriteStreamBuffering set to false, you must either set ContentLength to a non-negative number or set SendChunked to true. &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay, so we need to set one more property before we're done. Fortunately, the choice was easy for me - my target server didn't support &lt;A href="http://en.wikipedia.org/wiki/Chunked_transfer_encoding" mce_href="http://en.wikipedia.org/wiki/Chunked_transfer_encoding"&gt;chunked transfer encoding&lt;/A&gt;, so choosing to set &lt;A href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.contentlength.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.contentlength.aspx"&gt;ContentLength&lt;/A&gt; was a no-brainer. The only catch is that you need to know how much data you're going to upload before you start - but that's probably true most of the time anyway! And I think &lt;CODE&gt;ContentLength&lt;/CODE&gt; is a better choice in general, because the average web server is more likely to support it than chunked encoding. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Making the highlighted changes below gives the streaming upload behavior we've been working toward: &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; Test action that uses an unbuffered HttpWebRequest to do the PUT.
&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;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; PutWithUnbufferedHttpWebRequest()
{
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;var&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; request = (&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;HttpWebRequest&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WebRequest&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Create(_uri));
    request.Method = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"PUT"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
&lt;/SPAN&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&lt;SPAN style="COLOR: #008000"&gt;    // Disable AllowWriteStreamBuffering allows the request bytes to send immediately
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    request.AllowWriteStreamBuffering = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;false&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;;
    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Doing nothing else will result in "ProtocolViolationException: When performing
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// a write operation with AllowWriteStreamBuffering set to false, you must either
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// set ContentLength to a non-negative number or set SendChunked to true.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// The most widely supported approach is to set the ContentLength property
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    request.ContentLength = _data.Length;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;
    Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Start unbuffered HttpWebRequest"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    &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 = request.GetRequestStream())
    {
        &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; b &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;in&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _data)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Thread&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Sleep(1000);
            Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"Writing byte"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
            stream.WriteByte(b);
        }
    }
    Log(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;'C'&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;"End unbuffered HttpWebRequest"&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
    ((&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;IDisposable&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;)(request.GetResponse())).Dispose();
}
&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;Here's the proof - note how each byte gets uploaded to the server as soon as it's written: &lt;/P&gt;&lt;PRE&gt;09:27:14.86 &amp;lt;C&amp;gt; Start unbuffered HttpWebRequest
09:27:14.86 &amp;lt;S&amp;gt; Got PUT request
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:15.88&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:15.88&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:16.89&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:16.89&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:17.90&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:17.90&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:18.92&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:18.92&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:19.93&lt;/SPAN&gt; &amp;lt;C&amp;gt; Writing byte
09:27:19.93 &amp;lt;C&amp;gt; End unbuffered HttpWebRequest
&lt;SPAN style="BACKGROUND-COLOR: orange"&gt;09:27:19.93&lt;/SPAN&gt; &amp;lt;S&amp;gt; Read request byte
09:27:19.93 &amp;lt;S&amp;gt; Request complete&lt;/PRE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Like many things in life, it's easy once you know the answer! &lt;NOBR&gt;:)&lt;/NOBR&gt; So if you find yourself wondering why your streaming uploads aren't so streaming, have a look at the &lt;CODE&gt;AllowWriteStreamBuffering&lt;/CODE&gt; property and see if maybe that's the cause of your problems. &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/StreamingHttpPut/StreamingHttpPut.zip" mce_href="http://cesso.org/Samples/StreamingHttpPut/StreamingHttpPut.zip"&gt;[Please click here to download a sample application demonstrating everything shown here.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9892957" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /></entry><entry><title>Get out of the way with the tray ["Minimize to tray" sample implementation for WPF]</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/delay/archive/2009/08/31/get-out-of-the-way-with-the-tray-minimize-to-tray-sample-implementation-for-wpf.aspx" /><id>http://blogs.msdn.com/delay/archive/2009/08/31/get-out-of-the-way-with-the-tray-minimize-to-tray-sample-implementation-for-wpf.aspx</id><published>2009-09-01T08:46:00Z</published><updated>2009-09-01T08:46:00Z</updated><content type="html">&lt;DIV class=delay&gt;
&lt;P&gt;"Minimize to tray" is a feature in some applications where minimizing the application removes its taskbar button and replaces it with a (much smaller) notification area icon. Clicking that notification icon restores the application's window - just like clicking its taskbar button would have done. &lt;/P&gt;
&lt;P&gt;Well, I was considering using this functionality in a project I'm working on, so I looked to see what my options were. This feature didn't seem to be directly supported by WPF, so I searched the web a bit. What I found after a minute or two of searching was plenty of questions about how to implement this, a few suggestions, and not a lot else. So I figured I'd put something together myself and post it to my blog... &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the sample application I'm about minimize - note the (boring) green square of an application icon: &lt;/P&gt;&lt;IMG alt="About to minimize" src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Minimize.png" width=300 height=300 mce_src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Minimize.png"&gt; 
&lt;P&gt;And here's what things look like &lt;STRONG&gt;just after&lt;/STRONG&gt; the application is minimized to the tray: &lt;/P&gt;&lt;IMG alt="Notify balloon" src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Balloon.png" width=265 height=92 mce_src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Balloon.png"&gt; 
&lt;P&gt;Aside from just looking cool, that notification bubble serves an important purpose: it helps to draw the user's attention to the new icon in the notification area and calls out the application's custom minimize behavior. (To avoid being annoying, the bubble is only shown the first time the application is minimized each time it's run.) This is a nice convenience on most versions of Windows, but is pretty much &lt;STRONG&gt;necessary&lt;/STRONG&gt; due to the new &lt;A href="http://msdn.microsoft.com/en-us/library/aa511448.aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa511448.aspx"&gt;Windows 7 behavior of hiding notification area icons as quickly as possible&lt;/A&gt;. Without a helpful indication like this bubble, users might "lose" the application when it minimizes to the tray. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: I understand why the Windows 7 team introduced this new behavior and I think it's perfectly reasonable. However, it has implications for this scenario, so it's good to think twice (or thrice!) about choosing to use "minimize to tray" in your application. The document I link to above has lots more guidance on the proper use of notification icons - interested parties are encouraged to review it! &lt;/BLOCKQUOTE&gt;
&lt;P&gt;After Windows 7 hides the notification icon for the application, it can be accessed via the "Show hidden icons" popup. Clicking on the hidden notification icon restores the application just like you'd expect: &lt;/P&gt;&lt;IMG alt="Hidden by Windows 7" src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Hidden.png" width=295 height=186 mce_src="http://blogs.msdn.com/blogfiles/delay/MinimizeToTrayDemo-Hidden.png"&gt; 
&lt;BLOCKQUOTE&gt;&lt;STRONG&gt;Aside&lt;/STRONG&gt;: If you really dislike the new hiding behavior, it's easy to disable - just click the "Customize..." link (shown in the image above) and you'll be presented with a window that lets you disable this behavior for specific applications - or disable it for &lt;STRONG&gt;all&lt;/STRONG&gt; of them with a single checkbox. &lt;/BLOCKQUOTE&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;I've implemented this functionality in a static &lt;CODE&gt;MinimizeToTray&lt;/CODE&gt; class with a single &lt;CODE&gt;Enable&lt;/CODE&gt; method that's super-easy to use. Just add a call to it in your &lt;CODE&gt;Window&lt;/CODE&gt;'s constructor and you're done: &lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Enable "minimize to tray" behavior for this Window
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MinimizeToTray&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Enable(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;this&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/LI&gt;
&lt;LI&gt;WPF doesn't natively offer notify icon support, but there's nothing stopping us from using the &lt;A href="http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon.aspx"&gt;NotifyIcon&lt;/A&gt; implementation that's part of WinForms! That's what &lt;CODE&gt;MinimizeToTray&lt;/CODE&gt; does, so it's important to note that you'll need to change your project to add references to the &lt;CODE&gt;System.Drawing&lt;/CODE&gt; and &lt;CODE&gt;System.Windows.Forms&lt;/CODE&gt; .NET assemblies. (FYI, they're both part of the .NET Framework and are already present in the &lt;A href="http://en.wikipedia.org/wiki/Global_Assembly_Cache" mce_href="http://en.wikipedia.org/wiki/Global_Assembly_Cache"&gt;GAC&lt;/A&gt; (and &lt;A href="http://en.wikipedia.org/wiki/Common_Intermediate_Language#Native_image_generator_compilation" mce_href="http://en.wikipedia.org/wiki/Common_Intermediate_Language#Native_image_generator_compilation"&gt;NGEN&lt;/A&gt;-ed), so you don't need to worry about distributing them with your application.) &lt;/LI&gt;
&lt;LI&gt;But it's also important to note that I've written my code such that &lt;CODE&gt;MinimizeToTray&lt;/CODE&gt; doesn't cause &lt;STRONG&gt;either&lt;/STRONG&gt; of these assemblies get loaded until the user first minimizes the application. This means neither assembly will impact the startup time of your application! (You can verify this by running the sample application, attaching the debugger, checking the module list to see that neither assembly is present, minimizing the application, and then noting that both assemblies just got loaded.) &lt;/LI&gt;
&lt;LI&gt;I only use the most basic notify icon functionality in this sample, so the WinForms implementation is more than adequate for my needs. However, if you're looking for true WPF-style notification icon support, &lt;A href="http://www.hardcodet.net/projects/wpf-notifyicon" mce_href="http://www.hardcodet.net/projects/wpf-notifyicon"&gt;this implementation by Philipp Sumi&lt;/A&gt; looks quite promising (though I haven't tried it myself). &lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As a final favor, I'll ask that people please use "minimize to tray" wisely - just because you &lt;STRONG&gt;can&lt;/STRONG&gt; minimize your application to the tray doesn't mean you &lt;STRONG&gt;should&lt;/STRONG&gt;. &lt;NOBR&gt;:)&lt;/NOBR&gt; Minimizing to the tray is something that's only meaningful for a limited set of scenarios - but if you find yourself in one of them, I hope &lt;CODE&gt;MinimizeToTray&lt;/CODE&gt; is helpful! &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/MinimizeToTrayDemo/MinimizeToTrayDemo.zip" mce_href="http://cesso.org/Samples/MinimizeToTrayDemo/MinimizeToTrayDemo.zip"&gt;[Click here to download the sample application and complete source code for &lt;CODE&gt;MinimizeToTray&lt;/CODE&gt;.]&lt;/A&gt; &lt;/STRONG&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The code is quite straightforward - here it is in its entirety: &lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="COLOR: #000000"&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Class implementing support for "minimize to tray" functionality.
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;static&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MinimizeToTray
&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; Enables "minimize to tray" behavior for the specified Window.
&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="window"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Window to enable the behavior for.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;/param&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;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; Enable(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; window)
    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// No need to track this instance; its event handlers will keep it alive
&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;MinimizeToTrayInstance&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(window);
    }

    &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; Class implementing "minimize to tray" functionality for a Window instance.
&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;class&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;MinimizeToTrayInstance
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;    {
        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;private&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _window;
        &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;NotifyIcon&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _notifyIcon;
        &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;bool&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; _balloonShown;

        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;&amp;lt;summary&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;        &lt;/SPAN&gt;&lt;SPAN style="COLOR: #808080"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt; Initializes a new instance of the MinimizeToTrayInstance class.
&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="window"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Window instance to attach 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: #0000ff"&gt;public&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; MinimizeToTrayInstance(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Window&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; window)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Debug&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Assert(window != &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: #a31515"&gt;"window parameter is null."&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;);
            _window = window;
            _window.StateChanged += &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;EventHandler&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(HandleStateChanged);
        }

        &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; Handles the Window's StateChanged event.
&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="sender"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Event source.&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;Event 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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; HandleStateChanged(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (_notifyIcon == &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: #008000"&gt;// Initialize NotifyIcon instance "on demand"
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                _notifyIcon = &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;NotifyIcon&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;();
                _notifyIcon.Icon = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Icon&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.ExtractAssociatedIcon(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;Assembly&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.GetEntryAssembly().Location);
                _notifyIcon.MouseClick += &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;MouseEventHandler&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(HandleNotifyIconOrBalloonClicked);
                _notifyIcon.BalloonTipClicked += &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;EventHandler&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;(HandleNotifyIconOrBalloonClicked);
            }
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Update copy of Window Title in case it has changed
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            _notifyIcon.Text = _window.Title;

            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Show/hide Window and NotifyIcon
&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; minimized = (_window.WindowState == &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WindowState&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Minimized);
            _window.ShowInTaskbar = !minimized;
            _notifyIcon.Visible = minimized;
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;if&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; (minimized &amp;amp;&amp;amp; !_balloonShown)
            {
                &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// If this is the first time minimizing to the tray, show the user what happened
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;                _notifyIcon.ShowBalloonTip(1000, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;null&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;, _window.Title, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;ToolTipIcon&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.None);
                _balloonShown = &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: #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; Handles a click on the notify icon or its balloon.
&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="sender"&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;Event source.&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;Event 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;void&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; HandleNotifyIconOrBalloonClicked(&lt;/SPAN&gt;&lt;SPAN style="COLOR: #0000ff"&gt;object&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; sender, &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;EventArgs&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt; e)
        {
            &lt;/SPAN&gt;&lt;SPAN style="COLOR: #008000"&gt;// Restore the Window
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;            _window.WindowState = &lt;/SPAN&gt;&lt;SPAN style="COLOR: #2b91af"&gt;WindowState&lt;/SPAN&gt;&lt;SPAN style="COLOR: #000000"&gt;.Normal;
        }
    }
}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9889700" width="1" height="1"&gt;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/delay/archive/tags/WPF/default.aspx" /></entry><entry><title>Following up on some of the attention [Live sample posted and a *very* small tweak to the Html5Canvas source code!]</title><link rel="alternate" type="text/html" href="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" /><id>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</id><published>2009-08-27T09:42:00Z</published><updated>2009-08-27T09:42:00Z</updated><content type="html">&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;</content><author><name>Delay</name><uri>http://blogs.msdn.com/members/Delay.aspx</uri></author><category term="Technical" scheme="http://blogs.msdn.com/delay/archive/tags/Technical/default.aspx" /><category term="Silverlight" scheme="http://blogs.msdn.com/delay/archive/tags/Silverlight/default.aspx" /></entry></feed>