<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Karsten Januszewski on 'wpf'</title><description>Karsten Januszewski blog posts filtered by a specific tag</description><link>/irhetoric/blog/tags/wpf/default.aspx</link><language>en-us</language><pubDate>Wed, 20 Aug 2008 11:33:32 GMT</pubDate><generator>Oxite</generator><item><title>Portfolio as WPF and ASP.NET</title><description>&lt;p&gt;I recently wanted to put together a portfolio page of the various code and samples that I've worked on over the last few years.&amp;#160; To do so, I created a very simple xml file, which you can see &lt;a href="http://rhizohm.net/portfolio/archive.xml"&gt;here&lt;/a&gt;.&amp;#160; Then, I decided to create two different UI experiences to display the UI, one in ASP.NET and one as a WPF .XBAP.&amp;#160; I added &lt;a href="http://rhizohm.net/portfolio/portfoliochecker.htm"&gt;a page&lt;/a&gt; that uses javascript to detect if a user has .NET 3.0 and, if they do, I send them to the &lt;a href="http://rhizohm.net/portfolio/portfolioxbap.xbap"&gt;.XBAP&lt;/a&gt;.&amp;#160; If they don't, I send them to the &lt;a href="http://rhizohm.net/portfolio/portfolio.aspx"&gt;ASP.NET page&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Each implementation turned out to be pretty simple to create and have quite a few similarities. &lt;/p&gt;  &lt;p&gt;I like how both data models have something in place to handle nested hierarchies.&amp;#160; In ASP.NET, it is done by using a &lt;strong&gt;Repeater&lt;/strong&gt; inside a &lt;strong&gt;Repeater&lt;/strong&gt;, setting the DataSource with an XPathSelect.&amp;#160; In WPF, it is done by nesting an ItemsControl inside the DataTemplate, setting the &lt;strong&gt;ItemsSource&lt;/strong&gt; to the right XPath.&lt;/p&gt;  &lt;p&gt;I also had to handle the case where I didn't have a string value. For example, not all samples have videos, which in the XML looks like this: &amp;lt;VideoUri/&amp;gt;.&amp;#160; In ASP.NET, if I had an empty string,&amp;#160; the syntax I used to not display the URL was to put an expression in the Visible field:    &lt;br /&gt;&lt;/p&gt;  &lt;blockquote&gt;   &lt;pre class="csharpcode"&gt;Visible='&lt;span class="asp"&gt;&amp;lt;%&lt;/span&gt;#XPath(&lt;span class="str"&gt;&amp;quot;VideoUri&amp;quot;&lt;/span&gt;) != &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty &lt;span class="asp"&gt;%&amp;gt;&lt;/span&gt;'&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;In WPF, I first thought that the built-in &lt;strong&gt;BooleanToVisibilityConverter &lt;/strong&gt;would do the trick, but because you can't do expressions in WPF databinding, I had to whip up a quick converter:&lt;/p&gt;

