<?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-US"><title type="html">IRhetoric - Karsten Januszewski  </title><subtitle type="html">Avalon: Convergence in the Simulacrum</subtitle><id>http://blogs.msdn.com/karstenj/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/karstenj/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-04-30T21:32:00Z</updated><entry><title>IRhetoric Has Moved to http://rhizohm.net/irhetoric</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/08/08/irhetoric-has-moved-to-http-rhizohm-net-irhetoric.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/08/08/irhetoric-has-moved-to-http-rhizohm-net-irhetoric.aspx</id><published>2007-08-09T00:55:00Z</published><updated>2007-08-09T00:55:00Z</updated><content type="html">&lt;P&gt;I'm no longer posting at this URL and all future posts will be made at &lt;A href="http://rhizohm.net/irhetoric"&gt;http://rhizohm.net/irhetoric&lt;/A&gt;. Please update your RSS.&amp;nbsp; Thanks!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4298221" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>Announcing Flotzam: Twitter, Flickr, Facebook and Blog Mash Up</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/21/announcing-flotzam-twitter-flickr-facebook-and-blog-mash-up.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/21/announcing-flotzam-twitter-flickr-facebook-and-blog-mash-up.aspx</id><published>2007-06-22T01:44:00Z</published><updated>2007-06-22T01:44:00Z</updated><content type="html">&lt;P&gt;Awhile back, for MIX, &lt;A href="http://systim.spaces.live.com/" mce_href="http://systim.spaces.live.com/"&gt;Tim Aidlin&lt;/A&gt; and I built Flitterbook.&amp;nbsp; We liked it so much that we now have version 2, renamed &lt;A href="http://flotzam.com/" mce_href="http://flotzam.com/"&gt;Flotzam&lt;/A&gt;, ready for your consumption.&amp;nbsp; Lots of improvements, including a new UI, RSS support, Facebook notifications and complete configuration control. Also, check out the &lt;A href="http://flotzam.com/blog/post/flotzam-video.aspx" mce_href="http://flotzam.com/blog/post/flotzam-video.aspx"&gt;Silverlight-created video that is a screen capture of the application in action&lt;/A&gt;.&amp;nbsp; So, we'd love for you to &lt;A href="http://flotzam.com/" mce_href="http://flotzam.com/"&gt;go check it out&lt;/A&gt;, let us know what you think on the &lt;A href="http://flotzam.com/forum/" mce_href="http://flotzam.com/forum/"&gt;Flotzam forum&lt;/A&gt; and watch the &lt;A href="http://flotzam.com/blog" mce_href="http://flotzam.com/blog"&gt;Flotzam blog&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://flotzam.com/" border="0"&gt;&lt;IMG src="http://flotzam.com/images/flotzam.jpg" border=0 mce_src="http://flotzam.com/images/flotzam.jpg"&gt;&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3449349" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF/default.aspx" /><category term="Facebook" scheme="http://blogs.msdn.com/karstenj/archive/tags/Facebook/default.aspx" /><category term="Twitter" scheme="http://blogs.msdn.com/karstenj/archive/tags/Twitter/default.aspx" /></entry><entry><title>COLLABORATING ON CREATING ANIMATIONS IN WPF AND BLEND: POSSIBILITIES AND LIMITATIONS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/20/collaborating-on-creating-animations-in-wpf-and-blend-possibilities-and-limitations.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/20/collaborating-on-creating-animations-in-wpf-and-blend-possibilities-and-limitations.aspx</id><published>2007-06-21T02:16:41Z</published><updated>2007-06-21T02:16:41Z</updated><content type="html">&lt;p&gt;One area that is currently top of mind for me is designer and developer collaboration with WPF and Expression Blend, in particular around animation.&amp;nbsp; I'd like to start documenting some techniques and outlining things that can and can't be done.&amp;nbsp;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Before diving in, let's quickly review the animation system in WPF.&amp;nbsp; The two ways to do animation in WPF is either declaratively (XAML) or procedurally (code).&amp;nbsp;&amp;nbsp;&amp;nbsp;If you use Expression Blend to create your animations, you will be in effect using the declarative (XAML) method.&amp;nbsp; What gets slightly confusing is that the two methods, declarative and procedural,&amp;nbsp;are not entirely in parallel.&amp;nbsp; For example, the only way to begin an animation declaratively (XAML) is through the &amp;lt;&lt;strong&gt;BeginStoryboard&lt;/strong&gt;&amp;gt; tag.&amp;nbsp; However, the equivalent call in code is to call the &lt;strong&gt;Begin&lt;/strong&gt; method off a &lt;strong&gt;UIElement&lt;/strong&gt; and&amp;nbsp; passing it the storyboard to fire.&amp;nbsp; The other option is to call the &lt;strong&gt;Begin&lt;/strong&gt; method from a storyboard itself, passing it the &lt;strong&gt;UIElement&lt;/strong&gt; to which the storyboard should be applied. And, in code, you can trigger animations that don't even have storyboards using&amp;nbsp;the &lt;strong&gt;ApplyAnimationClock&lt;/strong&gt; or &lt;strong&gt;BeginAnimation&lt;/strong&gt; directly off a &lt;strong&gt;UIElement&lt;/strong&gt;.&amp;nbsp; (More on this later if you're confused. The syntax is, like much of WPF, a little tricky.)&lt;/p&gt; &lt;p&gt;But all of the above -- and &lt;a href="http://msdn2.microsoft.com/en-us/library/ms752312.aspx"&gt;much of the SDK documentation on animation&lt;/a&gt; -- assumes that you have chosen either one or the other.&amp;nbsp; What happens if you want to mix and match these two methods?&amp;nbsp; This particularly comes into play if you are working on a project where animations get created in Blend but then need to be manipulated, triggered and recontextualized from code.&amp;nbsp; And it potentially gets more tricky if you have multiple people working on the project, the classic scenario being one person who creates the animations in Blend and another who works with those animations in code. &lt;/p&gt; &lt;p&gt;So, let's look at the possibilities:&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;1. How to&amp;nbsp;trigger a storyboard from code that was created in Blend.&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Let's say we have an animation in Blend to do&amp;nbsp;an opacity fade on an&amp;nbsp;image.&amp;nbsp; Assuming it was created&amp;nbsp;&amp;nbsp;by creating a new timeline and leave the "Create as a resource" checkbox checked, we can get at it from code pretty easily.Simply grab the storyboard from the resources, cast it appropriately&amp;nbsp;and begin it.&amp;nbsp; &lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;Storyboard s = (Storyboard) this.FindResource("FadeIn");&lt;br&gt;this.BeginStoryboard(s);&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Now, the reason this works is that the storyboard itself contains information about the name of the object that it wants to animate.&amp;nbsp; If you look at the storyboard &lt;a href="http://winfx.members.winisp.net/files/animationcollab.zip"&gt;in the sample code I posted&lt;/a&gt;, it sets the &lt;strong&gt;Storyboard.TargetName&lt;/strong&gt; value explicitly to the name "image".&amp;nbsp; Thus, when the storyboard is called from the page itself via &lt;strong&gt;BeginStoryboard&lt;/strong&gt;, it is able to find the element named image and run the animations. But what happens if we want to generically apply that animation that was created in Blend to other elements? &lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;2. How to trigger a storyboard from code and apply it to another UI element&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Well, to accomplish this task, we need to start hacking XAML.&amp;nbsp; If this scares you, don't read on.&amp;nbsp; But the fact is that XAML generated from Blend sometimes needs a little love. So, in this case, we are going to copy that storyboard.&amp;nbsp; We can't do that without jumping into the XAML and manually coping the entire &amp;lt;Storyboard&amp;gt; and giving it a new x:Key. Once we've done that, we have manually remove every instance where &lt;strong&gt;Storyboard.TargetName&lt;/strong&gt; is set.&amp;nbsp; Literally, remove the entire&amp;nbsp;attribute. Now, we can apply this storyboard to any &lt;strong&gt;UIElement&lt;/strong&gt; and not just images.&amp;nbsp;&amp;nbsp;In this case, we call the &lt;strong&gt;Begin&lt;/strong&gt; method from the storyboard itself, passing the element we want&amp;nbsp;the storyboard to be applied to.&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;Storyboard s = (Storyboard)this.FindResource("FadeIn2");&lt;br&gt;s.Begin(textBlock);&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;The thing to watch out for with this technique is to make sure you call the storyboard on an element that in fact has all the properties referenced in the storyboard.&amp;nbsp; Otherwise, you'll get a runtime exception that says something like:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;Additional information: '[Unknown]' property does not point to a DependencyObject in path '(0).(1).[0].(2)'.&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Which is saying that the animation could find the property that it was told to animate.&amp;nbsp; A place where this can get you is if you are doing any Transform animations, such as Scale, Translate, Rotate or Skew.&amp;nbsp; By default, when you add an element to Blend, it does not create a TransformGroup for it. For example, go to Blend, add a &lt;strong&gt;Rectangle&lt;/strong&gt; to the stage and see what it creates in XAML. It won't have a &lt;strong&gt;RenderTransform&lt;/strong&gt;.&amp;nbsp; Now, go change its scale to 2 and then change it back to 1.&amp;nbsp; Now look at its XAML: a RenderTransform has been permanently added to it as a child which doesn't do anything! Blend counts on that &lt;strong&gt;TransformGroup&lt;/strong&gt; for doing its animations, in that exact order (Scale, Skew, Rotate, Translate).&amp;nbsp; So, if you've created an animation that does a transform and you want to apply it to some other element, be sure that the element has a &lt;strong&gt;TransformGroup&lt;/strong&gt; with the four transforms.&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;3. How to tweak an animation created in Blend on the fly in code&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Let's say there's an animation created in Blend that you want to use, but you want to actually modify it with some dynamic values at runtime, maybe adding more animation.&amp;nbsp; First, you grab the storyboard and clone it so you have a new instance to party on. Then, you create your animation in code -- that's where you could insert dynamic variables.&amp;nbsp; Finally, you have to create a property path to the value you want animated.&amp;nbsp; The syntax is a little goofy, but once you crack its code as far as a path (&lt;a href="http://msdn2.microsoft.com/en-us/library/system.windows.propertypath.path.aspx"&gt;good doc here&lt;/a&gt;) you'll be off and running.&amp;nbsp; Here's the code I used to add a scale animation on the fly:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;Storyboard s = ((Storyboard)this.FindResource("FadeIn2")).Clone();&lt;br&gt;DoubleAnimation da = new DoubleAnimation(0, 1, TimeSpan.FromSeconds(1), FillBehavior.HoldEnd);&lt;br&gt;Storyboard.SetTargetProperty(da, new PropertyPath("(0).(1).[0].(2)", UIElement.RenderTransformProperty,&lt;br&gt;TransformGroup.ChildrenProperty,&lt;br&gt;ScaleTransform.ScaleXProperty));&lt;br&gt;s.Children.Add(da);&lt;br&gt;s.Begin(rectangle);&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;You could use a similar technique to crack into the storyboard, grab an animation that was created in XAML and tweak it.&amp;nbsp; So for example, we could grab the animation from the storyboard and change its begin time like this:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;DoubleAnimationUsingKeyFrames d = (DoubleAnimationUsingKeyFrames)s.Children[0];&lt;br&gt;d.BeginTime = TimeSpan.FromSeconds(.5);&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="4"&gt;4. How to crack into an animation that is part of a DataTemplate&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Doh! You can't!&amp;nbsp; I tried every workaround I could, but once a &lt;strong&gt;ContentTemplate&lt;/strong&gt; gets loaded, it is in the WPF terminology "Sealed" and I've never seen a way to make it unsealed, even before it is added to the visual tree.&amp;nbsp; Bummer.&lt;/p&gt; &lt;p&gt;**********************************&lt;/p&gt; &lt;p&gt;So where are we?&amp;nbsp; We've&amp;nbsp;learned&amp;nbsp;some techniques such that a design technologist or interactive designer or diviner (or whatever they are called) can work in Blend, creating subtle and great animations and then, if there are scenarios where the developer or integrator or diviner (or whatever they are called) needs to start that animation, reuse that animation or tweak that animation on the fly, they can. Go WPF!&lt;/p&gt; &lt;p&gt;&lt;a href="http://winfx.members.winisp.net/files/animationcollab.zip"&gt;Download the code&lt;/a&gt;&lt;/p&gt;&lt;img src="http://winfx.members.winisp.net/files/snowboard.jpg"&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3433330" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="Windows Presentation Foundation (Avalon)" scheme="http://blogs.msdn.com/karstenj/archive/tags/Windows+Presentation+Foundation+_2800_Avalon_2900_/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF/default.aspx" /><category term="Expression Blend" scheme="http://blogs.msdn.com/karstenj/archive/tags/Expression+Blend/default.aspx" /></entry><entry><title>Microsoft Facebook Toolkit Is Open Sourced and Moves to Codeplex</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/08/microsoft-facebook-toolkit-is-open-sourced-and-moves-to-codeplex.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/08/microsoft-facebook-toolkit-is-open-sourced-and-moves-to-codeplex.aspx</id><published>2007-06-09T04:34:18Z</published><updated>2007-06-09T04:34:18Z</updated><content type="html">&lt;p&gt;It was two weeks ago that Microsoft released the Microsoft Facebook Toolkit.&amp;nbsp; The response has been great and an &lt;a href="http://wiki.f8.facebook.com/index.php/ASP.NET_Microsoft_Dev_Kit"&gt;wiki&lt;/a&gt; popped up that people in the community were using to make enhancements to the toolkit and make fixes.&amp;nbsp; As a result, Clarity Consulting (who developed the original toolkit for Microsoft) has &lt;a href="http://www.codeplex.com/FacebookToolkit"&gt;posted the toolkit to Codeplex.&lt;/a&gt;&amp;nbsp; This now formalizes a way for the toolkit to continue to evolve and,&amp;nbsp;even better,&amp;nbsp;for all developers to get the latest and greatest toolkit without having to go manually make the fixes based on the wiki.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3173027" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="Facebook" scheme="http://blogs.msdn.com/karstenj/archive/tags/Facebook/default.aspx" /></entry><entry><title>CREATING A .NET TWITTER API in 4.5 SECONDS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/08/creating-a-net-twitter-api-in-4-5-seconds.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/08/creating-a-net-twitter-api-in-4-5-seconds.aspx</id><published>2007-06-09T00:01:00Z</published><updated>2007-06-09T00:01:00Z</updated><content type="html">&lt;P&gt;I've been meaning to document how I wrapped the Twitter API ... in 4.5 seconds.&amp;nbsp;&amp;nbsp; There is a&amp;nbsp;very powerful feature in .NET is a tool in the sdk called &lt;STRONG&gt;xsd.exe&lt;/STRONG&gt;.&amp;nbsp; Darren David actually has &lt;A href="http://blog.lookorfeel.com/index.php/2007/05/02/the-net-xml-schema-definition-tool-or-how-i-learned-to-stop-parsing-and-love-the-dom-part-1/" mce_href="http://blog.lookorfeel.com/index.php/2007/05/02/the-net-xml-schema-definition-tool-or-how-i-learned-to-stop-parsing-and-love-the-dom-part-1/"&gt;a fabulous post&lt;/A&gt; on&amp;nbsp;exactly the power of this tool: never touch a DOM&amp;nbsp;or XPATH again!&amp;nbsp; &amp;nbsp;His post explains what is happening under the hood with xsd.exe quite nicely.&amp;nbsp;I'd definitely recommend reading his post.&amp;nbsp; I figured it might be interesting for folks to see&amp;nbsp;the exact steps I took to wrap the Twitter API:&lt;/P&gt;
&lt;P&gt;1. Grab an instance of the public timeline from Twitter and pass that to xsd.exe to infer a schema as follows: &lt;STRONG&gt;xsd&lt;/STRONG&gt; &lt;A title=http://twitter.com/statuses/public_timeline.xml href="http://twitter.com/statuses/public_timeline.xml" mce_href="http://twitter.com/statuses/public_timeline.xml"&gt;http://twitter.com/statuses/public_timeline.xml&lt;/A&gt;&amp;nbsp;which creates public_timeline.xsd&lt;/P&gt;
&lt;P&gt;3. Use the inferred schema to generate classes: &lt;STRONG&gt;xsd&lt;/STRONG&gt; public_timeline.xsd&lt;/P&gt;
&lt;P&gt;4. Walla!&amp;nbsp; We now have a class to party on called public_timeline.cs&lt;/P&gt;
&lt;P&gt;5. To instantiate the class with live data, it is as simple as the following:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;System.Xml.Serialization.XmlSerializer serializer = new System.Xml.Serialization.XmlSerializer(typeof(statuses));&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;statuses s = serializer.Deserialize(new System.Xml.XmlTextReader("&lt;/STRONG&gt;&lt;/FONT&gt;&lt;A href="http://twitter.com/statuses/public_timeline.xml%22))" mce_href='http://twitter.com/statuses/public_timeline.xml"))'&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;http://twitter.com/statuses/public_timeline.xml"))&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt; as statuses;&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;And there you have it.&amp;nbsp; No DOM, no XPATH, no RegEx.&amp;nbsp; Now, if we want to take this wrapper to the next level, there are a few things we can do.&amp;nbsp; First, you will notice that Twitter returns the data as a string.&amp;nbsp; That's kind of a bummer; it would be nice to have it as a strongly typed &lt;STRONG&gt;DateTime&lt;/STRONG&gt;.&amp;nbsp; Here's the line of code to do that: 
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;DateTime date = DateTime.ParseExact(s.created_at, "ddd MMM dd HH:mm:ss zzzzz yyyy", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;Another thing that you'll need to do is authenticate when you contact Twitter if you want data other than the public timeline.&amp;nbsp; Here's how to do that: 
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;using (WebClient client = new WebClient())&lt;BR&gt;{&lt;BR&gt;client.Credentials = new NetworkCredential(TWITTER_USERNAME, TWITTER_PASSWORD);&lt;BR&gt;statuses s = serializer.Deserialize(client.OpenRead(TWITTER_URL)) as statuses;&lt;BR&gt;}&lt;/STRONG&gt;&lt;/FONT&gt; 
&lt;P&gt;Of course, the TWITTER variables need to be set with the username, password and particular URL to the Twitter feed you are looking for.&amp;nbsp; 
&lt;P&gt;Another thing to think about doing is making the calls to Twitter on a different thread.&amp;nbsp; My recommendation for doing that is to implement &lt;A href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx" mce_href="http://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Dan Crevier's Data-View-View Model&lt;/A&gt;.&amp;nbsp; This frees the UI thread from any calls to Twitter and provides a really nice model for marshalling data between the threads.&amp;nbsp; In fact, I did just this in my &lt;A href="http://winfx.members.winisp.net/blog/flitter.zip" mce_href="http://winfx.members.winisp.net/blog/flitter.zip"&gt;Flitter&lt;/A&gt; and &lt;A href="http://blogs.msdn.com/coding4fun/attachment/2854939.ashx" mce_href="http://blogs.msdn.com/coding4fun/attachment/2854939.ashx"&gt;Flitterbook&lt;/A&gt; implementations, which you can check out in the source code. 
&lt;P&gt;The final thing to think about, which I just recently implemented in some code I was working on, was to make the naming conventions look prettier.&amp;nbsp; Darren David alluded to this in his post but he's been so busy with the totally amazing &lt;A href="http://blog.lookorfeel.com/index.php/2007/06/04/hp-multi-touch-interactive-canvas-launched-at-d5/" mce_href="http://blog.lookorfeel.com/index.php/2007/06/04/hp-multi-touch-interactive-canvas-launched-at-d5/"&gt;HP Multi Touch kiosk he built&lt;/A&gt; (which you have to check out the videos for if you haven't yet) that he hasn't posted his part II.&amp;nbsp; But I imagine he's going to talk about using partial classes so as to make the class look prettier without touching the generated code.&amp;nbsp; This came in real handy with the Twitter API which generated some code with ugly array structures that I wasn't so keen on.&amp;nbsp;I also had a need to use&amp;nbsp;a kind of cool feature of WPF databinding&amp;nbsp;where I&amp;nbsp;wanted to reuse a datatemplate between two&amp;nbsp;different objects&amp;nbsp;(Twitter status and Facebook status) by just having them share names, such as AvatarURL, rather than create two templates that were fundamentally identitcal except for the data object.&amp;nbsp;As such, I created a partial class with a bunch of getters as follows: 
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;public partial class statusesStatus&lt;BR&gt;{&lt;BR&gt;public DateTime Date&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return DateTime.ParseExact((string)this.created_at, "ddd MMM dd HH:mm:ss zzzzz yyyy", CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal);&lt;BR&gt;}&lt;BR&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;public string AvatarUrl&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return this.user[0].profile_image_url;&lt;BR&gt;}&lt;BR&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;public string Text&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return this.text;&lt;BR&gt;}&lt;BR&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;public string UserName&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return this.user[0].screen_name;&lt;BR&gt;}&lt;BR&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;public string Location&lt;BR&gt;{&lt;BR&gt;get&lt;BR&gt;{&lt;BR&gt;return this.user[0].location;&lt;BR&gt;}&lt;BR&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;} &lt;/STRONG&gt;&lt;/FONT&gt;
&lt;P&gt;Now I have a much prettier class without touching the generated code from xsd.exe.&amp;nbsp; Sorry for stealing Part II Darren. I couldn't&amp;nbsp;help myself, as I&amp;nbsp;have been&amp;nbsp;meaning to write this post for about 2 months!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3168876" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="Windows Presentation Foundation (Avalon)" scheme="http://blogs.msdn.com/karstenj/archive/tags/Windows+Presentation+Foundation+_2800_Avalon_2900_/default.aspx" /><category term="WPF" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF/default.aspx" /><category term="Twitter" scheme="http://blogs.msdn.com/karstenj/archive/tags/Twitter/default.aspx" /></entry><entry><title>UPDATED WPF PERFORMANCE PROFILING TOOLS POSTED</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/07/updated-wpf-performance-profiling-tools-posted.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/07/updated-wpf-performance-profiling-tools-posted.aspx</id><published>2007-06-07T22:51:04Z</published><updated>2007-06-07T22:51:04Z</updated><content type="html">&lt;p&gt;&lt;a href="http://blogs.msdn.com/wpfsdk/archive/2007/06/05/wpf-perf-tool-available-as-standalone-msi.aspx"&gt;A new version of the WPF Performance Profiling tools&lt;/a&gt; has been posted, &lt;a href="http://wpf.netfx3.com/files/folders/developer/entry10880.aspx"&gt;x86&lt;/a&gt; and &lt;a href="http://wpf.netfx3.com/files/folders/developer/entry10879.aspx"&gt;x64&lt;/a&gt;, as an .msi. These tools were previously only available in the beta .NET Framework 3.5 SDK, but that is a rather hefty dowload at over 1 gig.&amp;nbsp; Now, you can get at these invaluable tools as a simple download which is less than 1mg.&amp;nbsp; If you are a WPF developer and aren't using these tools, download immediately!&amp;nbsp; If you are using the existing wpfperf.exe tools, the recommendation is to move to the new version of the tools.&amp;nbsp;Happy profiling -- and watch out for those bitmap effects!&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;&lt;img src="http://winfx.members.winisp.net/images/wpfperf.jpg"&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3147264" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>UDDI RESOURCES MIGRATED</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/06/05/uddi-resources-migrated.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/06/05/uddi-resources-migrated.aspx</id><published>2007-06-06T01:36:00Z</published><updated>2007-06-06T01:36:00Z</updated><content type="html">&lt;P&gt;This post has nothing to do with WPF, Expression, Silverlight, Vista or pixels. Rather, it has to do with web service discovery and with my former role at Microsoft in working with &lt;A href="http://www.uddi.org/" mce_href="http://www.uddi.org/"&gt;UDDI&lt;/A&gt;. I had a bunch of resources up on &lt;A href="http://www.gotdotnet.com/" mce_href="http://www.gotdotnet.com/"&gt;GotDotNet&lt;/A&gt; which I have had to migrate with the phase-out of GotDotNet.&amp;nbsp; These resources include a couple of interesting white papers I wrote on using &lt;A href="http://winfx.members.winisp.net/karstenj/docs/rss_in_uddi.aspx" mce_href="http://winfx.members.winisp.net/karstenj/docs/rss_in_uddi.aspx"&gt;UDDI to catalog RSS&lt;/A&gt;, how to &lt;A href="http://winfx.members.winisp.net/karstenj/docs/rss_in_uddi_services.aspx" mce_href="http://winfx.members.winisp.net/karstenj/docs/rss_in_uddi_services.aspx"&gt;register RSS in the Windows Server implementation of UDDI&lt;/A&gt;&amp;nbsp;and a &lt;A href="http://winfx.members.winisp.net/karstenj/rssuddi.zip" mce_href="http://winfx.members.winisp.net/karstenj/rssuddi.zip"&gt;WinForms sample&lt;/A&gt; using the UDDI SDK to read and publish blogs to UDDI.&amp;nbsp; (I'm still proud of these!)&amp;nbsp;Also&amp;nbsp;included in these resources is &lt;A href="http://winfx.members.winisp.net/karstenj/blog.aspx" mce_href="http://winfx.members.winisp.net/karstenj/blog.aspx"&gt;my UDDI blog&lt;/A&gt;, which has some nice nuggets&amp;nbsp;including "The Strange and Curious World of tModels".&amp;nbsp; Lastly, there is a &lt;A href="http://winfx.members.winisp.net/karstenj/" mce_href="http://winfx.members.winisp.net/karstenj/"&gt;UDDI resources page&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;My UDDI blog is also evidence that I was blogging as a Microsoft employee back in 2002, using &lt;A href="http://pluralsight.com/blogs/dbox/" mce_href="http://pluralsight.com/blogs/dbox/"&gt;Don Box's&lt;/A&gt; spoutlet codebase, which was a super simple and elegant RSS engine that uses XML and XSL to provide both HTML and RSS compliant XML, 1.0 of course given the time this was written.&amp;nbsp; I also find it amusing that &lt;A href="http://winfx.members.winisp.net/karstenj/blog.aspx?key=2002-09-24T02:10-08:00" mce_href="http://winfx.members.winisp.net/karstenj/blog.aspx?key=2002-09-24T02:10-08:00"&gt;I posted&lt;/A&gt; an entry where &lt;A href="http://blog.jonudell.net/" mce_href="http://blog.jonudell.net/"&gt;John Udell&lt;/A&gt; &lt;A href="http://weblog.infoworld.com/udell/2002/09/23.html#a421" mce_href="http://weblog.infoworld.com/udell/2002/09/23.html#a421"&gt;complains about the lack of Microsoft bloggers&lt;/A&gt;.&amp;nbsp;He now is on a sister team with me at Microsoft.&amp;nbsp;&amp;nbsp;Funny.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://www.uddi.org/images/header_2005.gif" mce_src="http://www.uddi.org/images/header_2005.gif"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3105311" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>FLITTERBOOK: INTEGRATING WITH THE FACEBOOK PLATFORM</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/24/flitterbook-integrating-with-the-facebook-platform.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/24/flitterbook-integrating-with-the-facebook-platform.aspx</id><published>2007-05-25T08:50:19Z</published><updated>2007-05-25T08:50:19Z</updated><content type="html">&lt;p&gt;I'm here at the &lt;a href="http://www.techcrunch.com/2007/05/24/facebook-launches-facebook-platform-they-are-the-anti-myspace/"&gt;Facebook Developer's event&lt;/a&gt; down here in San Francisco.&amp;nbsp; Dan'l Lewin from Microsoft was on stage as a parter:&lt;/p&gt; &lt;p&gt;&lt;img src="http://farm1.static.flickr.com/189/512719401_40f6dd4b74_m.jpg"&gt; &lt;/p&gt; &lt;p&gt;Lots of good stuff announced as far as Facebook/Microsoft partnership: Microsoft just released &lt;a href="http://blogs.msdn.com/coding4fun/archive/2007/05/24/2854939.aspx"&gt;a great wrapper to the Facebook API&lt;/a&gt;&amp;nbsp;written by the guys at &lt;a href="http://www.claritycon.com/"&gt;Clarity Consulting&lt;/a&gt;.&amp;nbsp; They've got some nice sample applications, including a cool WPF app that is a rolodex of your Facebook contacts.&lt;/p&gt; &lt;p&gt;&lt;img src="http://farm1.static.flickr.com/223/512983829_e2f4f63dbf_m.jpg"&gt; &lt;/p&gt; &lt;p&gt;&lt;br&gt;Also, Popfly also added support for the Facebook API to their mashup builder.&amp;nbsp; Speaking of Silverlight, there's support for Silverlight in FBML via the FB:Silverlight tag, although it is undocumented right now and not quite there.&amp;nbsp; However, you can host Silverlight in an iframe using FBML.&amp;nbsp; More on that to come.&lt;/p&gt; &lt;p&gt;I&amp;nbsp;implemented in an updated version of Flitterbook, which you can download &lt;a href="http://blogs.msdn.com/coding4fun/attachment/2854939.ashx"&gt;here&lt;/a&gt;.&amp;nbsp; This version of Flitterbook now has support for the Facebook API and pulls all images from your friends along with Twitter feeds and Flickr data.&amp;nbsp; Again, this is still alpha code: no promises!&lt;/p&gt; &lt;p&gt;One thing I implemented in Flitterbook is support for infinite sessions with Facebook.&amp;nbsp; There aren't any code samples for this in the samples that ship with the Facebook&amp;nbsp; Developer Toolkit so I thought it might be useful for other folks. I save the Facebook infinite session data in a user config file using Visual Studio. The crux is that you have to pass your own secret if you don't have a secret that gets returned from Facebook to support an infinite session.&amp;nbsp; Here's the code:&lt;/p&gt; &lt;p&gt;&lt;font face="Courier New"&gt;&lt;/font&gt; &lt;p&gt;&lt;font face="Courier New"&gt;//set infinite session parameters on to facebook data adapter&lt;br&gt;if (Settings.Default.IsFacebookInfiniteSession)&lt;br&gt;{&lt;br&gt;&amp;nbsp; facebookConnect.UserId = Settings.Default.FACEBOOK_USERID;&lt;br&gt;&amp;nbsp; facebookConnect.SessionKey = Settings.Default.FACEBOOK_SESSIONKEY;&lt;br&gt;&amp;nbsp; //note here that we pass the secret that we saved&lt;br&gt;&amp;nbsp; facebookConnect.Secret = Settings.Default.FACEBOOK_SECRET;&lt;br&gt;}&lt;br&gt;else&lt;br&gt;{&lt;br&gt;&amp;nbsp; //if we don't have an infinite session, we use my application's secret&lt;br&gt;&amp;nbsp; facebookConnect.Secret = secret;&lt;br&gt;&amp;nbsp; //we invoke the UI dialog&lt;br&gt;&amp;nbsp; facebookConnect.ConnectToFacebook();&lt;br&gt;&amp;nbsp; //if the user let us save their session, throw it in config&lt;br&gt;&amp;nbsp; if (!facebookConnect.SessionExpires)&lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Settings.Default.FACEBOOK_SESSIONKEY = facebookConnect.SessionKey;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Settings.Default.FACEBOOK_USERID = facebookConnect.UserId;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Settings.Default.FACEBOOK_SECRET = facebookConnect.Secret;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Settings.Default.IsFacebookInfiniteSession = true;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Settings.Default.Save();&lt;br&gt;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2861820" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF/default.aspx" /><category term="Expression Blend" scheme="http://blogs.msdn.com/karstenj/archive/tags/Expression+Blend/default.aspx" /></entry><entry><title>THREE NEW EXPRESSION BLEND HANDS-ON LABS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/22/three-new-expression-blend-hands-on-labs.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/22/three-new-expression-blend-hands-on-labs.aspx</id><published>2007-05-22T17:26:00Z</published><updated>2007-05-22T17:26:00Z</updated><content type="html">&lt;P&gt;I just posted three new hands-on labs for Expression Blend that were created for MIX but haven't been posted for the world yet.&amp;nbsp;There's lots of little nuggets in there worth checking out, things like creating a user controls, databinding, triggers, styling controls, using web services, paging, data input&amp;nbsp;and more.&amp;nbsp; The more I use Blend, the more I love it, but it has &lt;A href="http://blogs.msdn.com/karstenj/archive/2006/04/05/curve.aspx" mce_href="http://blogs.msdn.com/karstenj/archive/2006/04/05/curve.aspx"&gt;its own learning curve&lt;/A&gt;, above and beyond WPF.&lt;/P&gt;
&lt;P&gt;The first lab is a UI for Windows Live Search, including Image Search.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://winfx.members.winisp.net/images/live.jpg" mce_src="http://winfx.members.winisp.net/images/live.jpg"&gt; &lt;/P&gt;
&lt;P&gt;The second lab is a color swatch lab.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://winfx.members.winisp.net/images/swatch.jpg" mce_src="http://winfx.members.winisp.net/images/swatch.jpg"&gt; &lt;/P&gt;
&lt;P&gt;The third lab is a recipe viewer application.&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://winfx.members.winisp.net/images/recipe.jpg" mce_src="http://winfx.members.winisp.net/images/recipe.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2793871" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="WPF" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF/default.aspx" /><category term="Expression Blend" scheme="http://blogs.msdn.com/karstenj/archive/tags/Expression+Blend/default.aspx" /></entry><entry><title>TWITTERPATED: ON TWITTER AND CONFERENCES</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/17/twitterpated-on-twitter-and-conferences.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/17/twitterpated-on-twitter-and-conferences.aspx</id><published>2007-05-18T02:33:00Z</published><updated>2007-05-18T02:33:00Z</updated><content type="html">&lt;P&gt;I'm very interested in the phenomenon of Twitter.&amp;nbsp; In this piece, I want to write about a particular aspect of Twitter and the one that I'm most familiar with, the usage of Twitter at conferences.&amp;nbsp; In fact, I was first turned on to Twitter at South by Southwest Interactive. They had monitors scattered about the conference with a visualization of everyone who was using Twitter at the conference.&amp;nbsp; Thought balloons would float by with the person's icon, realtime.&amp;nbsp; In fact, here is a screenshot of my ego-twitter:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://inlinethumb51.webshots.com/4338/2480253160100818464S500x500Q85.jpg" mce_src="http://inlinethumb51.webshots.com/4338/2480253160100818464S500x500Q85.jpg"&gt; &lt;/P&gt;
&lt;P&gt;What I liked about this visualization while I was at the conference was the the realtime commentary that the visualization provided: about sessions (good and bad), about parties (especially unannounced ones), about any ancillary things happening.&amp;nbsp;&amp;nbsp; The other nifty thing about the visualization was the social networking aspect, in that if you saw a twitter that interested you, it was easy to subscribe to that person's feed right from your cellphone and start getting that person's twitter feed pushed to you.&amp;nbsp; In fact, the crux of twitter at a conference is the SMS aspect.&amp;nbsp; &lt;EM&gt;The ability to interact immediately with the "cloud" right from your cellphone, both to comment and to receive comments, is the power of Twitter at a conference.&amp;nbsp; &lt;/EM&gt;Not only can the conference organizers push information to attendees, but attendees can create their own web of connections.&lt;/P&gt;
&lt;P&gt;I was inspired by the visualization at SxSW and decided to write my own.&amp;nbsp; You can see the first cut here which I called Twitterpated (&lt;A href="http://wpf.netfx3.com/direct/twitterpated/twitterpated.application" mce_href="http://wpf.netfx3.com/direct/twitterpated/twitterpated.application"&gt;run it&lt;/A&gt; or &lt;A href="http://winfx.members.winisp.net/wpf/twitterpated.zip" mce_href="http://winfx.members.winisp.net/wpf/twitterpated.zip"&gt;download source here&lt;/A&gt;).&amp;nbsp; Note that you'll need the .NET Framework 3.0 to run it if you are on XP.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://wpf.netfx3.com/direct/twitterpated/twitterpated.application" border="0" mce_href="http://wpf.netfx3.com/direct/twitterpated/twitterpated.application"&gt;&lt;IMG style="WIDTH: 988px; HEIGHT: 588px" height=588 src="http://winfx.members.winisp.net/images/twitterpated.jpg" width=988 border=0 mce_src="http://winfx.members.winisp.net/images/twitterpated.jpg"&gt;&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There's lots of goofy code in there, so please beware!&amp;nbsp; Classic case of having to write an app the first time and fail in order to write it correctly.&amp;nbsp; I went about the animations in the wrong way, trying to animate from off the screen using an itemscontrol. Also, I only fetch the Twitter data once and never implemented a real data model.&amp;nbsp; But I figured I'd post it in case there was something useful for someone.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;All of this happened pre-MIX.&amp;nbsp; It was the logical next step to do something similar for MIX.&amp;nbsp; In talking with Beth Goza, I realized there were other social networking aspects being promoted for MIX, including Flickr and Facebook.&amp;nbsp; As such, I wanted my visualization to pull not only Twitter, but these other feeds.&amp;nbsp; It turned out my architecture made this trivial, using WPF (more on the technical details of this in a future post.) I also wanted to bring in a designer to help with the visuals, thus Tim Aidlin's work on the project. Not only has this immensely improved the look and feel of the app, but also has given me more experience with designer/developer workflow using Expression (more on that in a later post as well.)&lt;/P&gt;
&lt;P&gt;The result was &lt;A href="http://blogs.msdn.com/karstenj/archive/2007/04/30/flitter-source-posted.aspx" mce_href="http://blogs.msdn.com/karstenj/archive/2007/04/30/flitter-source-posted.aspx"&gt;Flitterbook&lt;/A&gt;.&amp;nbsp; It ended up at two places at MIX.&amp;nbsp; The first place was before the keynotes on the big screen:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://farm1.static.flickr.com/170/479477951_8a67091ca8.jpg" mce_src="http://farm1.static.flickr.com/170/479477951_8a67091ca8.jpg"&gt; &lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://farm1.static.flickr.com/193/481984956_ed4a2c4d06.jpg" mce_src="http://farm1.static.flickr.com/193/481984956_ed4a2c4d06.jpg"&gt; &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It was great to see it up on the big screen and really funny to see people figure out that they could ego twitter realtime.&amp;nbsp; Many people commented on the band, both favorably and unfavorably, which was hilarious ("too much accordion for this early in the morning").&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The other place it was at MIX was as a screensaver on all machines available to attendees for Internet access, similar to SxSW:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://farm1.static.flickr.com/219/482226322_8a0ea9b384.jpg" mce_src="http://farm1.static.flickr.com/219/482226322_8a0ea9b384.jpg"&gt; &lt;/P&gt;
&lt;P&gt;One technical note if you are interested in using this code for your conference.&amp;nbsp; For all of this to work, you need to make sure that you create a Twitter account for your conference and then have attendees FOLLOW that account.&amp;nbsp; So, for MIX, we had an account called MIX07.&amp;nbsp; Then, the visualizer pulled a feed of all the followers.&amp;nbsp; To pull this feed, the application had to authenticate to Twitter with the MIX07 credentials.&amp;nbsp; You'd need to do something similar if you wanted to do this for another conference.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2702647" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author><category term="WPF TWITTER" scheme="http://blogs.msdn.com/karstenj/archive/tags/WPF+TWITTER/default.aspx" /></entry><entry><title>DIGGING INTO LUTZ ROEDER'S MONOTONE</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/10/digging-into-lutz-roeder-s-monotone.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/10/digging-into-lutz-roeder-s-monotone.aspx</id><published>2007-05-11T02:17:53Z</published><updated>2007-05-11T02:17:53Z</updated><content type="html">&lt;p&gt;&lt;/p&gt; &lt;p&gt;Check out Lutz Roeder's &lt;a href="http://www.aisto.com/Roeder/Silverlight/Monotone/Default.aspx"&gt;Monotone&lt;/a&gt; -- very, very&amp;nbsp;cool.&amp;nbsp;  &lt;p&gt;&lt;img src="http://www.aisto.com/Roeder/Silverlight/Monotone.png"&gt;  &lt;p&gt;Pay close attention to how tightly synched the animation is with the visuals. I've been digging into the &lt;a href="http://www.aisto.com/roeder/silverlight/download.aspx?file=Monotone"&gt;source code&lt;/a&gt; and there are several techniques he uses that are worth calling out.&amp;nbsp; First, it is interesting to note how the entire logic of the experience is controled in code.&amp;nbsp; There is nothing in Page.xaml.&amp;nbsp; It is in the constructor of his &lt;strong&gt;Page&lt;/strong&gt; class that he wires up his &lt;strong&gt;Loaded&lt;/strong&gt; event and it is in the &lt;strong&gt;Loaded&lt;/strong&gt; event where he uses the &lt;strong&gt;Downloader&lt;/strong&gt; object to insure that the mp3 he wants to play is in fact downloaded.&amp;nbsp; He then starts the .mp3 playing on the &lt;strong&gt;Downloader_DownloadProgressChanged&lt;/strong&gt;.&amp;nbsp;If you watching&amp;nbsp;carefully, you'll notice that&amp;nbsp;he throws up a progress bar while the &lt;strong&gt;Downloader&lt;/strong&gt; is running and&amp;nbsp;he includes the code for the&amp;nbsp;&lt;strong&gt;ProgressBar&lt;/strong&gt; class, worth grabbing that source. &amp;nbsp;So why does he go to all this work instead of just assigning the mp3 to a MediaElement directly? Well, by handling the downloading of the mp3 himself, it ensures that he knows exactly when the music starts, so that his animations are exactly&amp;nbsp;in synch, which if you notice, the timing is perfect as the&amp;nbsp;squares animate in. &lt;p&gt;&amp;nbsp;He adds the first visual by dynamically loading his XAML file into the&amp;nbsp;canvas with&amp;nbsp;this code: &lt;p&gt;&lt;font face="Courier New"&gt;using (StreamReader reader = new StreamReader(this.GetType().Assembly.GetManifestResourceStream("Monotone.Grid.xaml")))&lt;br&gt;{&lt;br&gt;&amp;nbsp;this.Children.Add((Canvas) XamlReader.Load(reader.ReadToEnd()));&lt;br&gt;}&lt;/font&gt; &lt;p&gt;I include this because it isn't exactly intuitive code to write!&amp;nbsp; Sure, &lt;strong&gt;XmlReader.Load&lt;/strong&gt; is not rocket science, but getting at the xaml file requires some arm twisting, as you can see.&amp;nbsp; Once the Grid.xaml file is loaded, its animations kick off based on an &lt;strong&gt;EventTrigger&lt;/strong&gt;.&amp;nbsp; I'm sure he used Blend to create these animations.&amp;nbsp; In fact, if you open up the project in Blend, you'll see that you can run all the animations from within Blend.&amp;nbsp; However, here's one tricky part.&amp;nbsp; You can see there are two &lt;strong&gt;Storyboards &lt;/strong&gt;nested within the &lt;strong&gt;Canvas.Loaded EventTrigger&lt;/strong&gt;.&amp;nbsp; But the second storyboard's &lt;strong&gt;BeginTime&lt;/strong&gt; happens to fall exactly at 6.85 seconds, which is timed for when the first storyboard ends.&amp;nbsp; Unfortunately, there isn't a way to set this value in Blend.&amp;nbsp; He probably just manually added it to the XAML. &lt;p&gt;The next part of the piece is a spiral math art animation.&amp;nbsp; But before how does he know to unload the grid.xaml and fire off the spiral animation?&amp;nbsp; He actually uses a timer!&amp;nbsp; You'll notice that he starts off an &lt;strong&gt;HtmlTimer&lt;/strong&gt; right after he calls play on on the mp3.&amp;nbsp; The timer's interval is set here: &lt;p&gt;this.timer.Interval = (int)((60f / 140f) * 4 * 4 * 2 * 1000f); &lt;p&gt;Not sure why he&amp;nbsp;couldn't just use the &lt;strong&gt;TimeSpan&lt;/strong&gt; object and cast to (int), but&amp;nbsp;Lutz will have to&amp;nbsp;address that! Anyway, this is what he uses to then unload his &lt;strong&gt;Grid&lt;/strong&gt; and load his custom &lt;strong&gt;Spiral&lt;/strong&gt; class.&amp;nbsp; The &lt;strong&gt;Spiral&lt;/strong&gt; class, which&amp;nbsp;subclasses &lt;strong&gt;Canvas&lt;/strong&gt;,&amp;nbsp;does not use the Silverlight animation engine but rather wires up a timer for behavior similar to WPF's &lt;strong&gt;CompositionTarget.Render&lt;/strong&gt; or Flash's &lt;strong&gt;OnEnterFrame&lt;/strong&gt;.&amp;nbsp; Now, I must admit this code threw me for a loop: &lt;p&gt;&lt;font face="Courier New"&gt;double interval = ((60f / 140f) * 50f);&lt;br&gt;if (HtmlPage.BrowserInformation.Name != "Microsoft Internet Explorer")&lt;br&gt;{&lt;br&gt;&amp;nbsp;interval = interval * 1.461f;&lt;br&gt;}&lt;/font&gt; &lt;p&gt;Why did he have to special case IE when creating his timer? &lt;p&gt;For the spiral effect, he's using some trigonometry to create a new ellipse on each tick in such a way that a spiral is formed. Similarly, on each tick, he rotates the spiral.&amp;nbsp; At a certain point, he zooms and fades it.&amp;nbsp; And, when his other timer hits what is around 6.85 seconds, he yanks it from the &lt;strong&gt;VisualTree&lt;/strong&gt; and inserts &lt;strong&gt;Stroposcope&lt;/strong&gt;, which also is a timer based animation and also subclasses &lt;strong&gt;Canvas&lt;/strong&gt;.&amp;nbsp; Within &lt;strong&gt;Strotoscope&lt;/strong&gt;, he adds three instances of &lt;strong&gt;Ring&lt;/strong&gt;, which is another canvas that is a &amp;nbsp;series of &lt;strong&gt;Ellipse &lt;/strong&gt;objects that he then manipulates, again using trigonometry.&amp;nbsp; There is someother interesting code in there for getting the background to white out at certain points in the animation as far as watching where he is in the timer. &lt;p&gt;All in all, a great piece. The music is so tightly synched with the visuals.&amp;nbsp; Watch and listen closely and you'll see what I mean. Which raises the question: which came first?&amp;nbsp; The animation or the music?&amp;nbsp;&lt;/p&gt; &lt;div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:bf5884de-0673-4c7f-b872-73b533c2e354" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2531904" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>WPF Momentum Video Posted</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/09/wpf-momentum-video-posted.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/09/wpf-momentum-video-posted.aspx</id><published>2007-05-09T21:00:00Z</published><updated>2007-05-09T21:00:00Z</updated><content type="html">&lt;P&gt;I just posted&amp;nbsp;&lt;A class="" href="http://wpf.netfx3.com/files/folders/videos/entry10422.aspx" mce_href="http://wpf.netfx3.com/files/folders/videos/entry10422.aspx"&gt;a high resolution copy of the WPF Momentum video&lt;/A&gt; shown during Ray Ozzie's MIX07 keynote for downloading.&amp;nbsp; If you don't want to take the 32mb download hit, you can always &lt;A class="" href="http://blogs.msdn.com/tims/archive/2007/04/30/wpf-momentum-video.aspx" mce_href="http://blogs.msdn.com/tims/archive/2007/04/30/wpf-momentum-video.aspx"&gt;watch it streamed via Silverlight&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2507064" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>TRANSITION AND REVEAL: NEW CUSTOM CONTROLS FOR WPF, UPDATED AVALON FEATURE FEST</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/08/transition-and-reveal-new-custom-controls-for-wpf-updated-avalon-feature-fest.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/08/transition-and-reveal-new-custom-controls-for-wpf-updated-avalon-feature-fest.aspx</id><published>2007-05-09T04:35:00Z</published><updated>2007-05-09T04:35:00Z</updated><content type="html">&lt;P&gt;Kevin Moore very quietly released a new &lt;A href="http://wpf.netfx3.com/files/folders/controls/entry10297.aspx" mce_href="http://wpf.netfx3.com/files/folders/controls/entry10297.aspx"&gt;bag o' tricks&lt;/A&gt; that has two of the coolest controls for WPF that I've seen in awhile: transition and reveal.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Transition is gnarly: it provides the infrastructure to create a visual transition between any two visuals in WPF.&amp;nbsp; These visuals could be controls, vector graphics, images, 3D or, really, &amp;nbsp;anything.&amp;nbsp; What is nice is that the architecture of the control is extensible, such that you can define a new transition quite easily.&amp;nbsp; There are a bunch of built in transitions, both 2D and 3D. Many of the 2D transitions are modeled after the stock transitions available in Windows Movie Maker.&amp;nbsp; (Some, like Rotate Wipe, remind&amp;nbsp;me of the transitions in Star Wars, A New Hope.)&amp;nbsp; The 3D ones are quite nice and include cloth, page, doors and explode.&lt;/P&gt;
&lt;P&gt;Reveal is also quite powerful.&amp;nbsp; Rather than a transition, it provides animation to reveal something -- anything -- in WPF.&amp;nbsp; This isn't just an opacity fade but rather a directional unveiling. For example, when clicking a treeview item, imagine the item animating in view instead of just appearing.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Both of these controls are the kind of control that allows for people to write "better" UI, in the sense&amp;nbsp;of&amp;nbsp;UI that doesn't just slap the user around, but gracefully moves the user from state to state. Reminds me of the tagline that has been used in association with WPF: "build the UI of your dreams."&lt;/P&gt;
&lt;P&gt;With the importance of using custom controls to create beautiful UI in mind, I implemented these controls in a new version of the Avalon Feature Fest.&amp;nbsp; You can &lt;A href="http://rhizohm.net/download/netfx3/apps/avalonfeaturefest/publish.htm" mce_href="http://rhizohm.net/download/netfx3/apps/avalonfeaturefest/publish.htm"&gt;run it here&lt;/A&gt; (beware it is a 16mb download because of the video.) and &lt;A href="http://rhizohm.net/download/netfx3/avalonfeaturefest.zip" mce_href="http://rhizohm.net/download/netfx3/avalonfeaturefest.zip"&gt;download the source here&lt;/A&gt;. It is a great overview of WPF when giving a presentation and trying to explain what, in fact, WPF is.&amp;nbsp; As such, I added a new section called Custom Controls, where I show off Transition, Reveal and Zap Scroller.&amp;nbsp; The point being: WPF allows you to build incredibly powerful control above and beyond the controls "in the box".&amp;nbsp; The other point: other people are starting to build these controls and the ecosystem will start to thrive with great controls.&amp;nbsp; In fact, at MIX, there were a number of companies announcing just that.&amp;nbsp; And, knowing Kevin, expect more goodies to continue to end up in his bag o' tricks.&lt;/P&gt;
&lt;P&gt;Here's some screenshots from the transition control of good old limecat in the middle of a 3D cloth transition:&lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://winfx.members.winisp.net/images/limecat1.jpg" mce_src="http://winfx.members.winisp.net/images/limecat1.jpg"&gt; &lt;/P&gt;
&lt;P&gt;&lt;IMG src="http://winfx.members.winisp.net/images/limecat2.jpg" mce_src="http://winfx.members.winisp.net/images/limecat2.jpg"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2492157" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>SILVERLIGHT SCREENCASTS, CHICKENS AND DINOSAURS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/05/07/silverlight-screencasts-chickens-and-dinosaurs.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/05/07/silverlight-screencasts-chickens-and-dinosaurs.aspx</id><published>2007-05-08T09:10:05Z</published><updated>2007-05-08T09:10:05Z</updated><content type="html">&lt;div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:c98a2b4b-9bcf-4c4c-9a0e-66b1bf3f0df7" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati tags: &lt;a href="http://technorati.com/tags/silverlight" rel="tag"&gt;silverlight&lt;/a&gt;, &lt;a href="http://technorati.com/tags/expression%20blend" rel="tag"&gt;expression blend&lt;/a&gt;&lt;/div&gt; &lt;p&gt;Tim &lt;a href="http://blogs.msdn.com/tims/archive/2007/04/30/silverlight-screencasts.aspx"&gt;recently posted&lt;/a&gt; a list of all the Silverlight screencasts that are being hosted up on &lt;a href="http://silverlight.net/learn/learnvideos.aspx"&gt;silverlight.net.&lt;/a&gt;&amp;nbsp; I authored &lt;a href="http://silverlight.net/learn/learnvideos.aspx#cat3"&gt;five of them&lt;/a&gt;, all of which are focused on using Blend, which I fall more in love with each passing day.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The first three, which you can find &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=77"&gt;here&lt;/a&gt; and &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=78"&gt;here&lt;/a&gt; and &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=79"&gt;here&lt;/a&gt;, are pretty darned simple, showing different vector drawing tools in Blend and animation techinques in the service of making a vector chicken cluck.&lt;/p&gt; &lt;p&gt;The &lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=75"&gt;fourth&lt;/a&gt;, inspired by&amp;nbsp;the &lt;a href="http://news.bbc.co.uk/2/hi/science/nature/6548719.stm"&gt;recent studies&lt;/a&gt; that have reported the&amp;nbsp;protein links between chickens and T. rex fossils, is not far from a lot of the work up at &lt;a href="http://www.ytmnd.com/"&gt;You're The Man Now Dog&lt;/a&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;I was hoping to post it up at ytmnd.com, but they only allow you to post animated gifs and mp3s.&amp;nbsp; You can see it &lt;a href="http://winfx.members.winisp.net/wpfe/trexchicken/"&gt;here&lt;/a&gt;.&amp;nbsp; (I wish I could embed it in this blog post, but I can't.&amp;nbsp; Bummer.) &lt;/p&gt; &lt;p&gt;&lt;a href="http://winfx.members.winisp.net/wpfe/trexchicken/" atomicselection="true"&gt;&lt;img src="http://silverlight.net/Themes/silverlight/images/learn/video-thumb-75.jpg" border="0"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;&lt;a href="http://silverlight.net/learn/learnvideo.aspx?video=76"&gt;For the last one&lt;/a&gt;, I needed some video content -- what better than footage I took myself ... of chickens. I used the new &lt;a href="http://silverlight.live.com/"&gt;Silverlight streaming service&lt;/a&gt; to host the video.&amp;nbsp; It is a little confusing at first to use the service, as I didn't realize that they were hosting not only the video asset but javascript and xaml as well.&amp;nbsp; Thus, you have to .zip up all the files and include a manifest. Also, if you use Expression Media Encoder, you have to choose a template for your media. If you don't, you won't get all the nifty generated .js files that you need to create a video skin.&amp;nbsp; But once I figured that out, it was pretty simple.&amp;nbsp; You can see the results &lt;a href="http://winfx.members.winisp.net/wpfe/dinochicken/"&gt;here&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href="http://winfx.members.winisp.net/wpfe/dinochicken/" atomicselection="true"&gt;&lt;img src="http://silverlight.net/Themes/silverlight/images/learn/video-thumb-76.jpg" border="0"&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2474955" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry><entry><title>FLITTER: SOURCE POSTED</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/karstenj/archive/2007/04/30/flitter-source-posted.aspx" /><id>http://blogs.msdn.com/karstenj/archive/2007/04/30/flitter-source-posted.aspx</id><published>2007-05-01T07:32:00Z</published><updated>2007-05-01T07:32:00Z</updated><content type="html">&lt;P&gt;(Updated 6/21) -- Please go check out &lt;A href="http://flotzam.com/"&gt;http://flotzam.com&lt;/A&gt; which is the released incarnation of this software! &lt;/P&gt;
&lt;P&gt;I just posted the screen saver source to Flitter &lt;A href="http://winfx.members.winisp.net/blog/flitter.zip" mce_href="http://winfx.members.winisp.net/blog/flitter.zip"&gt;here&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 500px; HEIGHT: 274px" height=274 src="http://farm1.static.flickr.com/174/478585566_2540556de3.jpg" width=500 mce_src="http://farm1.static.flickr.com/174/478585566_2540556de3.jpg"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is now entirely configurable, both for Flickr and Twitter. To install, right click on the .scr file and click Install.&amp;nbsp; Click the settings button from within the screen saver user interface to configure it. This runs ONLY on Windows XP, Windows Server 2003 and Windows Vista.&amp;nbsp; If you are on XP or Server, you'll need to download the .NET Framework: &lt;A href="http://www.microsoft.com/downloads/details.aspx?familyid=10cc340b-f857-4a14-83f5-25634c3bf043&amp;amp;displaylang=en" target=_new rel=nofollow&gt;&lt;FONT color=#32cd32&gt;http://www.microsoft.com/downloads/details.aspx?familyid=10cc340b-f857-4a14-83f5-25634c3bf043&amp;amp;displaylang=en&lt;/FONT&gt;&lt;/A&gt;.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;This is definitely v.0.0.0.1.&amp;nbsp; Please provide feedback, issues, bugs and any thing else that comes to mind.&lt;/P&gt;
&lt;P&gt;Note that I had to pull the Facebook integration (for now) because I am using&amp;nbsp;a .NET wrapper to Facebook that hasn't been released just yet, but it is coming soon...&lt;/P&gt;
&lt;P&gt;I'm using all kinds of other people's code in this:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://developer.yahoo.com/flickr/" mce_href="http://developer.yahoo.com/flickr/"&gt;FlickrNet&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx" mce_href="https://blogs.msdn.com/dancre/archive/2006/10/11/datamodel-view-viewmodel-pattern-series.aspx"&gt;Dan Crevier's data model&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://scorbs.com/2006/12/21/wpf-screen-saver-template/" mce_href="http://scorbs.com/2006/12/21/wpf-screen-saver-template/"&gt;Karen Corby's Screen Saver&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Twitter wrapper by good ole xsd.exe&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;In future posts, I'll go into a little more about how &lt;A class="" href="http://taidlin.com/" mce_href="http://taidlin.com"&gt;Tim Aidlin&lt;/A&gt;, the designer behind this, and I built it.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2350225" width="1" height="1"&gt;</content><author><name>karstenj</name><uri>http://blogs.msdn.com/members/karstenj.aspx</uri></author></entry></feed>