&lt;pre class="csharpcode"&gt;    &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; EmptyStringToVisibilityConverter : IValueConverter
    {
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; Convert(&lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;, Type targetType, &lt;span class="kwrd"&gt;object&lt;/span&gt; parameter, CultureInfo culture)
        {
            &lt;span class="kwrd"&gt;string&lt;/span&gt; strValue = &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
            &lt;span class="kwrd"&gt;if&lt;/span&gt; (&lt;span class="kwrd"&gt;string&lt;/span&gt;.IsNullOrEmpty((&lt;span class="kwrd"&gt;string&lt;/span&gt;)&lt;span class="kwrd"&gt;value&lt;/span&gt;))
                &lt;span class="kwrd"&gt;return&lt;/span&gt; Visibility.Collapsed;
            &lt;span class="kwrd"&gt;else&lt;/span&gt;
                &lt;span class="kwrd"&gt;return&lt;/span&gt; Visibility.Visible;

        }
        &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;object&lt;/span&gt; ConvertBack(&lt;span class="kwrd"&gt;object&lt;/span&gt; &lt;span class="kwrd"&gt;value&lt;/span&gt;, Type targetType, &lt;span class="kwrd"&gt;object&lt;/span&gt; parameter, CultureInfo culture)
        {
            &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;null&lt;/span&gt;;
        }
    }&lt;/pre&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;And then in the XAML, I used the converter as such:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;pre class="csharpcode"&gt;Visibility=&lt;span class="str"&gt;&amp;quot;{Binding Mode=Default, XPath=VideoUri, Converter={StaticResource StringToVis}}&amp;quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;Here's some little lessons learned and gotchas:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;ASP.NET: When using the asp:HyperLink tag in conjunction with the #XPath syntax, I had to use single quotes (') instead of double quotes (&amp;quot;) to make the parser happy.&lt;/li&gt;

  &lt;li&gt;WPF: Remember to wrap your ItemsControl in a ScrollViewer, since scrolling doesn't come for free with &lt;strong&gt;ItemsControl&lt;/strong&gt;.&lt;/li&gt;

  &lt;li&gt;WPF: I used the &lt;a href="http://www.blagoev.com/Blog/post/Building-a-WPF-LinkLabel-control.aspx"&gt;LinkLabel&lt;/a&gt; control by &lt;a href="http://www.blagoev.com/Blog/"&gt;Lubo Blagoev&lt;/a&gt; which was quite nifty.&amp;#160; &lt;/li&gt;

  &lt;li&gt;WPF: To download the XML from the server to the XBAP, I used the pack://siteoforigin:,,,/ syntax.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So, recursively, I've added the code for my portfolio to &lt;a href="http://rhizohm.net/portfolio/portfoliochecker.htm"&gt;my portfolio&lt;/a&gt;, which is where you can get the code. The next thing I want to do is add a tag cloud to the application, probably using LINQ. I also want to make the WPF page more interesting to show what you can do above and beyond just displaying the information.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/62/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/62/default.aspx</link><pubDate>Wed, 21 May 2008 19:41:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/62/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>3</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/62/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Interview With Effective UI</title><description>&lt;p&gt;&lt;a href="http://www.effectiveui.com/"&gt;Effective UI&lt;/a&gt; has put together a site called the &lt;a href="http://www.uiresourcecenter.com"&gt;User Interface Resource Center&lt;/a&gt;.&amp;#160; They were kind enough to interview me about WPF, Silverlight, Expression and more.&amp;#160; As they put it:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;In the 2008 whitepaper &amp;#8220;The New Iteration,&amp;#8221; Karsten Januszewski teams up with Jaime Rodriguez to spotlight what Microsoft has dubbed the XAML revolution. Based on interviews with early Windows Presentation (WPF) and Silverlight users, Januszewski drills into emerging Microsoft technologies and explores how the designer/developer collaborative process is undergoing change. But, what's the bigger picture? Why is Microsoft investing so heavily in UI Technologies? What are the business benefits that will drive adoption in a field traditionally dominated by rivals? These questions and others are answered here. &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can read &lt;a href="http://www.uiresourcecenter.com/ui-technologies/microsoft-silverlight/articles.html?s=3_3_1"&gt;the full article here&lt;/a&gt; or &lt;a href="http://www.uiresourcecenter.com/ui-technologies/microsoft-silverlight/articles/karsten_interview_edit-1.mp3"&gt;download the interview&lt;/a&gt;.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/60/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/60/default.aspx</link><pubDate>Tue, 06 May 2008 16:16:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/60/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/60/trackback/default.aspx</trackback:ping><category>Silverlight</category><category>Silverlight 2</category><category>WPF</category></item><item><title>Transitionals</title><description>&lt;p&gt;It was almost a year ago that the transition controls were quietly released for WPF, which &lt;a href="http://blogs.msdn.com/karstenj/archive/2007/05/08/transition-and-reveal-new-custom-controls-for-wpf-updated-avalon-feature-fest.aspx" target="_blank"&gt;I blogged about and included in the WPF Feature Fest&lt;/a&gt; (&lt;a href="http://wpf.netfx3.com/files/folders/code_snippets/entry3752.aspx" target="_blank"&gt;source&lt;/a&gt; and &lt;a href="http://wpf.netfx3.com/direct/avalonfeaturefest/publish.htm" target="_blank"&gt;deployed app&lt;/a&gt;):&lt;/p&gt;  &lt;p&gt;&lt;img height="222" src="http://winfx.members.winisp.net/images/limecat1.jpg" width="205" /&gt; &lt;img height="222" src="http://winfx.members.winisp.net/images/limecat2.jpg" width="205" /&gt; &lt;/p&gt;  &lt;p&gt;The guts of this project is now available as &lt;a href="http://www.codeplex.com/transitionals" target="_blank"&gt;Transitionals on Codeplex&lt;/a&gt;.&amp;#160; A lot of the code has been refactored quite nicely. What's really great about this release is the accompanying documentation, which is incredibly thorough.&amp;#160; &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/59/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/59/default.aspx</link><pubDate>Tue, 29 Apr 2008 20:13:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/59/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/59/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Using Flotzam At A Conference</title><description>&lt;p&gt;Here is a guide for using Flotzam at a conference:&lt;/p&gt;  &lt;p&gt;Flotzam at a conference is fun. It gives the audience the ability to immediately participate in the event as well as on the blogosphere. Their photos, twitters, etc, show up on the big screen.&lt;/p&gt;  &lt;p&gt;If you would like to see Flotzam in action, you can (1) install the application from &lt;a href="http://www.flotzam.com"&gt;http://www.flotzam.com&lt;/a&gt; or (2) watch a video about the application at &lt;a href="http://flotzam.com/video.htm"&gt;http://flotzam.com/video.htm&lt;/a&gt;. You can also watch a video that discusses the Mix Flotzam Restyle contest and the winners here: &lt;a href="http://visitmix.com/blogs/News/Flotzam-Design-Contest-Winner/"&gt;http://visitmix.com/blogs/News/Flotzam-Design-Contest-Winner/&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;If you aren&amp;#8217;t familiar with these social networks used by Flotzam, here&amp;#8217;s a brief intro of what they are and why they are interesting.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Twitter allows you to text messages from your phone to the Twitter service, which then get posted on the web. So, by displaying Twitters from conference attendees, you can see almost real time information about what people are saying about the conference.&lt;/li&gt;    &lt;li&gt;Flickr and Facebook integration is about allowing attendees to upload their photos of the event to their service and then Flotzam will pull and display their photos.&lt;/li&gt;    &lt;li&gt;Digg is service that allows the community to post interesting stories and then vote on their relevance.&lt;/li&gt;    &lt;li&gt;RSS is a syndication format supported widely &amp;#8211; you can display any RSS feed through Flotzam.&lt;/li&gt;    &lt;li&gt;YouTube is a site that allows people to upload video.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;The end result is that Flotzam aggregates all these networks and does a fun visualization.&lt;/p&gt;  &lt;p&gt;A few things to note: &lt;/p&gt;  &lt;p&gt;&amp;#183; If there is another social network you want to add to Flotzam, it requires more code to be written. There&amp;#8217;s an explanation of how to do it here: &lt;a href="http://flotzam.com/blog/post/How-To-Add-A-New-Datasource-To-Flotzam.aspx"&gt;http://flotzam.com/blog/post/How-To-Add-A-New-Datasource-To-Flotzam.aspx&lt;/a&gt;. An easier route to getting different data into Flotzam is if that social network supports RSS.&lt;/p&gt;  &lt;p&gt;&amp;#183; Because Flotzam pulls data real time, there is the chance that inappropriate content could appear on the screen.&lt;/p&gt;  &lt;p&gt;&lt;ins cite="mailto:Karsten%20Januszewski" datetime="2008-04-15T16:34"&gt;&lt;/ins&gt;&lt;/p&gt;  &lt;p&gt;If you would like to use Flotzam for your conference, you need to do the following:&lt;/p&gt;  &lt;p&gt;1. Download the .exe build of Flotzam here:&amp;#160; &lt;a href="http://www.flotzam.com/download/flotzam.zip"&gt;http://www.flotzam.com/download/flotzam.zip&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2. You should have a machine with w/2GB RAM and a video card of 256MB. Be sure to test on your hardware to catch any issues in advance.&lt;/p&gt;  &lt;p&gt;3. The machine &lt;i&gt;must&lt;/i&gt; have network access. Flotzam does not do well with intermittent connectivity; if you can&amp;#8217;t guarantee a stable connection to the internet, &lt;i&gt;don&amp;#8217;t use Flotzam&lt;/i&gt;.&lt;/p&gt;  &lt;p&gt;4. Determine what feeds you want Flotzam to display. &lt;/p&gt;  &lt;p&gt;Note that you will need to somehow communicate to the attendees how to access the services you set up. Another option is to not let attendees know about the tags and simply have your conference folks twitter and upload photos.    &lt;br /&gt;    &lt;br /&gt;Here are the steps to configuring Flotzam:&lt;/p&gt;  &lt;p&gt;1. All settings can be changed by clicking SETTINGS AND OPTIONS in the upper left corner.&lt;/p&gt;  &lt;p&gt;2. For example, if you want everyone who is at the event have their Twitters appear, you can create a Twitter account such as &lt;b&gt;myconference&lt;/b&gt;, let people know about it, and then specify for Flotzam to &amp;#8220;Watch My Followers&amp;#8221; in the Twitter settings panel, providing the username and password for the &lt;b&gt;myconference&lt;/b&gt; twitter account.&lt;/p&gt;  &lt;p&gt;3. If you set up a Facebook event for your conference, you can enter the Event ID in the Facebook settings panel. The Event ID found in the URL when on the Facebook event itself, so if the URL for the event is &lt;a href="http://www.facebook.com/event.php?eid=2367953648"&gt;http://www.facebook.com/event.php?eid=2367953648&lt;/a&gt; the event id is 2367953648). You'll also have to provide you credentials to Facebook.&lt;/p&gt;  &lt;p&gt;4. If you want to add a different Flickr tag, you can modify the tag in the Flickr settings Panel. &lt;/p&gt;  &lt;p&gt;5. You can specify a DIGG setting and a YouTube tag.&lt;/p&gt;  &lt;p&gt;6. If you want to manage which RSS feeds show up, you need to do that management in Internet Explorer.&lt;/p&gt;  &lt;p&gt;7. Lastly, if you want to have different skins show up, you can check that box in the general settings tab.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;hr align="left" width="33%" size="1" /&gt;  &lt;p&gt;&lt;a name="_msocom_1"&gt;&lt;/a&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/57/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/57/default.aspx</link><pubDate>Fri, 18 Apr 2008 19:58:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/57/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/57/trackback/default.aspx</trackback:ping><category>Flotzam</category><category>Web 2.0</category><category>WPF</category></item><item><title>Updates to Flotzam</title><description>&lt;p&gt;I realized that the code base I used for &lt;a href="http://www.flotzam.com/"&gt;Flotzam&lt;/a&gt; for the MIX conference was not posted and there are a few interesting things that have been updated in the code that people may be interested in:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;For MIX, we displayed photos that were posted to the MIX event on Facebook.&amp;#160; How do you get all photos from an event from Facebook? Officially, there isn't an API for this.&amp;#160; Unofficially, it can be done through FQL by simply calling photos.get and passing the event id.&amp;#160; I extended the Facebook .NET wrapper and added a method called GetEventPhotos that does this. The reason this is interesting is if you want to use Flotzam at a conference and want to access the photos from a Facebook event. &lt;/li&gt;    &lt;li&gt;I also added a setting that allows you to choose whether to show photos from Facebook friends or show photos from an event or both. &lt;/li&gt;    &lt;li&gt;Another thing we did at MIX was to show all twitters from anyone following the event.&amp;#160; I didn't have this officially wired up in the settings, but now it is.&amp;#160; It is a little confusing: if you pick, &amp;quot;watch me and my friends&amp;quot; you are seeing the tweets of people you follow. But if you pick &amp;quot;watch my followers&amp;quot; you are getting the last tweet of anyone who is following you.&amp;#160; It is kind of goofy because the APIs return a different schema depending on which you pick, so the code has to do some casting between .NET types, since I serialize everything. &lt;/li&gt;    &lt;li&gt;I've also added a setting so you can either choose to have the skins randomly toggle or you can just stick with one skin. &lt;/li&gt;    &lt;li&gt;I've also gone ahead and uploaded the source code with the .PNG sequences done by &lt;a href="http://jmorrill.hjtcentral.com/"&gt;Jeremiah Morrill&lt;/a&gt;.&amp;#160; With all those images, the download is 50 mb.&amp;#160; As such, I've made one version of the project that doesn't have the .PNG sequences which is smaller. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://flotzam.com/download/sourcecode/source.zip"&gt;Download the code with PNG sequences&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://flotzam.com/download/sourcecode/sourcenopng.zip"&gt;Download the code without PNG sequences&lt;/a&gt;.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/56/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/56/default.aspx</link><pubDate>Tue, 15 Apr 2008 00:37:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/56/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/56/trackback/default.aspx</trackback:ping><category>Facebook</category><category>WPF</category></item><item><title>Two Great WPF Video Samples Online</title><description>&lt;p&gt;In WPF, the MediaElement is simple and easy, but there are times when one wants to do more with video (webcams, pixel manipulation, etc.).&amp;#160; This usually requires dropping outside of WPF into unmanaged code or at least referencing unmanaged dlls, all which can get tricky, suffice to say.&amp;#160; I wanted to point out two great WPF video samples that recently came online which abstract out some of this complexity and let you get to the task at hand.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.codeplex.com/VideoRendererElement"&gt;http://www.codeplex.com/VideoRendererElement&lt;/a&gt;: With this project, by &lt;a href="http://jmorrill.hjtcentral.com/Home/tabid/428/EntryID/197/Default.aspx" target="_blank"&gt;Jeremiah Morrill&lt;/a&gt;,&amp;#160; &amp;quot;a developer can update a pixel buffer or video media sample and have it render in WPF space at MediaElement speed. It is compatible with GDI, DirectShow and direct pixel updates.&amp;quot;&amp;#160; The nice part is that he's abstracted all the DirectShow code, so you can work with this project and stay in safe .NET land. &lt;/p&gt;  &lt;p&gt;&lt;a title="http://blogs.msdn.com/uberdemo/archive/2008/03/27/capturing-a-webcam-stream-to-a-wmv-file-from-within-a-wpf-application.aspx" href="http://blogs.msdn.com/uberdemo/archive/2008/03/27/capturing-a-webcam-stream-to-a-wmv-file-from-within-a-wpf-application.aspx"&gt;http://blogs.msdn.com/uberdemo/archive/2008/03/27/capturing-a-webcam-stream-to-a-wmv-file-from-within-a-wpf-application.aspx&lt;/a&gt;: With this project, you have probably the best class I've seen out there for capturing a webcam with WPF.&amp;#160; Very clever how he uses the Windows Media Encoder Series 9 for the capture. His write up is very thorough.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/49/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/49/default.aspx</link><pubDate>Mon, 31 Mar 2008 18:19:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/49/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/49/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Direct Links For Downloading WPF Boot Camp Videos</title><description>&lt;p&gt;Someone asked for direct links for downloading the WPF Boot Camp videos, so here they are.&amp;#160; &lt;/p&gt;  &lt;p&gt;Day 1&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/Introduction_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/Introduction_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/VS_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/VS_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/LapAroundBlendUnni_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/LapAroundBlendUnni_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF1_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF1_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF2_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF2_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF3_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF3_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF4_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF4_2MB_mix.wmv&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Day 2&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF5_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF5_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF6DataBinding_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF6DataBinding_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF7DataBinding2_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF7DataBinding2_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPFDatabinding3a_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPFDatabinding3a_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF9Events_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/IntroToWPF9Events_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/QAWithArchitects_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/QAWithArchitects_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/3DTechniques_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/3DTechniques_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFPerf_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFPerf_2MB_mix.wmv&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Day 3&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFandLegacyCode_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFandLegacyCode_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/Prism_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/Prism_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/HelloRealWorld_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/HelloRealWorld_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFInStyle_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/WPFInStyle_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/RealWorldWPF_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/RealWorldWPF_2MB_mix.wmv&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you want formats other than .wmv, replace the _2MB_ and change the extension to .wma, .mp3, .mp4, etc.&amp;#160; See the list of links below to figure out the formula:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.wma"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.wma&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_Zune_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_Zune_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_2MB_mix.wmv"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_2MB_mix.wmv&lt;/a&gt;    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_large_mix.jpg"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_large_mix.jpg&lt;/a&gt;    &lt;br /&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.mp3    &lt;br /&gt;&lt;a href="http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.mp4http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_small_mix.jpg"&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_mix.mp4     &lt;br /&gt;http://mschnlnine.vo.llnwd.net/d1/mix/6/2/5/AppliedWPF_small_mix.jpg&lt;/a&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/48/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/48/default.aspx</link><pubDate>Mon, 24 Mar 2008 21:15:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/48/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>7</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/48/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>WPF Boot Camp Videos and Collateral Posted</title><description>&lt;p&gt;I just posted the videos and collateral from the WPF Boot Camp 2008 &lt;a href="http://www.visitmix.com/university/wpf/bc08/"&gt;here&lt;/a&gt;.&amp;#160; Lots of great material here, including talks by Mark Wilson-Thomas, Unni Ravindranathan, Jonathon Russ (IdentityMine), Robert Ingebretsen (IdentityMine), David Teitlebaum, Jordan Parker, Jaime Rodriguez, Adam Smith, Henry Sowizral, Glenn Block, Josh Smith (Infragistics), Alan Le (Vertigo) and Josh Wagoner (IdentityMine).&amp;#160; If you are new to WPF, there's some great content here.&amp;#160; If you are a WPF veteran, check out the day 3 content, which has some great real world talks. &lt;/p&gt;  &lt;p&gt;Note that the requires Silverlight Beta 2 to run.&amp;#160; I ended up using &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=33734"&gt;my carousel con&lt;/a&gt;trol to make the site. I also used &lt;a href="http://blogs.msdn.com/edmaia/archive/2008/03/18/mix-08-demos-posted.aspx"&gt;Ed Maia's SL2 Video Player&lt;/a&gt;.&amp;#160; If you want the code I used to built the site, you can download it &lt;a href="http://www.rhizohm.net/download/wpfbootcamp.zip"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.visitmix.com/university/wpf/bc08/" border="0"&gt;&lt;img src="http://www.rhizohm.net/images/bootcamp.jpg" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/47/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/47/default.aspx</link><pubDate>Fri, 21 Mar 2008 19:55:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/47/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>10</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/47/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Memory Leaks and WPF</title><description>&lt;p&gt;I think that there is an assumption by many .NET developers that, with the CLR's garbage collector, they are immune from memory leaks.&amp;#160; This is hardly the case.&amp;#160; When writing WPF applications, there are a number of gotchas in this department.&amp;#160; Hat's off to Jossef Goldberg, who has &lt;a href="http://blogs.msdn.com/jgoldb/archive/2008/02/04/finding-memory-leaks-in-wpf-based-applications.aspx" target="_blank"&gt;a fantastic post&lt;/a&gt; on some of the more pernicious WPF memory leaks: how to avoid them and, if that fails, how to find them.&amp;#160;&amp;#160; &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/40/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/40/default.aspx</link><pubDate>Fri, 08 Feb 2008 04:18:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/40/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/40/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>2008 WPF Boot Camp</title><description>&lt;p&gt;Last week, we held a WPF boot camp for a set of folks here in Redmond.&amp;#160; It was a great event and, most pertinently, we taped the entire thing, just as we did &lt;a href="http://visitmix.com/University/wpf/wpfbootcamp.htm" target="_blank"&gt;last year&lt;/a&gt;. (We should have the videos posted in the next few weeks.) And, just as last year, we have had some great sessions on real world WPF by non-Microsoft folks.&amp;#160; This year, we had Josh Smith (Infragistics), Alan Le (Vertigo) and Josh Wagoner (IdentityMine). Each gave great talks full of nuggets of WPF wisdom.&amp;#160; &lt;/p&gt;  &lt;p&gt;Josh's talk really explicated how the model-view-controller pattern is baked into WPF and he provided a very cool skeleton app that demonstrated this, using WPF features like commands, databinding and more, all ready made for unit testing.&amp;#160; He actually turned the content of his talk into &lt;a href="http://www.codeproject.com/KB/WPF/MVCtoUnitTestinWPF.aspx" target="_blank"&gt;a code project article&lt;/a&gt;.&amp;#160; &lt;a href="http://rhizohm.net/download/WPFBootcampPresentation.zip" target="_blank"&gt;Here's the code and slides&lt;/a&gt; from his talk.&lt;/p&gt;  &lt;p&gt;Alan Le, self described as a creative developer (nice!), delved into the realities of designer-developer collaboration.&amp;#160; &lt;a href="http://rhizohm.net/download/AlanLeWPFBootcamp2008.zip" target="_blank"&gt;Here's his slides&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Josh Wagoner, whose been working on WPF forever I think, covered IRTs (Intermediate Render Targets), animation (both frame based and timer-based) and attached properties (every WPF guru's favorite trick).&amp;#160; Check out his &lt;a href="http://rhizohm.net/download/wagoner_Demos.zip" target="_blank"&gt;demo code&lt;/a&gt; and &lt;a href="http://rhizohm.net/download/RealWorldWPF_wagoner.zip" target="_blank"&gt;slides&lt;/a&gt;. &lt;/p&gt;  &lt;p&gt;Overall, listening to these guys talk about their excitement for WPF reminded me how addictive WPF is once you've gained some proficiency. It really appeals to those developers who appreciate elegance.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/37/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/37/default.aspx</link><pubDate>Mon, 28 Jan 2008 16:48:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/37/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>11</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/37/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Flotzam Restyle Contest: Submit Your Restyle and Be Featured At MIX!</title><description>&lt;p&gt;Perhaps you remembered last year&amp;#8217;s MIX, in which we featured &lt;a href="http://www.flotzam.com/"&gt;Flotzam&lt;/a&gt;, a WPF screensaver mash-up that showed MIX07 feeds from Facebook, Flickr, Twitter and blogs. Well, we are doing it again this year with a twist: we are running a contest and will feature community created skins of the application on the big screen and on the screensavers of the computers available to attendees at the show.&amp;#160; The best skin will win an XBOX 360.&lt;/p&gt;  &lt;p&gt;&lt;img src="http://www.flotzam.com/images/flotzam.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;Entering the contest is easy: everything a person needs to know can be found here: &lt;a href="http://www.visitmix.com/blogs/News/403/"&gt;http://www.visitmix.com/blogs/News/403/&lt;/a&gt; including links to screencasts and instructions that show how easy it is to do the restyle.&amp;#160; You can create a pretty cool skin in less than an hour. I&amp;#8217;m hoping that we&amp;#8217;ll have lots of skins and walking the halls at the show will be a kind of art installation with all these different skins appearing.&amp;#160; So give it a try!&lt;/p&gt;  &lt;p&gt;&lt;img src="http://farm1.static.flickr.com/193/481984956_ed4a2c4d06.jpg" /&gt; &lt;/p&gt;  &lt;p&gt;I&amp;#8217;m pretty excited about the contest because it really highlights the designer/developer optimization that is core to the value proposition of WPF and Expression Blend, not to mention the ease of skinning WPF apps.&amp;#160; Would love your help in promoting the contest.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://www.rhizohm.net//images/WindowsLiveWriter/FlotzamRestyleContestSubmitYourRestylean_8F44/flotzam_new.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="332" alt="flotzam_new" src="http://www.rhizohm.net/irhetoric/images/WindowsLiveWriter/FlotzamRestyleContestSubmitYourRestylean_8F44/flotzam_new_thumb.jpg" width="496" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A big thanks to &lt;a href="http://www.taidlin.com/" target="_blank"&gt;Tim Aidlin&lt;/a&gt;, designer extraordinaire; &lt;a href="http://www.adamkinney.com/" target="_blank"&gt;Adam Kinney&lt;/a&gt;, web dev extraordinaire; and &lt;a href="http://visitmix.com/People/Denise%20Begley/" target="_blank"&gt;Denise Begley&lt;/a&gt;, community organizer extraordinaire, for helping launch year one of this contest!&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/36/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/36/default.aspx</link><pubDate>Fri, 25 Jan 2008 18:11:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/36/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/36/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Yahoo! Messenger for Windows Vista Supports 64 bit</title><description>&lt;p&gt;The &lt;a href="http://www.ymessengerblog.com/blog/2007/12/07/messenger-for-vista-ready-for-64-bit/"&gt;folks at Yahoo! have updated their beta&lt;/a&gt; to now support 64 bit as well, so if you wanted to try the application but got shut down because you were on a 64 bit machine, you can go &lt;a href="http://messenger.yahoo.com/download_vista.php"&gt;grab the latest download&lt;/a&gt; and install it. &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/27/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/27/default.aspx</link><pubDate>Fri, 07 Dec 2007 22:25:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/27/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/27/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Mole and Mole II: Great WPF Debugging and Visualization Tool</title><description>&lt;p&gt;In &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx"&gt;The New Iteration&lt;/a&gt;, &lt;a href="http://www.blois.us/Snoop/"&gt;SNOOP&lt;/a&gt; is discussed, a great tool for visualizing and manipulating the WPF visual tree on the fly.&amp;nbsp; I also wanted to highlight some of the great community efforts that build upon this idea. &lt;a href="http://joshsmithonwpf.wordpress.com/"&gt;Josh Smith&lt;/a&gt;, Andrew Smith and &lt;a href="http://karlshifflett.wordpress.com"&gt;Karl Shifflett&lt;/a&gt; have released a Visual Studio Visualizer for WPF that is similar to Snoop but provides more features.&lt;/p&gt; &lt;p&gt;This product allows unlimited drilling into the visual and logical trees and any sub-objects of these, including objects in the managed heap. User can also view the run-time visual and XAML of the object. &lt;p&gt;The following two articles get into visualzers and explain the two versions of Mole. &lt;p&gt;Current Version: &lt;p&gt;&lt;a href="http://www.codeproject.com/KB/WPF/moleIIforWPF.aspx"&gt;http://www.codeproject.com/KB/WPF/moleIIforWPF.aspx&lt;/a&gt; &lt;p&gt;Original Version: &lt;p&gt;&lt;a href="http://www.codeproject.com/KB/WPF/MoleForWPF.aspx"&gt;http://www.codeproject.com/KB/WPF/MoleForWPF.aspx&lt;/a&gt; &lt;p&gt;Mole's Home Page: &lt;p&gt;&lt;a href="http://karlshifflett.wordpress.com/mole-visual-studio-visualizer-for-wpf/"&gt;http://karlshifflett.wordpress.com/mole-visual-studio-visualizer-for-wpf/&lt;/a&gt; &lt;p&gt;&amp;nbsp; &lt;p&gt;&lt;img src="http://karlshifflett.wordpress.com/files/2007/12/compressmole2open.jpg" alt="" /&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/26/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/26/default.aspx</link><pubDate>Fri, 07 Dec 2007 22:10:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/26/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/26/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>The New Iteration: How XAML Transforms the Collaboration Between Designers and Developers in WPF</title><description>&lt;p&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 10px 0px 0px; border-right-width: 0px" src="http://windowsclient.net/wpf/white-papers/images/cover.jpg" align="left" alt="" /&gt;I'm excited to announce the availability of a white paper that's been long in the making: &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx"&gt;The New Iteration: How XAML Transforms the Collaboration Between Designers and Developers in WPF&lt;/a&gt;.&amp;nbsp; This is a 28 page white paper written by &lt;a href="http://blogs.msdn.com/jaimer/"&gt;Jaime Rodriguez&lt;/a&gt; and&amp;nbsp;I that digs into issues and solutions when working on a WPF project with both designers and developers.&amp;nbsp; A result of extensive interviews with developers and designers with real world WPF experience, Jaime and I tried to get some canonical information out there for people trying to live the XAML dream and realize the benefits of the new workflows engendered by XAML.&amp;nbsp; We talked to both internal Microsoft folks as well as many external companies to coalesce the best practices that are being established in this domain.&lt;/p&gt; &lt;p&gt;I'm proud of the entire paper.&amp;nbsp; Here's some highlights: The sections on &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx#thexamlrevolution"&gt;XAML&lt;/a&gt; provide a perspective on XAML that I don't think has been articulated before in terms of how XAML makes the workflow possible.&amp;nbsp; The section on &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx#roles"&gt;roles and workflow&lt;/a&gt; took us many iterations and ultimately puts into place some different models to implement when actually getting into the nitty gritty of collaborating on a project. I think this graphic in particular does a nice job of explaining the workflow visually (thanks to Tim Aidlin for doing the graphic):&lt;/p&gt; &lt;p&gt;&lt;img src="http://windowsclient.net/wpf/white-papers/images/VENS_071105.png" alt="" /&gt; &lt;/p&gt; &lt;p&gt;The best practices for &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx#bestdesigners"&gt;designers&lt;/a&gt; and &lt;a href="http://windowsclient.net/wpf/white-papers/thenewiteration.aspx#bestdevelopers"&gt;developers&lt;/a&gt; I think have a lot of great tactical tips worth exploring. &lt;/p&gt; &lt;p&gt;I've started a thread on the paper over in the WPF forums and would love to see that be a place for an ongoing discussion of some of the ideas forwarded by Jaime and I.&lt;/p&gt; &lt;p&gt;Here's a &lt;a href="http://www.rhizohm.net/papers/the_new_iteration.pdf"&gt;pdf version of the paper&lt;/a&gt; if you are interested.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/25/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/25/default.aspx</link><pubDate>Fri, 07 Dec 2007 21:30:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/25/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/25/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Yahoo! Messenger For Windows Vista</title><description>&lt;p&gt;Check it out:&amp;nbsp;a beta version of Yahoo! Messenger for Vista is now out.&amp;nbsp; &lt;a href="http://messenger.yahoo.com/windowsvista.php"&gt;Download it here&lt;/a&gt; and &lt;a href="http://www.ymessengerblog.com/blog/2007/12/05/yahoo-messenger-for-vista-preview-release-available/"&gt;read about all the new features and see a video here&lt;/a&gt;. This is 100% WPF -- hats off to &lt;a href="http://eric.burke.name/dotnetmania/"&gt;Eric Burke&lt;/a&gt; and company who have done a knock out job with the application.&amp;nbsp; He says on his blog that he'll be posting lots of learnings about WPF; looking forward to that.&lt;/p&gt; &lt;p&gt;My favorite feature? Check out the emoticons, for example, how they composite on top of the application.&amp;nbsp; Pretty sweet.&amp;nbsp; Give it a shot and &lt;a href="http://feedback.help.yahoo.com/feedback.php?.src=MSNGRVISTA&amp;amp;.from=web"&gt;provide feedback&lt;/a&gt; to the team on what you like and don't like.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;img src="http://on10.net/images/blogs/YMVista_ContactList.png" alt="" /&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/24/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/24/default.aspx</link><pubDate>Thu, 06 Dec 2007 18:52:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/24/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/24/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>WPF Contest</title><description>&lt;p&gt;&lt;a href="http://wpfcontest.lab49.com/"&gt;Check out this contest for WPF applications&lt;/a&gt; sponsored by Lab 49.&amp;nbsp; There's quite a few prizes available -- and good prizes too.&amp;nbsp; The rules are pretty interesting, as they provide the data set to work with.&amp;nbsp; So, the data is the equalizer: whose got the best visualization?&amp;nbsp;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;img src="http://wpfcontest.lab49.com/images/home-mainimage.jpg" alt="" /&gt;&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/23/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/23/default.aspx</link><pubDate>Tue, 04 Dec 2007 00:10:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/23/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/23/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Hierarchical View Carousel Source Code Posted</title><description>&lt;p&gt;About a thousand years ago, I was involved with a demo that showed the use of WPF to visualize hierarchical data.&amp;nbsp; We had many requests for the code, but wasn't able to provide it...until now.&amp;nbsp; At long last, we are making &lt;a href="http://www.rhizohm.net/apps/hvc/src.zip"&gt;the code for the hierarchical view carousel available&lt;/a&gt;.&amp;nbsp;&lt;/p&gt; &lt;p&gt;The Hierarchical View Carousel is a prototype of a different model of navigating hierarchies, based on using a 3D effect that allows the user to better visualize the relationships between nodes. If you are curious as to what this is, &lt;a href="http://channel9.msdn.com/PVR/GetAsx.aspx?pvrid=183&amp;amp;post=69105"&gt;check out this snip&lt;/a&gt; from the Channel 9 video I did with Simon Guest.&lt;/p&gt; &lt;p&gt;When you first launch the application, the control will load offline data that "mashes up" Microsoft CRM data, SAP data and shipping data.&amp;nbsp; The notion is that the control shows a view of accounts from CRM. By hovering over the node, a user can immediately see if that account has an order going to it (by querying SAP)&amp;nbsp; and what its shipping status is. Drilling down into an account shows additional detail about the account. &lt;/p&gt; &lt;p&gt;&lt;img src="http://www.rhizohm.net/apps/hvc/hvc1.png" alt="" width="567" height="407"/&gt; &lt;/p&gt; &lt;p&gt;&amp;nbsp;  &lt;p&gt;At any time, the control can use a different data set with the same visualization.&amp;nbsp; By clicking the radio button below for file explorer, the control can render data from the file system, navigating from "c:\".&amp;nbsp;  &lt;p&gt;&lt;img width="567" height="407" src="http://www.rhizohm.net/apps/hvc/hvc.png" alt="" /&gt;  &lt;p&gt;By clicking the Active Directory button, the control will bind to Active Directory,if available.&amp;nbsp; Using the search box, a person's name can be entered and upon clicking the search button, that person will be found in Active Directory, with that person's direct reports listed below.  &lt;p&gt;&lt;strong&gt;KNOWN ISSUES/FEATURE REQUESTS&lt;/strong&gt;  &lt;p&gt;--Doubleclicking on a node does not initiate opening the nodes beneath that person. For some reason, the event isn't bubbling up.&lt;br&gt;--Only one branch can be created.&amp;nbsp; You should be able to create two branches, but that broke at some point and I couldn't figure out how to fix it. &lt;br&gt;--Sometimes the carousel spins rapidly to the left when spinning the carousel with the arrows. Not sure why.&lt;br&gt;--You can't navigate up from the root node, if there is something above it. That's not a bug, but a feature request.  &lt;p&gt;If you fix any of these bugs, please let me know!  &lt;p&gt;&lt;strong&gt;SOURCE CODE GUIDE&lt;/strong&gt;  &lt;p&gt;It is worth commenting that this source code was written against a build of WPF before WPF was completed.&amp;nbsp; The code is pretty crusty. As such, there are techniques used that may seem unnatural.&amp;nbsp; Much of this is a result of not all of WPF being completed when the project was initially written.&amp;nbsp; For example, it doesn't use HierarchicalDataTemplate nor does it use an ItemsControl model in an optimal way.&amp;nbsp; Nonetheless, there are some effective techiques employed worth digging into.  &lt;p&gt;The HVC project is broken down into 5 different projects.&amp;nbsp; Host is the Windows application.&amp;nbsp; The hierarchical carousel control itself is a seperate project called XPHierarchicalCarousel. When creating the HVC, a datasource must be wired up that complies witTehh the IDataProvider as defined in the DataAdapter project.&amp;nbsp; Within the DataAdapter project are the three data adapters.&amp;nbsp; Creating a new data adapter involves implementing the IDataProvider interface for traversing nodes.&amp;nbsp; The SAPConnector project and the ShippingServiceConnector project are for the purpose of the CRM adapter.&amp;nbsp; The offline data is actual SAP data, serialized to .NET objects.&amp;nbsp; The ShippingServiceConnector is a stub for a service that would contact a shipping web service.  &lt;p&gt;&lt;a href="http://www.rhizohm.net/apps/hvc/src.zip"&gt;Download the Code&lt;/a&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/22/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/22/default.aspx</link><pubDate>Fri, 30 Nov 2007 21:00:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/22/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/22/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>WPF 3.5 AddIn Demo - Go Plugins!</title><description>&lt;p&gt;With the release of .NET 3.5 and Visual Studio 2008 comes a new and improved WPF.&amp;#xA0; With that in mind, I wanted to get a demo out that showed off some of the new WPF 3.5 features.&amp;#xA0; There was some code written, not by me, but by &lt;a href="http://work.j832.com/" target="_blank"&gt;Kevin Moore&lt;/a&gt;, author of the WPF Bag o' Tricks among other WPF goodness.&amp;#xA0; Kevin has moved on from Microsoft and he never released this code, but there is some very useful concepts presented.&amp;#xA0; I grabbed his code, cleaned it up and have &lt;a href="http://www.rhizohm.net/download/wpfaddindemo.zip" target="_blank"&gt;made it available for download&lt;/a&gt;.&amp;#xA0; Basically, there's a lot of useful infrastructure code for creating a secure plug-in model for a WPF.&amp;#xA0; One nifty thing he does is binds to the same data across his different plug-ins. He also shows off some other WPF 3.5 features along the way, like interactive 2d on 3d.&lt;/p&gt;  &lt;p&gt;&lt;img id="id" src="http://www.rhizohm.net/images/km.png" /&gt; &lt;/p&gt;  &lt;p&gt;It is worth pointing out the cleanup I had to do with within System.AddIn.&amp;#xA0; The change was the renaming of &lt;strong&gt;VisualAdapter&lt;/strong&gt; to &lt;strong&gt;FrameworkElementAdapters &lt;/strong&gt;and a change in the method's signature that turned out to be pretty trivial to fix.&lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/21/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/21/default.aspx</link><pubDate>Tue, 20 Nov 2007 23:51:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/21/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>2</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/21/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Flotzam Web: Databinding and Templates in Silverlight 1.0</title><description>&lt;p&gt;I've been playing with porting &lt;a href="http://flotzam.com/" target="_blank"&gt;Flotzam&lt;/a&gt; to Silverlight 1.0 and have an intial prototype working.&amp;#xA0; (Emphasis on prototype -- read, not ready for primetime yet.&amp;#xA0; If anyone wants to help fix some of the bugs listed below let me know.) I figured I'd share it out nonetheless.&amp;#xA0; You can see &lt;a href="http://rhizohm.net/apps/flotzamweb/"&gt;it running here&lt;/a&gt; and &lt;a href="http://rhizohm.net/apps/flotzamweb/flotzamweb.zip" target="_blank"&gt;download the source&lt;/a&gt; here.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://rhizohm.net/apps/flotzamweb/" target="_blank" border="0"&gt;&lt;img id="id" src="http://www.flotzam.com/images/flotzam.jpg" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;I'm pretty excited by the prospect of the architecture I've put together.&amp;#xA0; The crux is that I've created a serverside templating infrastructure that's compliant with WPF's XML Databinding syntax. My goals were to reuse as much of the WPF model as possbile, but on the server. &lt;/p&gt;  &lt;p&gt;I initially went down a path of actually instantiating WPF on the server, but pulled back from that for a couple reasons.&amp;#xA0; First, and most importantly, WPF wants to be in a Single Threaded Apartment (STA).&amp;#xA0; One can force this to happen by adding the ASPCOMPAT directive to your .aspx pages, but the scalability implications are severe.&amp;#xA0; These scalability problems might be avoided by doing some multithreading, which I started to explore, but then ran out of energy. I also had some trickiness in getting the &lt;strong&gt;ContentPresenter&lt;/strong&gt; to behave, which sidelined that approach as well.&amp;#xA0; (You can see my initial explorations of the architecture in the xaml.aspx file.)&amp;#xA0; &lt;/p&gt;  &lt;p&gt;I then went down a different path, inspired by &lt;a href="http://blogs.msdn.com/webnext/"&gt;Laurence Moroney&lt;/a&gt; and &lt;a href="http://www.visitmix.com/People/allenjs/Default.aspx"&gt;Joshua Allen&lt;/a&gt;. Laurence started me off thinking about templating based on his &lt;a href="http://msdn2.microsoft.com/en-us/library/bb410109.aspx"&gt;MSDN sample&lt;/a&gt; that does some clever things with server side generation of XAML based on an RSS feed.&amp;#xA0; I liked where Laurence was going as did Joshua, who took this idea to the next level in a prototype he wrote that uses &lt;strong&gt;XMLReader&lt;/strong&gt; and &lt;strong&gt;XMLWriter&lt;/strong&gt; for doing templating. (For some reason, he never blogged about this but he hooked me up with his code, nonetheless.&amp;#xA0; Being an ex-Web data PM, he knows how to sling infosets around, which came in real handy.)&amp;#xA0; I took his code, which is a more generic templating model as opposed to Laurence's custom sample and extended it to support the WPF databinding syntax (aka {Binding XPath=/foo}), as opposed to the custom databinding syntax Joshua had come up with.&amp;#xA0; &lt;/p&gt;  &lt;p&gt;Note on the code Joshua wrote: he has this class called &lt;strong&gt;MiniCache&lt;/strong&gt;, which he uses to store elements and attribute values in a dictionary, because he was working under the constraint of SL 1.1 not having an XMLDocument or XPathNavigator.&amp;#xA0; However, as I'm running this on the server, I don't have this constraint.&amp;#xA0; A big TODO for this code is to replace his dictionary implementation with one that uses XMLNode and XPath.&lt;/p&gt;  &lt;p&gt;Using Joshua's code with a few modifications, I was able to reuse my WPF datatemplate within Silverlight 1.0!&lt;/p&gt;  &lt;p&gt;Here's the basic architecture:&lt;/p&gt;  &lt;p&gt;The action begins in my global.asax, which populates the ASP.NET Application object with an initial set of content.&amp;#xA0; &lt;font face="Trebuchet MS"&gt;In datamodel.Fetch(), I grab the latest Twitter timeline and use it to generate my flotzams.&lt;/font&gt;&lt;/p&gt;  &lt;div&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Fetch() { WebClient client = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; WebClient(); Stream data = client.OpenRead(&lt;span style="color: #006080"&gt;&amp;quot;http://www.twitter.com/statuses/public_timeline.xml&amp;quot;&lt;/span&gt;); XmlReader twitterItems = XmlReader.Create(data); &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; idx = 0; &lt;span style="color: #0000ff"&gt;while&lt;/span&gt; (twitterItems.ReadToFollowing(&lt;span style="color: #006080"&gt;&amp;quot;status&amp;quot;&lt;/span&gt;)) { MiniCache twitterItem = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MiniCache(twitterItems.ReadSubtree()); XmlReader template = XmlReader.Create(server.MapPath(&lt;span style="color: #006080"&gt;&amp;quot;temp4.xaml&amp;quot;&lt;/span&gt;)); &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; XamlContent = twitterItem.ProcessTemplate(template, idx.ToString()); &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;null&lt;/span&gt; == application.Get(idx.ToString())) application.Add(idx.ToString(), XamlContent); &lt;span style="color: #0000ff"&gt;else&lt;/span&gt; { application.Lock(); application[idx.ToString()] = XamlContent; application.UnLock(); } template.Close(); idx++; } twitterItems.Close(); client.Dispose(); }&lt;/pre&gt;
&lt;/div&gt;

&lt;pre class="code"&gt;&lt;font face="Courier New"&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;style type="text/css"&gt;




.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;&lt;style type="text/css"&gt;





.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }&lt;/style&gt;

&lt;p&gt;The code in &lt;strong&gt;Fetch()&lt;/strong&gt; is pretty darned straight forward, which is what I like about the architecture.&amp;#xA0; I'm basically just walking the nodes from the Twitter feed, merging them with my template (temp4.xaml), which came from Blend. Once I have the resulting XAML, I stick it in the &lt;strong&gt;Application &lt;/strong&gt;object. &lt;/p&gt;

&lt;p&gt;I'm not going to go into the code of the MiniCache, because the idea is that is encapsulated sufficiently so as to be black box.&amp;#xA0; However, I did do some things that customized it. In particular, I created my own syntax to pull of the equivalent of databinding functions.&amp;#xA0; You can dig into the code to see what I did.&lt;/p&gt;

&lt;p&gt;With my application object filled with generated XAML content, I'm now ready to display it.&amp;#xA0; I do this from default.aspx, which instantiates Silverlight.&amp;#xA0; In the javascript &lt;strong&gt;PageLoad &lt;/strong&gt;function I start up a timer, which makes an AJAX GET call to default2.aspx, which is where my dynamic XAML is served from:&lt;/p&gt;

&lt;div&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#x27;Courier New&amp;#x27;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;function&lt;/span&gt; displayTimer(){ &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; webRequest = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Sys.Net.WebRequest(); webRequest.set_url(&lt;span style="color: #006080"&gt;&amp;quot;default2.aspx?tweet=&amp;quot;&lt;/span&gt; + i); webRequest.set_httpVerb(&lt;span style="color: #006080"&gt;&amp;quot;GET&amp;quot;&lt;/span&gt;); webRequest.add_completed(completedHandler); webRequest.invoke(); i = i + 1; &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (i == 19) i = 0; setTimeout(&lt;span style="color: #006080"&gt;&amp;quot;displayTimer()&amp;quot;&lt;/span&gt;,4000) } &lt;span style="color: #0000ff"&gt;function&lt;/span&gt; completedHandler(result, eventargs) { &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (result.get_responseAvailable()) { &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; host = document.getElementById(&lt;span style="color: #006080"&gt;&amp;quot;SilverlightPlugIn&amp;quot;&lt;/span&gt;); &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; xaml = host.content.createFromXAML(result.get_responseData(),&lt;span style="color: #0000ff"&gt;true&lt;/span&gt;); &lt;span style="color: #0000ff"&gt;var&lt;/span&gt; rootElement = host.content.findName(&lt;span style="color: #006080"&gt;&amp;quot;rootElement&amp;quot;&lt;/span&gt;); rootElement.children.add(xaml); } }&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When the call completes, I use the createFromXAML method to create my Canvas object, which is then inserted at the root.&amp;#xA0; Note how I pass true to the createFromXAML method so I don't have naming collisions. &lt;/p&gt;

&lt;p&gt;The code is default2.aspx is pretty darned straight forward.&amp;#xA0; It just picks out the querystring and returns the XAML, extracting it from the application object.&amp;#xA0; And there you have it: a databinding infrastructure for Silverlight 1.0 based on WPF.&lt;/p&gt;

&lt;p&gt;The bugs I'm still reckoning with:&lt;/p&gt;

&lt;p&gt;--Firefox issues. It was working in Firefox and then at some point it broke.&amp;#xA0; It seems to hang on fetching the images for the Twitter avatars from &lt;a href="http://s3.amazonaws.com"&gt;http://s3.amazonaws.com&lt;/a&gt;.&amp;#xA0; Not sure what's going on there.&amp;#xA0; I think Firefox stopped working when I added some error handling on image retrieval.&lt;/p&gt;

&lt;p&gt;--Refresh issues.&amp;#xA0; I can't figure out why my cache is not being updated.&amp;#xA0; I try to update it after displaying all 20 twitters, but it seems to hang to the original 20.&lt;/p&gt;

&lt;p&gt;--TranslateTransform and RenderTransformOrigin.&amp;#xA0; I'm randomly adding these values to the Canvas, but they don't seem to be getting acknowledged by Silverlight, thus flotzams always coming in from the right to left and often landing in the same place.&lt;/p&gt;

&lt;p&gt;The things I'd like to do:&lt;/p&gt;

&lt;p&gt;--Pass credentials so that the data is personalized&lt;/p&gt;

&lt;p&gt;--Add Digg, Flickr, Facebook, RSS&lt;/p&gt;

&lt;p&gt;--Improve the MiniCache&lt;/p&gt;

&lt;p&gt;--Show how Blend fits into this workflow &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/17/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/17/default.aspx</link><pubDate>Fri, 09 Nov 2007 22:39:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/17/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/17/trackback/default.aspx</trackback:ping><category>Silverlight</category><category>WPF</category></item><item><title>Digg, Flotzam and the Desktop</title><description>&lt;p&gt;I updated &lt;a href="http://flotzam.com"&gt;Flotzam&lt;/a&gt; to support &lt;a href="http://digg.com"&gt;Digg&lt;/a&gt;, so now those of you with a Digg addiction (addiggtion?) can watch those Diggs go by.&amp;nbsp; One thing I did was enable customization so that you can configure Digg by topic or by type (new, popular or all).&amp;nbsp; &lt;/p&gt; &lt;p&gt;The Digg API is quite nice as is Headzoo's &lt;a href="http://www.codeplex.com/diggapinet"&gt;.NET wrapper&lt;/a&gt; up on Codeplex. He has a simple desktop app that I published using ClickOnce, which &lt;a href="http://www.rhizohm.net/apps/diggdesktop/publish.htm"&gt;you can try here&lt;/a&gt;. &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/16/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/16/default.aspx</link><pubDate>Wed, 24 Oct 2007 22:28:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/16/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>0</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/16/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>.NET Source Released</title><description>&lt;p&gt;The implications for &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx"&gt;Microsoft releasing the source of the .NET Framework&lt;/a&gt;, including WPF, are huge. Love it.&amp;nbsp; &lt;/p&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/15/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/15/default.aspx</link><pubDate>Wed, 03 Oct 2007 17:40:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/15/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/15/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>WPF Tips and Tricks: Window.Show() Without Activating The Window</title><description>&lt;p&gt;So you want to spawn a new WPF window but you don't want it to be activated?&amp;nbsp; This is doable in Win32, but with WPF, it presents some problems ... until now.&amp;nbsp; This issue recently came up and some folks (read: not me) on the WPF team discovered a a pretty clever workaround.&amp;nbsp; Basically, the workaround is to use an obscure windows hooks that exists for Computer Based Training (CBT), which allows or a training program to choose to ignore or allow messages to get through to the window. &lt;/p&gt; &lt;p&gt;So, the solution is to set the hook before calling the&amp;nbsp;&lt;strong&gt;Show()&lt;/strong&gt; method on the window. The call back receives the HCBT_ACTIVATE notification, returns 1 to ignore/prevent the operation, then unhooks the hook. The window is shown, but does not take focus. There is no flicker or visible degradation. &lt;p&gt;If you'd like to see this working in action, &lt;a href="http://rhizohm.net/apps/showwindowwithoutactivating/publish.htm"&gt;check out the sample application&lt;/a&gt; that I've deployed via ClickOnce.&amp;nbsp; You'll notice that the main window will&amp;nbsp;spawn three&amp;nbsp;windows yet you will&amp;nbsp;continue to be able to type in the textbox of the main window. I've &lt;a href="http://rhizohm.net/apps/showwindowwithoutactivating/showwindowwithoutactivating.zip"&gt;posted the source code&lt;/a&gt; and here's the crux of the code if you are interested: &lt;p&gt;&amp;nbsp;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Runtime.InteropServices;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Text;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Threading;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Controls;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Data;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Documents;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Input;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Media;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Media.Imaging;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Shapes;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Threading;


&lt;span style="color: rgb(0,0,255)"&gt;namespace&lt;/span&gt; ShowWindowWithoutActivating
{
    &lt;span style="color: rgb(128,128,128)"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0,128,0)"&gt; &lt;/span&gt;&lt;span style="color: rgb(128,128,128)"&gt;&amp;lt;summary&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(128,128,128)"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0,128,0)"&gt; Interaction logic for Window1.xaml
&lt;/span&gt;    &lt;span style="color: rgb(128,128,128)"&gt;///&lt;/span&gt;&lt;span style="color: rgb(0,128,0)"&gt; &lt;/span&gt;&lt;span style="color: rgb(128,128,128)"&gt;&amp;lt;/summary&amp;gt;

&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;partial&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Window1&lt;/span&gt; : System.Windows.&lt;span style="color: rgb(43,145,175)"&gt;Window
&lt;/span&gt;    {
        &lt;span style="color: rgb(0,0,255)"&gt;delegate&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;HookProc&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; code, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; wParam, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; lParam);
        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;HookProc&lt;/span&gt; myCallbackDelegate;
        &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; hook;

        &lt;span style="color: rgb(43,145,175)"&gt;DispatcherTimer&lt;/span&gt; dt = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DispatcherTimer&lt;/span&gt;();

        &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; counter = 0;

        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; Window1()
        {
            InitializeComponent();
            textBox1.Focus();
            dt.Interval = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; System.&lt;span style="color: rgb(43,145,175)"&gt;TimeSpan&lt;/span&gt;(0, 0, 3);
            dt.Tick += &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;EventHandler&lt;/span&gt;(TimerTick);
            dt.Start();

            &lt;span style="color: rgb(0,128,0)"&gt;// initialize our delegate
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.myCallbackDelegate = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;HookProc&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.MyCallbackFunction);

        }
        &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; TimerTick(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (counter == 2) dt.Stop();
            counter++;

            &lt;span style="color: rgb(43,145,175)"&gt;Window&lt;/span&gt; w = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Window&lt;/span&gt;();
            w.Title = &lt;span style="color: rgb(163,21,21)"&gt;"TestWindow"&lt;/span&gt;;
            w.Width = 400;
            w.Height = 300;
            w.Top = 400;
            w.Left = 400;

            &lt;span style="color: rgb(0,128,0)"&gt;// setup a cbt hook
&lt;/span&gt;            hook = SetWindowsHookEx(5 &lt;span style="color: rgb(0,128,0)"&gt;/* wh_cbt */&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.myCallbackDelegate, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt;.Zero, &lt;span style="color: rgb(43,145,175)"&gt;AppDomain&lt;/span&gt;.GetCurrentThreadId());
            w.Show();
        }

        &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; MyCallbackFunction(&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; code, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; wParam, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; lParam)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;switch&lt;/span&gt; (code)
            {
                &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; 5: &lt;span style="color: rgb(0,128,0)"&gt;/* HCBT_ACTVIATE */
&lt;/span&gt;                    UnhookWindowsHookEx(hook);
                    &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; 1; &lt;span style="color: rgb(0,128,0)"&gt;/* prevent windows from handling activate */
&lt;/span&gt;            }
            &lt;span style="color: rgb(0,128,0)"&gt;//return the value returned by CallNextHookEx
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; CallNextHookEx(&lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt;.Zero, code, wParam, lParam);
        }

        [&lt;span style="color: rgb(43,145,175)"&gt;DllImport&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;"user32.dll"&lt;/span&gt;)]
        &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;extern&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; UnhookWindowsHookEx(&lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; hhk);

        [&lt;span style="color: rgb(43,145,175)"&gt;DllImport&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;"user32.dll"&lt;/span&gt;)]
        &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;extern&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; SetWindowsHookEx(&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; code, &lt;span style="color: rgb(43,145,175)"&gt;HookProc&lt;/span&gt; func, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; hInstance, &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; threadID);

        [&lt;span style="color: rgb(43,145,175)"&gt;DllImport&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;"user32.dll"&lt;/span&gt;)]
        &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;extern&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; CallNextHookEx(&lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; hhk, &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; nCode, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; wParam, &lt;span style="color: rgb(43,145,175)"&gt;IntPtr&lt;/span&gt; lParam);

    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/9/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/9/default.aspx</link><pubDate>Wed, 22 Aug 2007 20:18:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/9/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/9/trackback/default.aspx</trackback:ping><category>WPF</category></item><item><title>Consuming JSON From WPF</title><description>&lt;p&gt;I want to throw up some prototype code that consumes JSON from WPF. (For more on JSON, see this &lt;a href="http://msdn2.microsoft.com/en-us/library/bb299886.aspx"&gt;article&lt;/a&gt;.) I put together that uses the JavaScriptSerializer to deserialize JSON into CLR objects, which could then be used for databinding.&amp;nbsp; &lt;/p&gt; &lt;p&gt;Here's what I did. First, I went and downloaded the &lt;a href="http://asp.net/ajax/Default.aspx"&gt;ASP.NET AJAX framework&lt;/a&gt;.&amp;nbsp; Then, I created a new WPF project and added a reference the System.Web.Extensions dll, which got installed to C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions.&amp;nbsp; I then added the System.Web.Script.Serialization to my using statements.&lt;/p&gt; &lt;p&gt;To keep things simple, I wanted to prove I could convert this JSON:&lt;/p&gt; &lt;p&gt;{ "FirstName": "Karsten", "IsAlive": "true"}&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Into this CLR type:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Person
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; FirstName;
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; IsAlive;
}
&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Turned out to be pretty simple.&amp;nbsp; Here's the code:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; Window1()
{
    InitializeComponent();
    &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptSerializer&lt;/span&gt; jss = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptSerializer&lt;/span&gt;();
    jss.RegisterConverters(&lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptConverter&lt;/span&gt;[] { 
    &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;PersonConverter&lt;/span&gt;() });
    &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; test = &lt;span style="color: rgb(163,21,21)"&gt;"{\"FirstName\": \"Karsten\", \"IsAlive\": \"true\"}"&lt;/span&gt;;
    &lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt; p = jss.Deserialize&amp;lt;&lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt;&amp;gt;(test);
    &lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt; p = jss.d
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Note how I register this thing called the &lt;span style="color: rgb(43,145,175)"&gt;PersonConverter &lt;/span&gt;after I instantiate the &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptSerializer&lt;/span&gt;&amp;nbsp;.&amp;nbsp; That's where all the work gets done and I'll discuss the &lt;span style="color: rgb(43,145,175)"&gt;PersonConverter &lt;/span&gt;below.&amp;nbsp; The only other interesting thing to note here is that to get the &lt;span style="color: rgb(43,145,175)"&gt;Person &lt;/span&gt;object,&amp;nbsp; I use the &lt;strong&gt;Deserialize&amp;lt;&amp;gt;&lt;/strong&gt; method instead of the &lt;strong&gt;DeserializeObject&lt;/strong&gt;(). This allows me to actually pass the type I want to have returned rather than attempting to cast the object afterward. &lt;/p&gt;
&lt;p&gt;So, here's the code for the &lt;span style="color: rgb(43,145,175)"&gt;PersonConverter&lt;/span&gt;, which overrides the &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptConverter &lt;/span&gt;:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;PersonConverter&lt;/span&gt; : &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptConverter
&lt;/span&gt;{

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;override&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; Deserialize(&lt;span style="color: rgb(43,145,175)"&gt;IDictionary&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt;&amp;gt; dictionary, &lt;span style="color: rgb(43,145,175)"&gt;Type&lt;/span&gt; type, &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptSerializer&lt;/span&gt; serializer)
    {
        &lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt; p = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt;();
        p.FirstName = serializer.ConvertToType&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;&amp;gt;(dictionary[&lt;span style="color: rgb(163,21,21)"&gt;"FirstName"&lt;/span&gt;]);
        p.IsAlive = serializer.ConvertToType&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt;&amp;gt;(dictionary[&lt;span style="color: rgb(163,21,21)"&gt;"IsAlive"&lt;/span&gt;]);
        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; p;
    }
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;override&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IDictionary&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;, &lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt;&amp;gt; Serialize(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; obj, &lt;span style="color: rgb(43,145,175)"&gt;JavaScriptSerializer&lt;/span&gt; serializer)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Exception&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;"The method or operation is not implemented."&lt;/span&gt;);
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;override&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IEnumerable&lt;/span&gt;&amp;lt;&lt;span style="color: rgb(43,145,175)"&gt;Type&lt;/span&gt;&amp;gt; SupportedTypes
    {
        &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt; { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Type&lt;/span&gt;[] { &lt;span style="color: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(&lt;span style="color: rgb(43,145,175)"&gt;Person&lt;/span&gt;)}; }
    }
}&lt;/pre&gt;
&lt;p&gt;The crux of the code here is in the override of Deserialize.&amp;nbsp; I followed the &lt;a href="http://asp.net/AJAX/Documentation/Live/mref/M_System_Web_Script_Serialization_JavaScriptConverter_Deserialize_4_39b5fe1f.aspx"&gt;SDK documentation&lt;/a&gt;&amp;nbsp;and made sure to use the ConvertToType method instead of doing the casting myself.&amp;nbsp;&amp;nbsp;Basically, I just map each property from the JSON to the CLR object.&amp;nbsp; One could probably get fancy and use Reflection to do this dynamically, if you had everything singing.&lt;/p&gt;
&lt;p&gt;I think I'll iterate on this a little more in a future post, but the net is that you can consume JSON into your WPF applications!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="code"&gt;
&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;</description><comments>http://www.rhizohm.net//irhetoric/blog/7/default.aspx</comments><link>http://www.rhizohm.net//irhetoric/blog/7/default.aspx</link><pubDate>Fri, 10 Aug 2007 00:20:00 GMT</pubDate><guid isPermaLink="true">http://www.rhizohm.net//irhetoric/blog/7/default.aspx</guid><dc:creator>Karsten Januszewski</dc:creator><slash:comments>1</slash:comments><trackback:ping>http://www.rhizohm.net//irhetoric/blog/7/trackback/default.aspx</trackback:ping><category>WPF</category></item></channel></rss>