<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://community.irritatedvowel.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>POKE 53280,0: Pete Brown's Blog</title><link>http://community.irritatedvowel.com/blogs/pete_browns_blog/default.aspx</link><description>Silverlight, WPF, Windows Client Development, Woodworking, .NET Programming, CNC, Nature, and other topics.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 (Build: 60809.935)</generator><geo:lat>39.004</geo:lat><geo:long>-76.65264</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><image><link>http://www.irritatedVowel.com/blog</link><url>http://www.irritatedvowel.com/pub/blog/pete_brown_headshot_144x144.jpg</url><title>Pete Brown</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Getting Camtasia to work with the E-MU 1616 Sound Card</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/EN51V1XxA5s/Getting-Camtasia-to-work-with-the-E_2D00_MU-1616-Sound-Card.aspx</link><pubDate>Sat, 07 Nov 2009 05:51:04 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:4038</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>6</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/4038.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=4038</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=4038</wfw:comment><description>&lt;p&gt;I just got sound working in my C64 emulator and I wanted to record a short WMV of M.U.L.E. to send to a few friends, but couldn’t figure out how to get sound recorded. I just tonight got both M.U.L.E. &lt;strong&gt;and&lt;/strong&gt; sound working, so I just had to let people know :)&lt;/p&gt;  &lt;p&gt;If you have a usb headset soundcard, you’re generally out of luck. You can’t record that sound as nothing is coming “back” to the PC.&lt;/p&gt;  &lt;p&gt;However, I also have a pro sound card, used mostly for ASIO stuff, MIDI, and recording. It’s an EMU 1616 PCI card with an external box. It has a boatload of inputs, as well as MIDI in/out. Cost me half a leg when I bought it, so I get annoyed if it won’t do every last thing I demand of it :)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb.png" width="239" height="167" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Anyway, couldn’t get Camtasia to pick up the audio for that until I started playing with the sound card’s mixing software.&lt;/p&gt;  &lt;p&gt;It’s pretty simple once you get down to it:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Open up PatchMix DSP&lt;/li&gt;    &lt;li&gt;Make sure you have a strip for Wave 1 / 2 in there – the default wave source on your computer&lt;/li&gt;    &lt;li&gt;Crank up its aux 1 send to zero (the knob below all the inserts)&lt;/li&gt;    &lt;li&gt;Over on the right, insert the WAVE/WDM (Camtasia doesn’t use ASIO) send to Aux 1, and make sure you have the volume up.&lt;/li&gt;    &lt;li&gt;In Camtasia recorder, pick the E-MU 1616 device as the audio source.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_3.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_3.png" width="350" height="421" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Right-click the Aux 1 insert (where it says Send in the shot above) and you’ll get this menu:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_4.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_4.png" width="303" height="287" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Pick the Wave L / R and ok the dialog.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_5.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_5.png" width="289" height="521" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Verify by clicking the Send insert. You should see this&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_6.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_6.png" width="273" height="305" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;You may need to lower the master volume to a reasonable level, but other than that, you’re good.&lt;/p&gt;  &lt;p&gt;Viola! Now I can record the awesome &lt;a href="http://en.wikipedia.org/wiki/MOS_Technology_SID" target="_blank"&gt;SID&lt;/a&gt; music from my emulator :)&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_7.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_7.png" width="250" height="177" /&gt;&lt;/a&gt; &lt;a href="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_8.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/GettingCamtasiatoworkwiththeEMU1616Sound_7F5/image_thumb_8.png" width="250" height="177" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=4038" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=EN51V1XxA5s:VOhvG0RjvQo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=EN51V1XxA5s:VOhvG0RjvQo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=EN51V1XxA5s:VOhvG0RjvQo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=EN51V1XxA5s:VOhvG0RjvQo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=EN51V1XxA5s:VOhvG0RjvQo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=EN51V1XxA5s:VOhvG0RjvQo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=EN51V1XxA5s:VOhvG0RjvQo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=EN51V1XxA5s:VOhvG0RjvQo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/EN51V1XxA5s" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Blogging/default.aspx">Blogging</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Commodore/default.aspx">Commodore</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Video/default.aspx">Video</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/11/07/Getting-Camtasia-to-work-with-the-E_2D00_MU-1616-Sound-Card.aspx</feedburner:origLink></item><item><title>Creating Custom Easing Functions in WPF 4 (and Silverlight)</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/6ezZpdip3z8/Creating-Custom-Easing-Functions-in-WPF-4-_2800_and-Silverlight_2900_.aspx</link><pubDate>Wed, 04 Nov 2009 21:59:00 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:4022</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>6</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/4022.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=4022</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=4022</wfw:comment><description>&lt;p&gt;In a &lt;a href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/27/Easing-Functions-in-WPF-4-_2800_and-Silverlight_2900_.aspx" target="_blank"&gt;previous post&lt;/a&gt; and video, I went through how to use the stock easing functions in your &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; 4 applications. Now, let&amp;rsquo;s look at how to create your own easing functions.&lt;/p&gt;&lt;p&gt;Once you know the formula you want to use, the mechanics of creating custom easing functions is pretty simple.&lt;/p&gt;&lt;h2&gt;Example Project&lt;/h2&gt;&lt;p&gt;We&amp;rsquo;ll use something almost identical to what was used in the easing function post and video. Create a standard WPF project, and set up the MainWindow so it looks like this:&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/CreatingCustomEasingFunctionsinWPF4_E9A9/image.png" target="_blank"&gt;&lt;img alt="image" border="0" height="167" src="http://www.irritatedvowel.com/pub/blog/CreatingCustomEasingFunctionsinWPF4_E9A9/image_thumb.png" style="margin:5px;display:inline;border:0px;" title="image" width="222" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;Here&amp;rsquo;s the xaml&lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;Window x:Class=&amp;quot;CustomEasingDemo.MainWindow&amp;quot;
        xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
        xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
        Title=&amp;quot;MainWindow&amp;quot; Height=&amp;quot;600&amp;quot; Width=&amp;quot;825&amp;quot;&amp;gt;
    &amp;lt;Window.Resources&amp;gt;
        &amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
            &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                           Storyboard.TargetProperty=&amp;quot;X&amp;quot;&amp;gt;
                &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                                      Value=&amp;quot;0.0&amp;quot; /&amp;gt;
                &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                                      Value=&amp;quot;202.0&amp;quot;&amp;gt;
                    &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                        &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                                     Oscillations=&amp;quot;3&amp;quot;
                                     Springiness=&amp;quot;8&amp;quot; /&amp;gt;
                    &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;/EasingDoubleKeyFrame&amp;gt;
            &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
            &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                           Storyboard.TargetProperty=&amp;quot;Y&amp;quot;&amp;gt;
                &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                                      Value=&amp;quot;0.0&amp;quot; /&amp;gt;
                &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                                      Value=&amp;quot;202.0&amp;quot;&amp;gt;
                    &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                        &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                                     Oscillations=&amp;quot;3&amp;quot;
                                     Springiness=&amp;quot;8&amp;quot; /&amp;gt;
                    &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;/EasingDoubleKeyFrame&amp;gt;
            &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
        &amp;lt;/Storyboard&amp;gt;
    &amp;lt;/Window.Resources&amp;gt;

    &amp;lt;Grid&amp;gt;
        &amp;lt;Rectangle Height=&amp;quot;20&amp;quot;
                   Width=&amp;quot;20&amp;quot;
                   RenderTransformOrigin=&amp;quot;0.5,0.5&amp;quot;
                   Fill=&amp;quot;BlueViolet&amp;quot;&amp;gt;
            &amp;lt;Rectangle.RenderTransform&amp;gt;
                &amp;lt;TranslateTransform x:Name=&amp;quot;Transform&amp;quot; /&amp;gt;
            &amp;lt;/Rectangle.RenderTransform&amp;gt;
        &amp;lt;/Rectangle&amp;gt;

        &amp;lt;Button x:Name=&amp;quot;StartAnimation&amp;quot;
                Click=&amp;quot;StartAnimation_Click&amp;quot;
                Content=&amp;quot;Start&amp;quot;
                Width=&amp;quot;100&amp;quot;
                Height=&amp;quot;40&amp;quot;
                HorizontalAlignment=&amp;quot;Center&amp;quot;
                VerticalAlignment=&amp;quot;Bottom&amp;quot;
                Margin=&amp;quot;5&amp;quot; /&amp;gt;
    &amp;lt;/Grid&amp;gt;

&amp;lt;/Window&amp;gt;&lt;/pre&gt;&lt;p&gt;And here&amp;rsquo;s the code-behind&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
    }

    private void StartAnimation_Click(object sender, RoutedEventArgs e)
    {
        ((Storyboard)this.Resources[&amp;quot;AnimateTarget&amp;quot;]).Begin();
    }
}&lt;/pre&gt;&lt;p&gt;If you run that project, you&amp;rsquo;ll see how the ElasticEase works on the position of the cube. We&amp;rsquo;ll replace that elastic ease with a function of our own.&lt;/p&gt;&lt;h2&gt;Custom Easing Basics&lt;/h2&gt;&lt;p&gt;The WPF and &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; teams put together a pretty comprehensive set of standard easing functions. Most folks will never need or want to write one of their own. &lt;/p&gt;&lt;p&gt;That said, you may come up with a specialized function and want to package that in a way that enables others to use it from xaml or code in their own animation.&lt;/p&gt;&lt;p&gt;To create your own easing function, you derive from EasingFunctionBase and override both EaseInCore and CreateInstanceCore.&lt;/p&gt;&lt;h3&gt;EasingFunctionBase.CreateInstanceCore&lt;/h3&gt;&lt;p&gt;This method is WPF-specific, and wouldn&amp;rsquo;t be used in Silverlight as Silverlight has no concept of Freezables. In WPF, this function is used to return a new instance of the Freezable class.&lt;/p&gt;&lt;h3&gt;EasingFunctionBase.EaseInCore&lt;/h3&gt;&lt;p&gt;This is where your easing code goes. You provide the implementation for EaseIn, and the runtime will figure out how to derive EaseOut and EaseInOut.&lt;/p&gt;&lt;p&gt;EaseInCore takes a double representing normalized time, and expects you to return the progress for that point in time. If you think of time as the x-axis on a graph and progress as the y-axis, you&amp;rsquo;re taking in x and returning y.&lt;/p&gt;&lt;p&gt;A standard linear ease would return the value passed in. f(x) = x . Instantaneous movement would be f(x) = 1. No movement (ever) would be f(x) = 0. The interesting stuff happens when the result is between those numbers.&lt;/p&gt;&lt;h2&gt;Custom Easing Functions&lt;/h2&gt;&lt;p&gt;I created two simple easing functions to demonstrate the process. If you come up with your own functions (that are more useful than these) comment here and let us know about them.&lt;/p&gt;&lt;h3&gt;PowerOfSixEase&lt;/h3&gt;&lt;p&gt;Here&amp;rsquo;s the code for a simple &amp;ldquo;Power of 6&amp;rdquo; ease. This uses the built-in math library and simply calls the Pow function on the normalized time.&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;class PowerOfSixEase : EasingFunctionBase
{
    protected override double EaseInCore(double normalizedTime)
    {
        return Math.Pow(normalizedTime, 6);
    }

    protected override System.Windows.Freezable CreateInstanceCore()
    {
        return new PowerOfSixEase();
    }
}&lt;/pre&gt;&lt;p&gt;To use this in xaml, we first need to set up a namespace to refer to our local code.&lt;/p&gt;&lt;pre class="brush: xml;"&gt;xmlns:local=&amp;quot;clr-namespace:CustomEasingDemo&amp;quot;&lt;/pre&gt;&lt;p&gt;Then replace the ElasticEase with our own function&lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
    &amp;lt;local:PowerOfSixEase EasingMode=&amp;rdquo;EaseIn&amp;rdquo;/&amp;gt;
&amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;&lt;/pre&gt;&lt;p&gt;When you run it, you see the block move smoothly to the right bottom, but with a delay while the numbers build up enough to actually move the block. Of course, we could simply have used the built-in PowerEase and supplied a parameter of 6, but that wouldn&amp;rsquo;t have demonstrated creating your own function.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/CreatingCustomEasingFunctionsinWPF4_E9A9/image_3.png" target="_blank"&gt;&lt;img alt="Using a static image to show an example of easing is ... clever :)" border="0" height="167" src="http://www.irritatedvowel.com/pub/blog/CreatingCustomEasingFunctionsinWPF4_E9A9/image_thumb_3.png" style="margin:5px;display:inline;border:0px;" title="Using a static image to show an example of easing is ... clever :)" width="228" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;RandomEase&lt;/h3&gt;&lt;p&gt;Now let&amp;rsquo;s try something a little crazier. Why not return a random number? At the same time, let&amp;rsquo;s see how to add parameters to the easing function.&lt;/p&gt;&lt;pre class="brush: csharp;"&gt;class RandomEase : EasingFunctionBase
{
    Random _random;

    public RandomEase() 
        : base()
    {
        _random = new Random();
    }

    private int _seed;
    public int Seed
    {
        get { return _seed; }
        set { _seed = value; _random = new Random(value); }
    }

    private int _randomness = 5;
    public int Randomness
    {
        get { return _randomness; }
        set { _randomness = value; }
    }
    

    protected override double EaseInCore(double normalizedTime)
    {
        return ((double)_random.Next(-10000, 10000) / 10000) * (double)_randomness/100 + normalizedTime;
    }

    protected override System.Windows.Freezable CreateInstanceCore()
    {
        return new RandomEase();
    }
}&lt;/pre&gt;&lt;p&gt;We&amp;rsquo;ll use different easing function parameters for X and Y. The Seed parameter provides the seed to the random number generator. The Randomness parameter helps control how wild the jittering is. A low number like 1 just looks like choppy animation. After about 2-4, it jitters, and a number like 100 animates all over the map.&lt;/p&gt;&lt;p&gt;The Seed doesn&amp;rsquo;t do much other than demonstrate using a parameter (and let me work in some trivia-based numbers *)&lt;/p&gt;&lt;pre class="brush: xml;"&gt;&amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;X&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;202.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;local:RandomEase EasingMode=&amp;quot;EaseIn&amp;quot; Seed=&amp;quot;3263827&amp;quot; Randomness=&amp;quot;100&amp;quot;/&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;Y&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;202.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;local:RandomEase EasingMode=&amp;quot;EaseIn&amp;quot; Seed=&amp;quot;8675309&amp;quot; Randomness=&amp;quot;5&amp;quot;/&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
&amp;lt;/Storyboard&amp;gt;&lt;/pre&gt;&lt;p&gt;* 3263827 was the Novell Netware IPX address of the server for the first network I ever set up. Given the junk files that people put on that box, the number was fitting :)&lt;/p&gt;&lt;p&gt;That&amp;rsquo;s it for creating your own easing functions. As you can see, the hardest part is coming up with a formula that represents some interesting movement, and hasn&amp;rsquo;t already been included in the base class library. The plumbing code itself couldn&amp;rsquo;t get much simpler.&lt;/p&gt;&lt;p&gt;Source code and a video version of this example will be up on &lt;a href="http://windowsclient.net" target="_blank"&gt;windowsclient.net&lt;/a&gt; soon. I&amp;rsquo;ll update this post with links at that time.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=4022" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=6ezZpdip3z8:g1JZvtvPqtg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=6ezZpdip3z8:g1JZvtvPqtg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=6ezZpdip3z8:g1JZvtvPqtg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=6ezZpdip3z8:g1JZvtvPqtg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=6ezZpdip3z8:g1JZvtvPqtg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=6ezZpdip3z8:g1JZvtvPqtg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=6ezZpdip3z8:g1JZvtvPqtg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=6ezZpdip3z8:g1JZvtvPqtg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/6ezZpdip3z8" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/11/04/Creating-Custom-Easing-Functions-in-WPF-4-_2800_and-Silverlight_2900_.aspx</feedburner:origLink></item><item><title>Windows 7 Bootcamp at PDC 09</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/rTo1KgHlA9o/Windows-7-Bootcamp-at-PDC-09.aspx</link><pubDate>Tue, 03 Nov 2009 17:35:28 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:4016</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>0</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/4016.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=4016</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=4016</wfw:comment><description>&lt;p&gt;There are still a few seats left for the FREE Windows 7 Developer Bootcamp the day before PDC09 officially starts.&lt;/p&gt;  &lt;p&gt;If you are developing for Windows using C++, &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt;, &lt;a href="http://www.windowsclient.net" target="_blank"&gt;Windows Forms&lt;/a&gt; or &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt;, this is a can’t-miss opportunity.&lt;/p&gt;  &lt;p&gt;I’ve been playing with a number of the new Windows 7 APIs (especially the sensors and touch). There’s a ton of stuff in there that can be used in applications ranging from packaged products to your typical windows line-of-business application. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://microsoftpdc.com/WhatsHappening/FREE-Windows-7-Developer-Boot-Camp-Nov-16" target="_blank"&gt;Register Here&lt;/a&gt;.&amp;#160; &lt;a href="http://blogs.msdn.com/jaimer/archive/2009/10/21/learn-network-with-mvps-and-have-fun-at-the-windows-7-boot-camp.aspx" target="_blank"&gt;Agenda and Schedule Here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;I’ll be there. Hope to see you there too :)&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=4016" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=rTo1KgHlA9o:zi1ByhQzEZI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=rTo1KgHlA9o:zi1ByhQzEZI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=rTo1KgHlA9o:zi1ByhQzEZI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=rTo1KgHlA9o:zi1ByhQzEZI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=rTo1KgHlA9o:zi1ByhQzEZI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=rTo1KgHlA9o:zi1ByhQzEZI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=rTo1KgHlA9o:zi1ByhQzEZI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=rTo1KgHlA9o:zi1ByhQzEZI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/rTo1KgHlA9o" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/11/03/Windows-7-Bootcamp-at-PDC-09.aspx</feedburner:origLink></item><item><title>The Win7 Sensor and Location API Part 2: Accelerometer as a Joystick</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/i8doZv4BklQ/The-Win7-Sensor-and-Location-API-Part-2_3A00_-Accelerometer-as-a-Joystick.aspx</link><pubDate>Sun, 01 Nov 2009 23:29:24 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:4012</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>1</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/4012.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=4012</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=4012</wfw:comment><description>&lt;p&gt;This is part 2 of a series. If you don’t yet have the Freescale board configured and tested with Windows 7, please refer to &lt;a href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/29/The-Win7-Sensor-and-Location-API-Part-1_3A00_-Introduction-and-Freescale-Board-Setup-and-Testing.aspx" target="_blank"&gt;Part 1&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Now that we have the Freescale board working, I thought it would be fun to play with the accelerometer. In this post, I’ll show how to use the accelerometer on the board as a traditional 4 or 8 position joystick.&lt;/p&gt;  &lt;h2&gt;API Choices&lt;/h2&gt;  &lt;p&gt;There are three different ways you can use the accelerometer API. You can, of course, go directly against the COM API and generate you own wrappers and pinvokes. You can use the managed wrappers provided in the SDK, or you can use the &lt;a href="http://code.msdn.microsoft.com/WindowsAPICodePack" target="_blank"&gt;Windows API Code Pack&lt;/a&gt; which includes support for the sensor API and a number of other Windows 7-specific enhancements.&lt;/p&gt;  &lt;p&gt;In this case, I decided to use the code pack in concert with &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; 4.&lt;/p&gt;  &lt;h2&gt;Solution Structure&lt;/h2&gt;  &lt;p&gt;I intend to use the joystick functionality in another project, so I am wrapping that into a separate project. I also added just the sensor project from the Windows API Code Pack. You have a few choices there, including compiling the whole code pack as a separate assembly and simply referencing it. I decided to include only the bare minimum of assemblies required to support the example.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image_thumb.png" width="292" height="612" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;PeteBrown.Accelerometer is the reusable Accelerometer joystick class lib. The “Sensors” project is the Windows API Code Pack sensors project. The “Core” project is the required Windows API Code Pack core project&lt;/p&gt;  &lt;h2&gt;Sample Code&lt;/h2&gt;  &lt;p&gt;One great thing about the Windows API Code Pack is it includes a ton of example code. It just so happens that the accelerometer code is included in that.&lt;/p&gt;  &lt;h2&gt;Application Code&lt;/h2&gt;  &lt;p&gt;Typically I’m a binding fiend. I like to set up notification in my classes and just let binding handle all the dirty work. In this case, though, I wanted to go with a model that would work better in apps that used a type of GameLoop and instead of responding to events or binding, simply polled all input devices on an interval of their own design. For that reason, I’m using simple properties in this class, am not implementing INotifyPropertyChanged, and did not chose to raise any events.&lt;/p&gt;  &lt;p&gt;If you’re a game programmer, or have that type of background, this decision probably won’t surprise you at all.&lt;/p&gt;  &lt;h3&gt;AccelerometerJoystick Class&lt;/h3&gt;  &lt;p&gt;The core class is the AccelerometerJoystick class. &lt;/p&gt;  &lt;p&gt;I snagged some of the code right out of the Accelerometer sample from the code pack. One of the methods I borrowed and then messed with a bit was the Initialize method (called HookUpAccelerometer in the sample code). I changed it to only report X and Y, and to use an &lt;a href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/03/30/Silverlight-3-Quick-Tip-_3A00_-Lambda-Expressions-for-Async-Web-Service-Calls.aspx" target="_blank"&gt;inline lambda event handler&lt;/a&gt; to cut down on code.&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;public void Initialize()
{
    SensorList&amp;lt;Accelerometer3D&amp;gt; sl = SensorManager.GetSensorsByTypeId&amp;lt;Accelerometer3D&amp;gt;();

    if (sl.Count &amp;gt; 0)
    {
        Accelerometer3D accel = sl[0];
        accel.AutoUpdateDataReport = true;
        accel.DataReportChanged += (s, e) =&amp;gt;
            {
                _rawXValue = accel.CurrentAcceleration[AccelerationAxis.X];
                _rawYValue = accel.CurrentAcceleration[AccelerationAxis.Y];
            };
    }
}&lt;/pre&gt;

&lt;p&gt;The code finds the first accelerometer and then wires up the DataReportChanged event to catch changes in the X/Y values in the accelerometer. I don’t call Initialize from the constructor, as it may throw an exception. Instead, I have the using code call it explicitly. I may change that &lt;/p&gt;

&lt;p&gt;I first tested by watching the raw values on a regular interval. The raw values are two simple properties on the same class:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;private float _rawXValue;
public float RawXValue
{
    get { return _rawXValue; }
}

private float _rawYValue;
public float RawYValue
{
    get { return _rawYValue; }
}&lt;/pre&gt;

&lt;p&gt;Once I had the values set, and they made sense to me, I implemented properties to report the direction the accelerometer is pointing.&lt;/p&gt;

&lt;p&gt;There were a couple different ways I could have gone here. I could have created a N, S, E, W enum, and had a single method that reported which direction the mouse was pointed. However, to support NW, NE, SW, SE, I’d have to add four more branches to that code and four more enum members.&lt;/p&gt;

&lt;p&gt;I think it is more flexible to simply report true/false for each of the four cardinal directions, and let the calling code decide how to handle it from there. So, that’s the way I went.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public bool IsJoystickPointedNorth
{
    get { return RoundValue(_rawYValue) &amp;gt; 0; }
}

public bool IsJoystickPointedSouth
{
    get { return RoundValue(_rawYValue) &amp;lt; 0; }
}

public bool IsJoystickPointedWest
{
    get { return RoundValue(_rawXValue) &amp;lt; 0; }
}

public bool IsJoystickPointedEast
{
    get { return RoundValue(_rawXValue) &amp;gt; 0; }
}


private int RoundValue(float value)
{
    return (int)Math.Round((double)value, 0);

    // example making the joystick more sensitive
    // return Math.Abs(value) &amp;gt; 0.25 ? 1 * Math.Sign(value) : 0;
}&lt;/pre&gt;

&lt;p&gt;A note on rounding: If you want to change the sensitivity, which you probably will, change the RoundValue method so that instead of using Math.Round, it does a check to see if the ABS of the value is, say, greater than 0.25 and return 1. That way you can have the joystick be a bit more sensitive to movement. Similarly, you can change it to return 1 only if the ABS of the value is greater than 0.75 for less sensitivity. Try it out to see how you prefer it.&lt;/p&gt;

&lt;h3&gt;MainWindow.xaml&lt;/h3&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image_3.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image_thumb_3.png" width="240" height="161" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;The main window is pretty simple. I have a space in the middle where I report the raw X/Y values, and then four rectangles which light up (red in this case) when the joystick is pointed in that direction.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Window x:Class=&amp;quot;WpfAccelerometerApp.MainWindow&amp;quot;
        xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
        xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
        Title=&amp;quot;MainWindow&amp;quot; Height=&amp;quot;350&amp;quot; Width=&amp;quot;525&amp;quot;&amp;gt;
    
    &amp;lt;Window.Resources&amp;gt;
        &amp;lt;SolidColorBrush x:Key=&amp;quot;ActiveDirectionBrush&amp;quot;
                         Color=&amp;quot;Red&amp;quot; /&amp;gt;
        &amp;lt;SolidColorBrush x:Key=&amp;quot;InactiveDirectionBrush&amp;quot;
                         Color=&amp;quot;Gray&amp;quot; /&amp;gt;
    &amp;lt;/Window.Resources&amp;gt;
    
    
    &amp;lt;Grid&amp;gt;
        &amp;lt;Grid.ColumnDefinitions&amp;gt;
            &amp;lt;ColumnDefinition Width=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;ColumnDefinition Width=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;ColumnDefinition Width=&amp;quot;*&amp;quot; /&amp;gt;
        &amp;lt;/Grid.ColumnDefinitions&amp;gt;
        &amp;lt;Grid.RowDefinitions&amp;gt;
            &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
        &amp;lt;/Grid.RowDefinitions&amp;gt;

        &amp;lt;Rectangle x:Name=&amp;quot;North&amp;quot;
                   Grid.Row=&amp;quot;0&amp;quot;
                   Grid.Column=&amp;quot;1&amp;quot;
                   Margin=&amp;quot;20&amp;quot;/&amp;gt;

        &amp;lt;Rectangle x:Name=&amp;quot;South&amp;quot;
                   Grid.Row=&amp;quot;2&amp;quot;
                   Grid.Column=&amp;quot;1&amp;quot;
                   Margin=&amp;quot;20&amp;quot; /&amp;gt;

        &amp;lt;Rectangle x:Name=&amp;quot;East&amp;quot;
                   Grid.Row=&amp;quot;1&amp;quot;
                   Grid.Column=&amp;quot;2&amp;quot;
                   Margin=&amp;quot;20&amp;quot; /&amp;gt;

        &amp;lt;Rectangle x:Name=&amp;quot;West&amp;quot;
                   Grid.Row=&amp;quot;1&amp;quot;
                   Grid.Column=&amp;quot;0&amp;quot;
                   Margin=&amp;quot;20&amp;quot; /&amp;gt;
        
        &amp;lt;Grid Grid.Row=&amp;quot;1&amp;quot; Grid.Column=&amp;quot;1&amp;quot;&amp;gt;
            &amp;lt;Grid.ColumnDefinitions&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;*&amp;quot; /&amp;gt;
                &amp;lt;ColumnDefinition Width=&amp;quot;2*&amp;quot; /&amp;gt;
            &amp;lt;/Grid.ColumnDefinitions&amp;gt;
            &amp;lt;Grid.RowDefinitions&amp;gt;
                &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
                &amp;lt;RowDefinition Height=&amp;quot;*&amp;quot; /&amp;gt;
            &amp;lt;/Grid.RowDefinitions&amp;gt;

            &amp;lt;TextBlock Text=&amp;quot;X&amp;quot;
                       Grid.Row=&amp;quot;0&amp;quot;
                       Grid.Column=&amp;quot;0&amp;quot; /&amp;gt;

            &amp;lt;TextBlock Text=&amp;quot;Y&amp;quot;
                       Grid.Row=&amp;quot;1&amp;quot;
                       Grid.Column=&amp;quot;0&amp;quot; /&amp;gt;

            &amp;lt;TextBlock x:Name=&amp;quot;xValue&amp;quot; 
                       Text=&amp;quot;0&amp;quot;
                       Grid.Row=&amp;quot;0&amp;quot;
                       Grid.Column=&amp;quot;1&amp;quot; /&amp;gt;

            &amp;lt;TextBlock x:Name=&amp;quot;yValue&amp;quot; 
                       Text=&amp;quot;0&amp;quot;
                       Grid.Row=&amp;quot;1&amp;quot;
                       Grid.Column=&amp;quot;1&amp;quot; /&amp;gt;
        
        &amp;lt;/Grid&amp;gt;
    &amp;lt;/Grid&amp;gt;
&amp;lt;/Window&amp;gt;&lt;/pre&gt;

&lt;p&gt;There’s nothing WPF-specific about this app other than the specific timer I use below, and the use of xaml in the window. If you code in &lt;a href="http://www.windowsclient.net" target="_blank"&gt;Windows forms&lt;/a&gt; or another client technology, you should be able to port this pretty easily.&lt;/p&gt;

&lt;h3&gt;MainWindow.xaml.cs&lt;/h3&gt;

&lt;p&gt;Here’s the code-behind for the main window. First, I keep two private member variables, one for the joystick and one for the DispatcherTimer I use to poll the joystick (again, because I’m going with a gameloop-type approach rather than event-driven. In my other app, the joystick poll is actually one step in a big loop)&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;private AccelerometerJoystick _joystick = new AccelerometerJoystick();
private DispatcherTimer _timer = new DispatcherTimer();&lt;/pre&gt;

&lt;p&gt;The constructor simply does the usual initialization, and then wires up the loaded event. I tend to do significant work in Loaded events to avoid race conditions with controls not being ready yet, and to avoid exceptions in constructors. It’s not a bad habit to be in.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public MainWindow()
{
    InitializeComponent();

    Loaded += new RoutedEventHandler(MainWindow_Loaded);
}&lt;/pre&gt;

&lt;p&gt;The MainWindow_Loaded event handler is where I’m doing the dirty work. In here, I first initialize the joystick, then start the timer. The timer’s tick event is handled as an inline lanbda event handler. That handler polls the joystick, updates the display values and then sets the brush used by the rectangles based on whether or not the joystick reports that it is pointed in that direction.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    _joystick.Initialize();


    _timer.Interval = TimeSpan.FromMilliseconds(PollingIntervalMilliseconds);
    _timer.Start();

    _timer.Tick += (s, ea) =&amp;gt;
        {
            // display position
            xValue.Text = _joystick.RawXValue.ToString();
            yValue.Text = _joystick.RawYValue.ToString();

            Brush ActiveBrush = (Brush)this.Resources[&amp;quot;ActiveDirectionBrush&amp;quot;];
            Brush InactiveBrush = (Brush)this.Resources[&amp;quot;InctiveDirectionBrush&amp;quot;];

            if (_joystick.IsJoystickPointedSouth)
                South.Fill = ActiveBrush;
            else
                South.Fill = InactiveBrush;

            if (_joystick.IsJoystickPointedWest)
                West.Fill = ActiveBrush;
            else
                West.Fill = InactiveBrush;

            if (_joystick.IsJoystickPointedNorth)
                North.Fill = ActiveBrush;
            else
                North.Fill = InactiveBrush;

            if (_joystick.IsJoystickPointedEast)
                East.Fill = ActiveBrush;
            else
                East.Fill = InactiveBrush;
        };
}&lt;/pre&gt;

&lt;h2&gt;Runtime&lt;/h2&gt;

&lt;p&gt;At runtime, the directions light up as expected, and the raw X and Y values are displayed in the middle. Now to use this in a real application :)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image_4.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorandLocationAPIPart2Accelero_4BE/image_thumb_4.png" width="400" height="276" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;The source code and a video walkthrough of this will be available on &lt;a href="http://windowsclient.net" target="_blank"&gt;windowsclient.net&lt;/a&gt; soon. I’ll update this post with the link once that happens.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=4012" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=i8doZv4BklQ:OWzie-mXcWA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=i8doZv4BklQ:OWzie-mXcWA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=i8doZv4BklQ:OWzie-mXcWA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=i8doZv4BklQ:OWzie-mXcWA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=i8doZv4BklQ:OWzie-mXcWA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=i8doZv4BklQ:OWzie-mXcWA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=i8doZv4BklQ:OWzie-mXcWA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=i8doZv4BklQ:OWzie-mXcWA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/i8doZv4BklQ" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/XNA/default.aspx">XNA</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/11/01/The-Win7-Sensor-and-Location-API-Part-2_3A00_-Accelerometer-as-a-Joystick.aspx</feedburner:origLink></item><item><title>Showing Progress in the Windows 7 Taskbar with WPF 4 (and a short romp through Windows 7 cleartype settings)</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/jRajZ9Hn_78/Showing-Progress-in-the-Windows-7-Taskbar-with-WPF-4-_2800_and-a-short-romp-through-Windows-7-cleartype-settings_2900_.aspx</link><pubDate>Fri, 30 Oct 2009 03:25:10 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:4004</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>8</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/4004.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=4004</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=4004</wfw:comment><description>&lt;p&gt;Have you ever copied a large number of files, or downloaded something big using IE? If so, you’ve probably seen the taskbar download progress indicator. This is a green progress bar that fills the area behind the application icon in the taskbar.&lt;/p&gt;  &lt;p&gt;You can achieve the same effect in Windows 7 using .NET 4, with very little code. Let’s run through how.&lt;/p&gt;  &lt;h2&gt;Project Setup&lt;/h2&gt;  &lt;p&gt;I created a simple &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; application in Visual Studio 2010. Nothing fancy, I kept the original MainWindow and simply worked with that. I named the project “Win7ProgressBar”.&lt;/p&gt;  &lt;p&gt;Next I added an icon to the project. I have a C64 logo icon I created for my &lt;a href="http://silverlightc64.codeplex.com/" target="_blank"&gt;Silverlight C64 emulator&lt;/a&gt; handy, so I used that.&lt;/p&gt;  &lt;h2&gt;MainWindow&lt;/h2&gt;  &lt;p&gt;I resized the main window to be a little smaller, gave it the title “Long Task” and assigned the icon to it. The resulting opening tag looks like this:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;Window x:Class=&amp;quot;Win7ProgressBar.MainWindow&amp;quot;
        xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
        xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
        Title=&amp;quot;Long Task&amp;quot; Height=&amp;quot;241&amp;quot; Width=&amp;quot;432&amp;quot;
        Icon=&amp;quot;/Win7ProgressBar;component/AppIcon032.png&amp;quot;&amp;gt;&lt;/pre&gt;

&lt;p&gt;Next, I added a progress bar and a textblock to the window:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;ProgressBar Height=&amp;quot;23&amp;quot;
                 HorizontalAlignment=&amp;quot;Left&amp;quot;
                 Margin=&amp;quot;36,88,0,0&amp;quot;
                 Name=&amp;quot;progressBar1&amp;quot;
                 VerticalAlignment=&amp;quot;Top&amp;quot;
                 Width=&amp;quot;334&amp;quot; /&amp;gt;
    &amp;lt;TextBlock Height=&amp;quot;23&amp;quot;
               HorizontalAlignment=&amp;quot;Left&amp;quot;
               Margin=&amp;quot;36,24,0,0&amp;quot;
               Name=&amp;quot;textBlock1&amp;quot;
               Text=&amp;quot;This is a really long-running task&amp;quot;
               VerticalAlignment=&amp;quot;Top&amp;quot;
               Width=&amp;quot;201&amp;quot; /&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;Here’s how the window looks in the VS2010 designer.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb.png" width="462" height="265" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;So far so good. I have a window and a progress bar, but no activity, and nothing that would as yet hook it up to the taskbar.&lt;/p&gt;

&lt;p&gt;Taskbar wireup isn’t automatic; it’s something you need to opt into. You can do it in xaml, and you can do it in code. I used a mixture of both for this example. Since we still have the window xaml open, let’s put that in there now. &lt;/p&gt;

&lt;p&gt;Right after the opening tag for the window, and before the opening grid tag, add in this snip:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Window.TaskbarItemInfo&amp;gt;
    &amp;lt;TaskbarItemInfo /&amp;gt;
&amp;lt;/Window.TaskbarItemInfo&amp;gt;&lt;/pre&gt;

&lt;p&gt;That simply news up a TasbarItemInfo class for us. If you look at the TasbarItemInfo tag, you’ll see there’s quite a bit more you can do right from within xaml. But I always do everything in xaml, so let’s try some code instead :)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_3.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_3.png" width="482" height="322" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;An aside on ClearType&lt;/h3&gt;

&lt;p&gt;The rather ugly font in the drop down is due to the settings on the monitor on which I took this shot (I have three displays). I need to readjust my cleartype settings for that display. If you have crappy-looking fonts in apps, you can simply go to Control Panel –&amp;gt; Fonts and then select the option to adjust the cleartype settings on your monitor.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_4.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_4.png" width="240" height="163" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Run through the wizard and answer the questions for which one looks best. You’re better off not thinking and simply acting. The more you think about the answer, the less accurate you’ll be. Go with your first impressions.&lt;/p&gt;

&lt;p&gt;By way of comparison, here’s the same thing, only snapped from my primary monitor, with good cleartype settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_5.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_5.png" width="487" height="325" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Notice the massive difference in the drop-down list? If not, scroll back up and look again.&lt;/p&gt;

&lt;p&gt;Now, most people won’t have to go through that wizard unless they get a drastically different display from what they started with. I needed to simply because I tested a special build of SL3 before it went live, and was specifically asked to look at the cleartype rendering. I played with the wizard and forgot to go back and fix it :) &lt;/p&gt;

&lt;h3&gt;Back to the TaskBar&lt;/h3&gt;

&lt;p&gt;Now that we have all the xaml in place, let’s take a look at the code. I’m going to simulate a long-running activity simply by throwing in a background worker and having it run a tight loop with a bunch of thread sleeps in there.&lt;/p&gt;

&lt;p&gt;Wire up the loaded event handler for the window, and let the IDE help you wire up the events for DoWork, ProgressChanged, RunWorkerCompleted.&lt;/p&gt;

&lt;p&gt;Next, be sure to set the worker.WorkerReportsProgress to true, and then call the RunWorkerAsync() method to kick off the process. The resulting load event looks like this:&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
    BackgroundWorker worker = new BackgroundWorker();
    worker.DoWork += new DoWorkEventHandler(worker_DoWork);
    worker.ProgressChanged += new ProgressChangedEventHandler(worker_ProgressChanged);
    worker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(worker_RunWorkerCompleted);
    worker.WorkerReportsProgress = true;
    worker.RunWorkerAsync();
}&lt;/pre&gt;

&lt;p&gt;Before we start reporting progress to the taskbar and the progress bar, let’s set the starting ProgressState for the taskbar. You can set this multiple times throughout the life of the process to control various states. Here’s what the states look like:&lt;/p&gt;

&lt;p&gt;Normal (green progress bar)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_6.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_6.png" width="68" height="43" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Indeterminate (pulsing green wave)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_7.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_7.png" width="69" height="44" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Paused (yellow progress bar)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_8.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_8.png" width="68" height="47" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Error (red progress bar)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_9.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_9.png" width="68" height="47" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, let’s start it off at Normal. You could do this in the loaded event or in the constructor, or at any point during the process. I initialized it in the constructor.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;public MainWindow()
{
    InitializeComponent();

    TaskbarItemInfo.ProgressState = TaskbarItemProgressState.Normal;

    Loaded += new RoutedEventHandler(MainWindow_Loaded);
}&lt;/pre&gt;

&lt;p&gt;
  &lt;br /&gt;Next, we need to handle reported background thread process status and use it to update both the progress bar in the window and the taskbar. That’s really simple to do. Note, however, that the TaskbarItemInfo.ProgressValue is a double between 0 and 1 while the progressBar value is an integer between two numbers supplied by you (typically 0 and 100), so we’ll need to adjust when we report progress.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;void worker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
    progressBar1.Value = e.ProgressPercentage;
    TaskbarItemInfo.ProgressValue = (double)e.ProgressPercentage/100;
}

void worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
    progressBar1.Value = 100;
    TaskbarItemInfo.ProgressValue = 1.0;
}&lt;/pre&gt;

&lt;p&gt;Finally, we need our worker itself. This is where you’d be doing something real, and time-consuming. Instead, I’ll just do something really time-consuming :) It sleeps one second per iteration and then reports the current progress.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;void worker_DoWork(object sender, DoWorkEventArgs e)
{
    for (int i = 0; i &amp;lt; 100; i += 10)
    {
        Thread.Sleep(1000);
        ((BackgroundWorker)sender).ReportProgress(i);
    }
}&lt;/pre&gt;

&lt;h2&gt;Runtime&lt;/h2&gt;

&lt;p&gt;When you run the app, you’ll see both the window and the taskbar update.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_10.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_10.png" width="457" height="267" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_11.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ShowingProgressintheWindows7TaskbarwithW_B4A4/image_thumb_11.png" width="96" height="49" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That was really easy. There are other things you can do with TaskbarItemInfo, such as changing your thumbnail and adding overlay icons. We’ll look at those in an upcoming post.&lt;/p&gt;

&lt;h3&gt;A Word on Use&lt;/h3&gt;

&lt;p&gt;Be judicious with how you use progress reporting on Windows 7. You should only use it when the progress status will be meaningful to a user when running other applications. Consider the scenario of your app doing something that the user will typically alt-tab away from. If the app is doing something that the user will want to know when it has completed so they can take an action (like opening a downloaded zip) then the taskbar progress reporting will be good. If, however, you are doing something which will have other progress indicators (like playing a video, where it’s obvious when the video ends because the user can see/hear it) or which won’t have the user waiting with bated breath for it to finish, consider just using a regular old progress bar, preferably a non-modal one.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;A video version of those, with source code, will be available on &lt;a href="http://windowsclient.net" target="_blank"&gt;windowsclient.net&lt;/a&gt; I’ll update this post with a link once that is up.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=4004" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jRajZ9Hn_78:Quj748qeDRU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jRajZ9Hn_78:Quj748qeDRU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jRajZ9Hn_78:Quj748qeDRU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jRajZ9Hn_78:Quj748qeDRU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jRajZ9Hn_78:Quj748qeDRU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jRajZ9Hn_78:Quj748qeDRU:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jRajZ9Hn_78:Quj748qeDRU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jRajZ9Hn_78:Quj748qeDRU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/jRajZ9Hn_78" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/29/Showing-Progress-in-the-Windows-7-Taskbar-with-WPF-4-_2800_and-a-short-romp-through-Windows-7-cleartype-settings_2900_.aspx</feedburner:origLink></item><item><title>The Win7 Sensor and Location API Part 1: Introduction and Freescale Board Setup and Testing</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/x-yIqQKK_E0/The-Win7-Sensor-and-Location-API-Part-1_3A00_-Introduction-and-Freescale-Board-Setup-and-Testing.aspx</link><pubDate>Thu, 29 Oct 2009 07:16:20 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3998</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>5</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3998.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3998</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3998</wfw:comment><description>&lt;p&gt;I’ve always been interested in ways that your PC can reach outside itself and interact with things in the world. That’s what fueled my &lt;a href="http://www.irritatedvowel.com/Railroad/Workshop/CNCAndCasting.aspx" target="_blank"&gt;interest in CNC&lt;/a&gt;, as well as things like Lego robotics, and the new sensor and location API.&lt;/p&gt;  &lt;p&gt;When I was in Redmond for my first week, I sought out &lt;a href="http://blogs.msdn.com/gavingear/default.aspx" target="_blank"&gt;Gavin Gear&lt;/a&gt; and Dino Natucci, and chatted about the &lt;a href="http://www.microsoft.com/whdc/device/sensors/default.mspx" target="_blank"&gt;Sensors and Location platform&lt;/a&gt;. I saw some really cool stuff there, some of which I can talk about :)&lt;/p&gt;  &lt;p&gt;Gavin also hooked me up with a couple &lt;a href="http://blogs.msdn.com/gavingear/archive/2009/04/14/windows-7-sensor-development-kit-boards-are-available-for-order.aspx" target="_blank"&gt;Freescale sensor boards&lt;/a&gt;. If you don’t yet have one, they are available for order for a pretty reasonable price. As Windows 7 is still new (at the time of this writing, it has only been released for six days), you won’t find too many sensors out there yet, but this board and the API will allow you to try things out in the meantime. The location API has &lt;a href="http://www.u-blox.com/en/press-and-events/press-release-archive/845.html" target="_blank"&gt;some companies on board&lt;/a&gt; and producing product already. I’ll cover that in a future post.&lt;/p&gt;  &lt;h2&gt;Sensor and Location Platform &lt;/h2&gt;  &lt;p&gt;The Windows 7 Sensor and Location platform is something completely new to Windows. It’s a framework helps eliminate the old com (or *gasp* parallel) port programming model that we’ve used for communicating with sensors in the past. It provides standards for drivers as well as a set of APIs for Sensor and Location (specialized and common sensors), and a control panel app to handle access to the sensors.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb.png" width="550" height="412" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;(image source &lt;a href="http://msdn.microsoft.com/en-us/library/dd318936(VS.85).aspx" target="_blank"&gt;MSDN&lt;/a&gt;) &lt;/p&gt;  &lt;p&gt;The Sensor and Location APIs are COM-based APIs usable from native code, scripting languages, and anything which can talk COM. To use them from .NET code, you’ll want to use the friendly interop classes which we’ll cover in a future post.&lt;/p&gt;  &lt;h2&gt;Install the SDK&lt;/h2&gt;  &lt;p&gt;Install the &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=SensorsAndLocation&amp;amp;DownloadId=5856" target="_blank"&gt;Sensor Developer Kit for Windows 7&lt;/a&gt;. I simply unpacked the zip into a subfolder of Program Files on my machine.&lt;/p&gt;  &lt;p&gt;Install the &lt;a href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=SensorsAndLocation&amp;amp;DownloadId=5858" target="_blank"&gt;Sensor Diagnostic Tool&lt;/a&gt;. The tool comes in Visual Studio project source format, so I put that in my projects folder. It converted for use with VS2010 just fine.&lt;/p&gt;  &lt;p&gt;We’ll cover .NET programming APIs in the next post on this topic. &lt;/p&gt;  &lt;p&gt;Don’t have the board, get the &lt;a href="http://msdn.microsoft.com/en-us/library/dd318911(VS.85).aspx" target="_blank"&gt;Virtual Light Sensor&lt;/a&gt; from the Windows SDK.&lt;/p&gt;  &lt;h2&gt;Install the Drivers&lt;/h2&gt;  &lt;p&gt;Once you have the SDK downloaded and unpacked somewhere on your machine, open the folder and find SensorKitDriverInstaller.exe&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_3.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_3.png" width="500" height="138" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Run that installer, following the directions to connect the board to the computer. Then turn the board on. You should get the two flashing lights. If you do not, you may need to update the firmware.&lt;/p&gt;  &lt;h2&gt;Configure and Test the Board&lt;/h2&gt;  &lt;p&gt;For the examples below, I’m using the 32 bit version of Windows 7. The Sensor DK includes drivers for both 32 and 64 bit versions of Windows 7.&lt;/p&gt;  &lt;h3&gt;Connect the Board&lt;/h3&gt;  &lt;p&gt;With the board switched “off” connect it to a USB port on your PC. I have a mini-usb plug always connected that I use for my camera, gps, phone, and now this board. I love standard connections. That said, the board will be easier to control if you pick a really cheap USB cable with thin wire and no ferrite toroid.&lt;/p&gt;  &lt;h3&gt;Update the Firmware&lt;/h3&gt;  &lt;p&gt;I did not need to update the firmware on the Rev D board I received, it may have been updated in a past life. If you do need to, the directions are included in the README in the SDK. It’s pretty much just a file copy like you would do with any USB stick.&lt;/p&gt;  &lt;h3&gt;Enable the Board&lt;/h3&gt;  &lt;p&gt;It took me a couple times before I remembered I had to do this. In control panel, you’ll see the applet for Location and Sensors. You want the “Enable location and other sensors” item&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_4.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_4.png" width="539" height="152" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_5.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_5.png" width="500" height="331" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;You can also control security on a per-user basis using that applet, but we’ll skip that for this.&lt;/p&gt;  &lt;h3&gt;Test the Board&lt;/h3&gt;  &lt;p&gt;Once you go through those steps, you’ll want to test the board to make sure everything is working. The compiled version and C++ source code for the test application are included in the SDK. The read-to-run binaries are in Tools\DiagnosticTool\Binaries&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_6.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_6.png" width="500" height="254" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;That’s fun for about 2 minutes, about the amount of time it takes you to verify that everything is working. Let’s really test it with something more interesting.&lt;/p&gt;  &lt;h3&gt;Testing the Board Take 2&lt;/h3&gt;  &lt;p&gt;Let’s test using Xna.&lt;/p&gt;  &lt;p&gt;You’ll need:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7d70d6ed-1edd-4852-9883-9a33c0ad8fee&amp;amp;displaylang=en" target="_blank"&gt;Microsoft XNA Game Studio 3.0&lt;/a&gt; (I haven’t tried with 3.1. If you do, comment below and let me know if it works for you)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://creators.xna.com/en-us/starterkit/racinggame" target="_blank"&gt;Microsoft XNA Racing Game Starter kit&lt;/a&gt; (you’ll want the RacingGameWindows-3.0.msi file)&lt;/li&gt;    &lt;li&gt;&lt;a href="http://code.msdn.microsoft.com/SensorsAndLocation/Release/ProjectReleases.aspx?ReleaseId=2359" target="_blank"&gt;Windows 7 Sensors XNA Racing Game&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Once you install the first two, go into VS2008 (the templates don’t install under 2010 unless you manually move them) and create a new XNA racing game starter kit project&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_7.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_7.png" width="500" height="365" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Inside the racing game zip file from msdn, you’ll see a Word document with instructions on how to modify the racing game starter kit project for use with the sensor API. You’ll be replacing a few files and recompiling the sample.&lt;/p&gt;  &lt;p&gt;Now run it and try out the accelerometer!&lt;/p&gt;  &lt;p&gt;So…..&lt;/p&gt;  &lt;p&gt;Nothing happened, right? Well, the sky responded to the light sensor, but the accelerometer did pretty much nothing.&lt;/p&gt;  &lt;p&gt;I ran into the same problem. Luckily, I found a person who had blazed this trail before me: Pietro Brambati. He had a &lt;a href="http://blogs.msdn.com/pietrobr/archive/2009/09/24/having-fun-with-windows-7-sensor-api-xna-game-studio.aspx" target="_blank"&gt;few tweaks to the source code&lt;/a&gt; to make the accelerometer work. Scroll down to section 4 (XNA) and you’ll see some code you’ll need to add. FWIW, he also has a great write-up on the rest of the board install process. I encourage you to check it out.&lt;/p&gt;  &lt;h4&gt;Changes to the Source to Support Motion&lt;/h4&gt;  &lt;p&gt;Add to CarPhysics.cs Update() method&lt;/p&gt;  &lt;pre class="brush: csharp;"&gt;if (Input.IsAccelerometerConnected)
{
    rotationChange -= effectiveSensitivity * 
        (Input.AccelerometerAxisX_Force / 3.0f) * 
        MaxRotationPerSec * moveFactor;
}&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Then to the same method, down in the “Handle Speed” section add &lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;else if (Input.IsAccelerometerConnected)
{
    if (Input.AccelerometerAxisY_Force &amp;gt; 0)
        newAccelerationForce += maxAccelerationPerSec;
    else
        newAccelerationForce -= maxAccelerationPerSec;
}&lt;/pre&gt;

&lt;p&gt;Finally, in the Graphics\BaseGame class add this code right below Sound.Initialize();&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;Input.Initialize();&lt;/pre&gt;

&lt;h4&gt;Run the App&lt;/h4&gt;

&lt;p&gt;NOW run it, and it should behave as you would expect. &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_8.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_8.png" width="320" height="211" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;From the video I recorded (link to be posted shortly) you’ll see I am a horrible driver. I’m thinking I should stick to Pole Position on the C64 :)&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_9.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_9.png" width="320" height="200" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;Uses for Sensors&lt;/h2&gt;

&lt;p&gt;Just considering the sensors available on the Freescale board, I can think of a few ways you could use them in your own applications or hardware:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Adjust application theme (contrast, colors, font size) based on ambient light. For example, if you’re out in the full sun, you may want to bump up the UI size and increase the contrast. This would be great for field applications, especially on tablets. In fact, here’s a &lt;a href="http://download.microsoft.com/download/a/d/f/adf1347d-08dc-41a4-9084-623b1194d4b2/Implementing_Light_Aware_UI.docx" target="_blank"&gt;great whitepaper&lt;/a&gt; on that very topic. &lt;/li&gt;

  &lt;li&gt;Accelerometer based games: use your whole laptop/notebook/tablet as a controller, or have an external device you hold, like the video I did along with this posting.&lt;/li&gt;

  &lt;li&gt;A friend of mine in DPE suggested controlling music based on the light level in the room. (Presumably if the lights go out, it’s Barry White time &amp;lt;g&amp;gt;)&lt;/li&gt;

  &lt;li&gt;I’d be curious to see if you could hang this on your car dash and get larger-scale acceleration readings. Worth trying out, but probably don’t want to tell your SO about this one.&lt;/li&gt;

  &lt;li&gt;Accelerometers are crucial in laptops that still use the soon-to-be-outdated spinning platter form or storage. If you can park the heads before the crunch, your data will have a better chance of staying safe.&lt;/li&gt;

  &lt;li&gt;Of course, environmental sensors (temperature, , pressure, humidity, etc.) have a ton of uses from IT to museums to portable weather stations. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I’ll have the video walkthrough of this and the test apps up shortly. For grins, here’s the setup I used to record the board:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_10.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/TheWin7SensorAPIPart1FreescaleBoardSetup_CCCC/image_thumb_10.png" width="500" height="262" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Dig that high-tech camera stand :)&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;The XNA game I recorded with a Canon HD camera on a tripod to my right.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3998" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=x-yIqQKK_E0:XZtJWWq7iHk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=x-yIqQKK_E0:XZtJWWq7iHk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=x-yIqQKK_E0:XZtJWWq7iHk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=x-yIqQKK_E0:XZtJWWq7iHk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=x-yIqQKK_E0:XZtJWWq7iHk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=x-yIqQKK_E0:XZtJWWq7iHk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=x-yIqQKK_E0:XZtJWWq7iHk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=x-yIqQKK_E0:XZtJWWq7iHk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/x-yIqQKK_E0" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/XNA/default.aspx">XNA</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/29/The-Win7-Sensor-and-Location-API-Part-1_3A00_-Introduction-and-Freescale-Board-Setup-and-Testing.aspx</feedburner:origLink></item><item><title>Easing Functions in WPF 4 (and Silverlight)</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/jvoJRoi0s3k/Easing-Functions-in-WPF-4-_2800_and-Silverlight_2900_.aspx</link><pubDate>Tue, 27 Oct 2009 17:02:39 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3979</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>5</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3979.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3979</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3979</wfw:comment><description>&lt;p&gt;One of my favorite design features added to &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; 4 is the ability to use easing functions with animation.&lt;/p&gt;  &lt;p&gt;Easing functions provide a way to liven up what would otherwise be pretty flat and boring animation. They provide acceleration/deceleration, and even bounce or spring to the approach into or departure from a key frame in an animation.&lt;/p&gt;  &lt;p&gt;Let’s take a look at how to use easing functions with storyboards in your WPF 4 projects. We’re going to do everything from xaml here so you get a taste of what is happening under the covers when you work in a tool like Expression Blend.&lt;/p&gt;  &lt;h2&gt;Basic Animation&lt;/h2&gt;  &lt;p&gt;In Visual Studio 2010, create a new Windows Application – WPF. Open up the MainWindow.xaml and add a rectangle sized 20x20 to the grid. &lt;/p&gt;  &lt;p&gt;To the rectangle, add a single ScaleTransform named “Transform”&lt;/p&gt;  &lt;p&gt;Then add a button somewhere on the same grid and name it “StartAnimation”. Wire up an event handler for the Click event. The xaml in your window should look something like this:&lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;Rectangle Height=&amp;quot;20&amp;quot;
               Width=&amp;quot;20&amp;quot;
               RenderTransformOrigin=&amp;quot;0.5,0.5&amp;quot;
               Fill=&amp;quot;BlueViolet&amp;quot;&amp;gt;
        &amp;lt;Rectangle.RenderTransform&amp;gt;
            &amp;lt;ScaleTransform x:Name=&amp;quot;Transform&amp;quot; /&amp;gt;
        &amp;lt;/Rectangle.RenderTransform&amp;gt;
    &amp;lt;/Rectangle&amp;gt;

    &amp;lt;Button x:Name=&amp;quot;StartAnimation&amp;quot;
            Click=&amp;quot;StartAnimation_Click&amp;quot;
            Content=&amp;quot;Start&amp;quot;
            HorizontalAlignment=&amp;quot;Center&amp;quot;
            VerticalAlignment=&amp;quot;Bottom&amp;quot;
            Margin=&amp;quot;5&amp;quot; /&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;The key items in there are the ScaleTransform named “Transform” and the button to start the animation.&lt;/p&gt;

&lt;p&gt;You should end with a window that looks something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/EasingFunctionsinWPF4andSilverlight3_12E2C/image.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/EasingFunctionsinWPF4andSilverlight3_12E2C/image_thumb.png" width="350" height="264" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I sized my window to 800x600 in order to better support other types of transforms. Your window will be smaller if you stayed with the defaults. &lt;/p&gt;

&lt;h3&gt;Create the Storyboard&lt;/h3&gt;

&lt;p&gt;Next, we’ll add the storyboard that will contain the animation, as well as the shells of the two animations we’ll be using.&lt;/p&gt;

&lt;p&gt;In your Window, add a Window.Resources section and add a single storyboard named “AnimateTarget”. That storyboard will have two DoubleAnimationUsingKeyFrames animations: one will target the ScaleX property of the Transform, and the other will target ScaleY.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Window.Resources&amp;gt;
    &amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
        &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                       Storyboard.TargetProperty=&amp;quot;ScaleX&amp;quot;&amp;gt;
            &amp;lt;!-- We'll add key frames here --&amp;gt;
        &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
        &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                       Storyboard.TargetProperty=&amp;quot;ScaleY&amp;quot;&amp;gt;
            &amp;lt;!-- We'll add key frames here --&amp;gt;
        &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;/Storyboard&amp;gt;
&amp;lt;/Window.Resources&amp;gt;&lt;/pre&gt;

&lt;h3&gt;Wire Up the Event Handler&lt;/h3&gt;

&lt;p&gt;Before we add the keyframes, crack open the codebehind and find the StartAnimation_Click event handler. If that isn’t present, check your button’s xaml and make sure you specified the Click event handler and allowed Visual Studio to create it for you. If not, just wipe out the Click=”…” bit and recreate it. Optionally, you could wire up the event handler in the constructor of the window.&lt;/p&gt;

&lt;p&gt;Once you have the event handler wired up, we’ll put in a single line of code which will start the animation.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;private void StartAnimation_Click(object sender, RoutedEventArgs e)
{
    ((Storyboard)this.Resources[&amp;quot;AnimateTarget&amp;quot;]).Begin();
}&lt;/pre&gt;

&lt;p&gt;There are multiple ways to handle that ranging from behaviors to commands to the approach we took here. Use whatever you are comfortable with.&lt;/p&gt;

&lt;h3&gt;Add Key Frames&lt;/h3&gt;

&lt;p&gt;Without key frames, the animation doesn’t yet do anything useful. A key frame is a specified value at a specified point in time. The animation system will interpolate all the other frames in between the key frames you provide. Typically, this is done in a linear fashion, as we’ll see when we first run this.&lt;/p&gt;

&lt;p&gt;Next we’ll add the key frames to our two animations. We’ll use EasingDoubleKeyFrames, but won’t put the easing functions in just yet. The animation will take the size of our shape and scale it from 0 to 2x its size on both the X and Y axes.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleX&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot; /&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleY&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot; /&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
&amp;lt;/Storyboard&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Test the Animation&lt;/h3&gt;

&lt;p&gt;Save the project and run it. You’ll see the shape expand as though it is flying towards you. The animation is linear, though. That is, the frames are interpolated using a constant ratio of value vs. time. The end result is something which looks very computer-generated, and not at all interesting.&lt;/p&gt;

&lt;h2&gt;Making the Animation Pop - Easing&lt;/h2&gt;

&lt;p&gt;We’ll start with one of the more dramatic easing functions: the ElasticEase. The elastic easing function interpolates the value over time using a formula that simulates elastic motion. That is, the element in this case, appears to be suspended from a rubber band.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleX&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot; /&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleY&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot; /&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
&amp;lt;/Storyboard&amp;gt;&lt;/pre&gt;

&lt;p&gt;Note that I applied the easing function only to the final keyframe in both animations, and I used the EaseOut parameter. If you change EaseOut to EaseIn, you’ll see the elastic action happen at the start of the animation instead of the end. It will appear to hesitate to get going. The result, in this case, is pretty unnatural, but the elastic ease is one of the easiest to use to identify what happens in EaseIn vs. EaseOut. Note also that you can use EaseInOut which will perform the easing both at the start and the end.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/EasingFunctionsinWPF4andSilverlight3_12E2C/image_3.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/EasingFunctionsinWPF4andSilverlight3_12E2C/image_thumb_3.png" width="550" height="103" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;(Image source: &lt;a href="http://msdn.microsoft.com/en-us/library/system.windows.media.animation.elasticease(VS.100).aspx" target="_blank"&gt;MSDN&lt;/a&gt;)&lt;/p&gt;

&lt;h3&gt;Controlling the Easing&lt;/h3&gt;

&lt;p&gt;The ElasticEase function takes a few parameters, you can set the springiness, as well as the number of oscillations. For a crazy effect, set the Oscillations parameter high.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
             Oscillations=&amp;quot;25&amp;quot; /&amp;gt;&lt;/pre&gt;

&lt;p&gt;I don’t recommend using values like that in your own apps, though, or you’ll have legions of end-users and interactive designers marching up your driveway with pitchforks and torches.&lt;/p&gt;

&lt;p&gt;Another parameter this particular easing function recognizes is Springiness. The higher this value, the stronger the spring/eslastic and therefore the less dramatic the bounce. Low values, like 1, give you a really weak spring that bounces all over. High values like 8 result in a super-stiff spring. The default value is 3.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleX&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                             Oscillations=&amp;quot;3&amp;quot;
                             Springiness=&amp;quot;8&amp;quot; /&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                   Storyboard.TargetProperty=&amp;quot;ScaleY&amp;quot;&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                              Value=&amp;quot;0.0&amp;quot; /&amp;gt;
        &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                              Value=&amp;quot;2.0&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                             Oscillations=&amp;quot;3&amp;quot;
                             Springiness=&amp;quot;8&amp;quot; /&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
        &amp;lt;/EasingDoubleKeyFrame&amp;gt;
    &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
&amp;lt;/Storyboard&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Animating other Transforms&lt;/h3&gt;

&lt;p&gt;If you want to animate something other than a ScaleTransform, like a TranslateTransform (affects location/movement) simply swap out the transform in the Rectangle.RenderTransform section, add your own in, and then change the Storyboard.TargetProperty to affect the appropriate value, and the Value in the key frame to reflect something more appropriate.&lt;/p&gt;

&lt;p&gt;Here’s an example using a TranslateTransform. It animates the position from the middle of the window to the bottom right:&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Window.Resources&amp;gt;
    &amp;lt;Storyboard x:Key=&amp;quot;AnimateTarget&amp;quot;&amp;gt;
        &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                       Storyboard.TargetProperty=&amp;quot;X&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                                  Value=&amp;quot;0.0&amp;quot; /&amp;gt;
            &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                                  Value=&amp;quot;202.0&amp;quot;&amp;gt;
                &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                    &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                                 Oscillations=&amp;quot;3&amp;quot;
                                 Springiness=&amp;quot;8&amp;quot; /&amp;gt;
                &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame&amp;gt;
        &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
        &amp;lt;DoubleAnimationUsingKeyFrames Storyboard.TargetName=&amp;quot;Transform&amp;quot;
                                       Storyboard.TargetProperty=&amp;quot;Y&amp;quot;&amp;gt;
            &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:0&amp;quot;
                                  Value=&amp;quot;0.0&amp;quot; /&amp;gt;
            &amp;lt;EasingDoubleKeyFrame KeyTime=&amp;quot;0:0:3&amp;quot;
                                  Value=&amp;quot;202.0&amp;quot;&amp;gt;
                &amp;lt;EasingDoubleKeyFrame.EasingFunction&amp;gt;
                    &amp;lt;ElasticEase EasingMode=&amp;quot;EaseOut&amp;quot;
                                 Oscillations=&amp;quot;3&amp;quot;
                                 Springiness=&amp;quot;8&amp;quot; /&amp;gt;
                &amp;lt;/EasingDoubleKeyFrame.EasingFunction&amp;gt;
            &amp;lt;/EasingDoubleKeyFrame&amp;gt;
        &amp;lt;/DoubleAnimationUsingKeyFrames&amp;gt;
    &amp;lt;/Storyboard&amp;gt;
&amp;lt;/Window.Resources&amp;gt;

&amp;lt;Grid&amp;gt;
    &amp;lt;Rectangle Height=&amp;quot;20&amp;quot;
               Width=&amp;quot;20&amp;quot;
               RenderTransformOrigin=&amp;quot;0.5,0.5&amp;quot;
               Fill=&amp;quot;BlueViolet&amp;quot;&amp;gt;
        &amp;lt;Rectangle.RenderTransform&amp;gt;
            &amp;lt;TranslateTransform x:Name=&amp;quot;Transform&amp;quot; /&amp;gt;
        &amp;lt;/Rectangle.RenderTransform&amp;gt;
    &amp;lt;/Rectangle&amp;gt;

    &amp;lt;Button x:Name=&amp;quot;StartAnimation&amp;quot;
            Click=&amp;quot;StartAnimation_Click&amp;quot;
            Content=&amp;quot;Start&amp;quot;
            HorizontalAlignment=&amp;quot;Center&amp;quot;
            VerticalAlignment=&amp;quot;Bottom&amp;quot;
            Margin=&amp;quot;5&amp;quot; /&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;For More Information&lt;/h2&gt;

&lt;p&gt;I’ll have a video version of this post, with full source code, available on &lt;a href="http://windowsclient.net" target="_blank"&gt;windowsclient.net&lt;/a&gt; soon.&lt;/p&gt;

&lt;p&gt;Both WPF 4 and &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; include a number of easing functions you may use in your animations. The best way to understand them is to use the interactive &lt;a href="http://go.microsoft.com/fwlink/?LinkId=139798&amp;amp;sref=easing_functions_gallery" target="_blank"&gt;Silverlight Easing Functions Explorer&lt;/a&gt;. The functions are the same as those available in WPF 4.&lt;/p&gt;

&lt;p&gt;You can also create your own easing functions - a topic I’ll cover in another post.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3979" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jvoJRoi0s3k:P8VYwGjxLO4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jvoJRoi0s3k:P8VYwGjxLO4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jvoJRoi0s3k:P8VYwGjxLO4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jvoJRoi0s3k:P8VYwGjxLO4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jvoJRoi0s3k:P8VYwGjxLO4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jvoJRoi0s3k:P8VYwGjxLO4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=jvoJRoi0s3k:P8VYwGjxLO4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=jvoJRoi0s3k:P8VYwGjxLO4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/jvoJRoi0s3k" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/27/Easing-Functions-in-WPF-4-_2800_and-Silverlight_2900_.aspx</feedburner:origLink></item><item><title>Introducing the WPF 4 Calendar control</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/X-bd1lvBeik/Introducing-the-WPF-4-Calendar-control.aspx</link><pubDate>Mon, 26 Oct 2009 04:17:56 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3976</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>5</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3976.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3976</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3976</wfw:comment><description>&lt;p&gt;&lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; 4 now includes, in the core runtime libraries, the calendar control. This control previously existed only in the WPF Toolkit, but has been promoted in the latest WPF release. Inclusion in the core runtime library makes it easier to develop with&amp;#160; as there is no additional namespace declaration or reference required.&lt;/p&gt;  &lt;p&gt;The Calendar control is located in the System.Windows.Controls namespace in the PresentationFramework DLL.&lt;/p&gt;  &lt;p&gt;Let’s start with the key properties and then move on to a couple common tasks such as scaling and binding.&lt;/p&gt;  &lt;h2&gt;Key Properties&lt;/h2&gt;  &lt;p&gt;Note that all date properties use the &lt;a href="http://msdn.microsoft.com/en-us/library/dd631811(VS.100).aspx" target="_blank"&gt;DateTime Xaml Syntax&lt;/a&gt; for parsing. Not also that unless noted, the control is shown with FlowDirection set to LeftToRight and FirstDateOfWeek set to Sunday. Both may be overridden if desired.&lt;/p&gt;  &lt;h3&gt;DisplayDate, SelectedDate and SelectedDates&lt;/h3&gt;  &lt;p&gt;When the control is first displayed, a date is shown highlighted – the DisplayDate. By default, that date is Today’s date. But you may change it to whatever date you would like. &lt;/p&gt;  &lt;p&gt;Use the SelectedDate scalar property when the calendar is in SingleDate selection mode. Use the SelectedDates collection property when the calendar is in any of the multi-select modes. &lt;/p&gt;  &lt;p&gt;The DisplayDate is shown on the right, the SelectedDate is shown on the left&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;pre class="brush: xml;"&gt;&amp;lt;Grid&amp;gt;
    &amp;lt;Calendar x:Name=&amp;quot;CalendarControl&amp;quot;
              HorizontalAlignment=&amp;quot;Center&amp;quot;
              VerticalAlignment=&amp;quot;Center&amp;quot;
              
              SelectionMode=&amp;quot;MultipleRange&amp;quot;
              DisplayMode=&amp;quot;Month&amp;quot;&amp;gt;
    &amp;lt;/Calendar&amp;gt;

    &amp;lt;TextBlock Text=&amp;quot;{Binding SelectedDate, ElementName=CalendarControl}&amp;quot;
               VerticalAlignment=&amp;quot;Bottom&amp;quot;
               HorizontalAlignment=&amp;quot;Left&amp;quot; /&amp;gt;

    &amp;lt;TextBlock Text=&amp;quot;{Binding DisplayDate, ElementName=CalendarControl}&amp;quot;
               VerticalAlignment=&amp;quot;Bottom&amp;quot;
               HorizontalAlignment=&amp;quot;Right&amp;quot; /&amp;gt;
&amp;lt;/Grid&amp;gt;&lt;/pre&gt;

&lt;p&gt;The above example also shows simple element binding using the SelectedDate (and DisplayDate) properties &lt;/p&gt;

&lt;h3&gt;DisplayMode&lt;/h3&gt;

&lt;p&gt;The DisplayMode property sets the calendar to display in one of three different modes: Decade, which shows the current decade and the year before and after, for three years total, Year which displays the months of the current year, and Month which displays the usual tabular calendar view of days in the month. At runtime, broader display modes drill-down into more specific display modes as described below.&lt;/p&gt;

&lt;p&gt;Not that in all modes, Control + Up Arrow will drill back up the DisplayMode and Control + Down Arrow will drill down into the next mode. For example, if in Year Mode, Control + Up will show Decade and Control + Down will show Month.&lt;/p&gt;

&lt;h4&gt;Decade&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_3.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_3.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In decade mode, clicking on a year will drill down into Year display mode, and will not affect SelectedDate.&lt;/p&gt;

&lt;p&gt;In decade mode, the arrow key changes the year of the DisplayDate, the Home key changes the DisplayDate to the first year of the decade, and the End key changes the DisplayDate to the last year of the decade. The spacebear drills into the selected year. In all cases, the SelectedDate is not changed.&lt;/p&gt;

&lt;h4&gt;Year&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_4.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_4.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In year mode, clicking on a month will drill down into Month display mode, and will not affect SelectedDate&lt;/p&gt;

&lt;p&gt;In year mode, the arrow key changes the month of the DisplayDate, the Home key changes the DisplayDate to the first month of the year, and the End key changes the DisplayDate to the last month of the year. The spacebar drills into the selected month. In all cases, the SelectedDate is not changed.&lt;/p&gt;

&lt;h4&gt;Month&lt;/h4&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_5.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_5.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;In month mode, clicking on a day sets the SelectedDate, or SelectedDates depending on the value for the SelectionMode property.&lt;/p&gt;

&lt;p&gt;In month mode, the arrow key changes the SelectedDate property, Shift+Arrow will add/select an adjacent day if the SelectionMode allows multi-select. Home changes the selected date to the first day of the month, and End changes it to the last. &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;SelectionMode&lt;/h3&gt;

&lt;p&gt;Selection mode controls the selection behavior for the dates in the Month mode of the calendar. &lt;/p&gt;

&lt;h4&gt;None&lt;/h4&gt;

&lt;p&gt;The calendar is effectively read-only. No dates may be selected. Clicking on a date changes the focus, but does not change the SelectedDate&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_6.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_6.png" width="244" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h4&gt;SingleDate&lt;/h4&gt;

&lt;p&gt;Allows selection of a single date. This is the default mode. Clicking on a date selects the date.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_7.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_7.png" width="244" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h4&gt;SingleRange&lt;/h4&gt;

&lt;p&gt;Allows selection of a single contiguous range of dates. Click on the start date, then shift-click on the end date.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_8.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_8.png" width="244" height="173" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;SelectedDate controls the first selected date, SelectedDates contains the full set of selected dates.&lt;/p&gt;

&lt;h4&gt;MultipleRange&lt;/h4&gt;

&lt;p&gt;Allows selection of multiple non-contiguous dates or ranges of dates. Click on one date, shift-click to set a range if desired, then control-click on other dates to add them.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_9.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_9.png" width="244" height="173" /&gt;&lt;/a&gt;&amp;#160; &lt;/p&gt;

&lt;p&gt;SelectedDate contains the first date selected (not necessarily the oldest date, just the first one selected), SelectedDates contains the full set of selected dates.&lt;/p&gt;

&lt;h3&gt;DisplayDateStart / DisplayDateEnd&lt;/h3&gt;

&lt;p&gt;If you wish to limit the date range that may be picked using the control, set the bounds using the DisplayDateStart and End properties. Those set a date window out of which the user may not navigate using the UI.&lt;/p&gt;

&lt;h3&gt;BlackoutDates&lt;/h3&gt;

&lt;p&gt;Another way to restrict date selection is to use the BlackoutDates property. This property allows you to mark specific date ranges as non-selectable in the UI. In the default control template, this is represented by an X over the date.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Calendar x:Name=&amp;quot;CalendarControl&amp;quot;
          HorizontalAlignment=&amp;quot;Center&amp;quot;
          VerticalAlignment=&amp;quot;Center&amp;quot;
          DisplayMode=&amp;quot;Month&amp;quot;&amp;gt;
    &amp;lt;Calendar.BlackoutDates&amp;gt;
        &amp;lt;CalendarDateRange Start=&amp;quot;10/4/2009&amp;quot;
                           End=&amp;quot;10/15/2009&amp;quot; /&amp;gt;
        &amp;lt;CalendarDateRange Start=&amp;quot;10/23/2009&amp;quot;
                           End=&amp;quot;10/28/2009&amp;quot; /&amp;gt;
    &amp;lt;/Calendar.BlackoutDates&amp;gt;
&amp;lt;/Calendar&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_10.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_10.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;When the user clicks on a blackout date, the SelectedDate property is not changed.&lt;/p&gt;

&lt;h3&gt;FlowDirection&lt;/h3&gt;

&lt;p&gt;Like most other control, the Calendar control respects the FlowDirection property in order to support right-to-left or left-to-right text directions. Below is an example of the control with FlowDirection set to RightToLeft&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_11.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_11.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;h2&gt;Scaling the Control&lt;/h2&gt;

&lt;p&gt;The Calendar control includes no built-in scaling. If you set the size of the control, or put it in a grid, it will clip but it will not expand. To visually resize, you’ll need to scale it using a ScaleTransform or by putting the control into a ViewBox.&lt;/p&gt;

&lt;h3&gt;Scaling with a ScaleTransform&lt;/h3&gt;

&lt;p&gt;The Calendar control scales like any other WPF control, using a simple ScaleTransform.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Calendar x:Name=&amp;quot;CalendarControl&amp;quot; 
          HorizontalAlignment=&amp;quot;Left&amp;quot; 
          VerticalAlignment=&amp;quot;Top&amp;quot;
          DisplayMode=&amp;quot;Month&amp;quot;&amp;gt;
    &amp;lt;Calendar.RenderTransform&amp;gt;
        &amp;lt;ScaleTransform ScaleX=&amp;quot;1.5&amp;quot;
                        ScaleY=&amp;quot;1.5&amp;quot; /&amp;gt;
    &amp;lt;/Calendar.RenderTransform&amp;gt;
&amp;lt;/Calendar&amp;gt;&lt;/pre&gt;

&lt;p&gt;The result looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_12.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_12.png" width="304" height="215" /&gt;&lt;/a&gt;&amp;#160;&lt;/p&gt;

&lt;h3&gt;Scaling with a ViewBox&lt;/h3&gt;

&lt;p&gt;A viewbox is simply a convenient way to abstract a ScaleTransform. It handles automatic centering and bounds checking for you, as well as dynamic resizing, so it’s a good way to handle scaling.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Viewbox&amp;gt;
    &amp;lt;Calendar x:Name=&amp;quot;CalendarControl&amp;quot;
              HorizontalAlignment=&amp;quot;Left&amp;quot;
              VerticalAlignment=&amp;quot;Top&amp;quot;
              DisplayMode=&amp;quot;Month&amp;quot;&amp;gt;
    &amp;lt;/Calendar&amp;gt;
&amp;lt;/Viewbox&amp;gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_13.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_13.png" width="304" height="215" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_14.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_14.png" width="304" height="285" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_15.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_thumb_15.png" width="304" height="90" /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;h2&gt;Binding to SelectedDate&lt;/h2&gt;

&lt;p&gt;When working in WPF and &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt;, I write my code and structure my applications using variations on the ViewModel (or MVVM) pattern. I’ll use a very simple form of that pattern here to show how to bind to the SelectedDate property of the control.&lt;/p&gt;

&lt;p&gt;First, add a folder named ViewModels and then an appropriately named ViewModel class in that folder. I typically name the VMs after their screen, so in this case it is simply MainWindowViewModel. &lt;/p&gt;

&lt;p&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WPF4IntroducingtheCalendarcontrol_14DF9/image_16.png" width="251" height="172" /&gt; &lt;/p&gt;

&lt;p&gt;The ViewModel code itself is pretty simple. We have a class that implement INotifyPropertyChanged in order to inform the binding system that a value has changed, then we have a public property as our binding source.&lt;/p&gt;

&lt;pre class="brush: csharp;"&gt;class MainWindowViewModel : INotifyPropertyChanged
{
    private DateTime _dateOfBirth;
    public DateTime DateOfBirth
    {
        get { return _dateOfBirth; }
        set { _dateOfBirth = value; NotifyPropertyChanged(&amp;quot;DateOfBirth&amp;quot;); }
    }

    public event PropertyChangedEventHandler  PropertyChanged;
    protected void NotifyPropertyChanged(string propertyName)
    {
        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
    }

}&lt;/pre&gt;

&lt;p&gt;The property changed event handler allows us to set the property value from code or from other controls and still ensure that all bound targets know the value changed.&lt;/p&gt;

&lt;p&gt;Next we need to set the ViewModel as the datacontext for our window. You can do this a number of ways including newing up the VM in the code-behind and setting the DataContext there, or using dependency injection to create the relationship between the two. In this case, I’m going to set it right in the xaml as a resource. To do that, I need to add a namespace and a resource to the xaml&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Window x:Class=&amp;quot;WpfApplication6.MainWindow&amp;quot;
        xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
        xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
        xmlns:viewModels=&amp;quot;clr-namespace:WpfApplication6.ViewModels&amp;quot;
        Title=&amp;quot;Calendar Control Demo&amp;quot; Height=&amp;quot;300&amp;quot; Width=&amp;quot;425&amp;quot;&amp;gt;
    &amp;lt;Window.Resources&amp;gt;
        &amp;lt;viewModels:MainWindowViewModel x:Key=&amp;quot;vm&amp;quot; /&amp;gt;
    &amp;lt;/Window.Resources&amp;gt;&lt;/pre&gt;

&lt;p&gt;You can see the viewModel namespace declaration tied to the window class, and the reference to the viewmodel itself right inside the Window.Resources section.&lt;/p&gt;

&lt;p&gt;Next, I set the Grid’s DataContext property to be the static resource&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Grid DataContext=&amp;quot;{StaticResource vm}&amp;quot;&amp;gt;&lt;/pre&gt;

&lt;p&gt;Finally, set the SelectedDate property of the calendar to bind to the DateOfBirth property of the view model.&lt;/p&gt;

&lt;pre class="brush: xml;"&gt;&amp;lt;Calendar x:Name=&amp;quot;CalendarControl&amp;quot;
          HorizontalAlignment=&amp;quot;Center&amp;quot;
          VerticalAlignment=&amp;quot;Center&amp;quot;
          SelectedDate=&amp;quot;{Binding DateOfBirth}&amp;quot;
          DisplayMode=&amp;quot;Month&amp;quot;&amp;gt;
&amp;lt;/Calendar&amp;gt;&lt;/pre&gt;

&lt;p&gt;If you now run the application and set a breakpoint on the property setter for DateOfBirth in the ViewModel, you’ll see the binding in action.&lt;/p&gt;

&lt;h2&gt;Working with SelectedDates&lt;/h2&gt;

&lt;p&gt;The SelectedDates property is a little trickier. Rather than a simple scalar property like SelectedDate, this is a read-only property that returns a collection which may be modified, but not bound to.&lt;/p&gt;

&lt;p&gt;If you working from code-behind and using the control as the source of record for the data, then it is pretty easy. If you’re using a pattern like the VM pattern, you’ll need to have an adapter that sits between the control and the viewmodel and updates each end with the other changes. Essentially, your own custom mini binding system.&lt;/p&gt;

&lt;p&gt;If you use the ViewModel/MVVM pattern and have a different or better approach to handling the binding, please share.&lt;/p&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;For more information, please visit www.&lt;a href="http://windowsclient.net" target="_blank"&gt;windowsclient.net&lt;/a&gt; . I’ll have a video version of this article up there soon.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3976" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=X-bd1lvBeik:i2MIfXBsE4c:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=X-bd1lvBeik:i2MIfXBsE4c:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=X-bd1lvBeik:i2MIfXBsE4c:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=X-bd1lvBeik:i2MIfXBsE4c:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=X-bd1lvBeik:i2MIfXBsE4c:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=X-bd1lvBeik:i2MIfXBsE4c:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=X-bd1lvBeik:i2MIfXBsE4c:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=X-bd1lvBeik:i2MIfXBsE4c:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/X-bd1lvBeik" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/26/Introducing-the-WPF-4-Calendar-control.aspx</feedburner:origLink></item><item><title>Samson C01U microphone and Windows 7 (and Vista)</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/JRCDzE9o0fQ/Samson-C01U-microphone-and-Windows-7-_2800_and-Vista_2900_.aspx</link><pubDate>Sun, 25 Oct 2009 04:28:32 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3969</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>0</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3969.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3969</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3969</wfw:comment><description>&lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/SamsonC01UandWindows7_413/pmb_c03u_mic_cropped.jpg" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px 0px 5px 5px;display:inline;border-top:0px;border-right:0px;" title="pmb_c03u_mic_cropped" border="0" alt="pmb_c03u_mic_cropped" align="right" src="http://www.irritatedvowel.com/pub/blog/SamsonC01UandWindows7_413/pmb_c03u_mic_cropped_thumb.jpg" width="260" height="201" /&gt;&lt;/a&gt;Today I picked up a Samson C01U mic so that I can have better audio in my &lt;a href="http://windowsclient.net" target="_blank"&gt;WindowsClient.net&lt;/a&gt; videos than I had in some previous screencasts. The mic is the same one that Scott Hanselman has used when recording podcasts from his setup.&lt;/p&gt;  &lt;p&gt;I spent the better part of the afternoon messing around with the mic, trying to get something with usable audio. The gain just seemed way too low, barely registering one bar in the Windows 7 audio device setup dialog.&lt;/p&gt;  &lt;p&gt;I made sure to crank up the gain in that dialog (it’s set &lt;strong&gt;really&lt;/strong&gt; low by default). but that made only marginal difference.&lt;/p&gt;  &lt;p&gt;I tried it on my netbook to check levels (which seemed slightly higher there, but still not usable) I even tried switching it around between different USB ports on my PC in case power was an issue. I tried it both on-board and in an external powered USB hub. The tip for that came from &lt;a href="http://www.silverarcade.com/" target="_blank"&gt;Bill Reiss&lt;/a&gt; in the Camtasia forums &lt;a href="http://forums.techsmith.com/archive/index.php/t-10769.html" target="_blank"&gt;here&lt;/a&gt; (excerpted below, emphasis mine).&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I had an issue with the Samson C01U microphone levels on Windows 7 (Vista should be very similar), the microphone was very quiet. &lt;strong&gt;It turns out that it was the USB port I was plugging it into, it must not provide enough power. I switched to another USB port on the other side of the laptop and it was fine.       &lt;br /&gt;&lt;/strong&gt;If you try switching to another USB port and this doesn't help, you may want to consider a USB hub that has external AC power.      &lt;br /&gt;Hope this helps, I didn't find any advice like this online and was about to give up on this microphone before I figured it out. Now I'm very happy with it.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;So, before I completely gave up on what I was sure would be a good mic, I decided to try some other ports. My external powered hub has two ports sticking out of the top which look like they might be special. I tried one of those and bam! I suddenly had sound levels in the red. I guess those two are the only ones getting additional juice.&lt;/p&gt;  &lt;p&gt;Condenser mics need external power because they rely on voltage changes in a capacitor to capture sound. This makes them more sensitive than other types of mics, but also means they need power where others do not. &lt;/p&gt;  &lt;p&gt;In Windows XP you can use the special pre-amp software to work around this, but I imagine the USB power issue remains simply masked.&lt;/p&gt;  &lt;p&gt;It appears that not all USB power is created equal. Now the mic sounds great.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3969" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=JRCDzE9o0fQ:hskZ2VtE9TM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=JRCDzE9o0fQ:hskZ2VtE9TM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=JRCDzE9o0fQ:hskZ2VtE9TM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=JRCDzE9o0fQ:hskZ2VtE9TM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=JRCDzE9o0fQ:hskZ2VtE9TM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=JRCDzE9o0fQ:hskZ2VtE9TM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=JRCDzE9o0fQ:hskZ2VtE9TM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=JRCDzE9o0fQ:hskZ2VtE9TM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/JRCDzE9o0fQ" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Vista/default.aspx">Vista</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Hardware/default.aspx">Hardware</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/25/Samson-C01U-microphone-and-Windows-7-_2800_and-Vista_2900_.aspx</feedburner:origLink></item><item><title>Welcome Windows 7 – See you at PDC09</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/WFt7S24ijco/Welcome-Windows-7-_1320_-See-you-at-PDC09.aspx</link><pubDate>Thu, 22 Oct 2009 17:13:19 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3966</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>0</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3966.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3966</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3966</wfw:comment><description>&lt;p&gt;I couldn’t have picked a more exciting time to join Microsoft. .NET 4 Beta 2 and the first version of Visual Studio to use &lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt; were both just released, MSDN has been relaunched with a better theme and content, and today, Windows 7 officially hit the stores. &lt;/p&gt;  &lt;p&gt;Windows 7 is, to me, the most exciting release of Windows since Windows 95. While I’m one of those folks who never ran into any real issues on Vista, I can’t help but appreciate all the speed and usability enhancements, as well as the general crispness of our new OS. It’s products like these that make me proud to work at Microsoft.&lt;/p&gt;  &lt;p&gt;Congratulations to the teams that made Windows 7 and .NET 4 possible.&lt;/p&gt;  &lt;h4&gt;Upcoming Videos and Tutorials&lt;/h4&gt;  &lt;p&gt;On the run up to PDC, I’ll be putting out some blog posts on new fun and useful things for developers on Windows 7 and .NET 4. Blog posts will be here, and videos will be on &lt;a href="http://windowsclient.net" target="_blank"&gt;WindowsClient.net&lt;/a&gt;. Stay tuned and subscribe to my blog here and follow me on &lt;a href="http://twitter.com/pete_brown" target="_blank"&gt;twitter&lt;/a&gt; for the announcements.&lt;/p&gt;  &lt;h4&gt;Free Windows 7 Developer Bootcamp at PDC&lt;/h4&gt;  &lt;p&gt;One way to get really jumpstart your Windows 7 development is to attend the free developer bootcamp at this year’s PDC. The bootcamp is the day before the PDC and is free. Space is limited, so be sure to sign up. I’m especially excited about the shell integration and the sensor and location API.&lt;/p&gt;  &lt;p&gt;You can find more details on the bootcamp in both &lt;a href="http://blogs.msdn.com/tims/archive/2009/09/23/live-from-la-it-s-the-free-windows-7-developer-bootcamp.aspx" target="_blank"&gt;Tim Sneath’s post&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/jaimer/archive/2009/10/21/learn-network-with-mvps-and-have-fun-at-the-windows-7-boot-camp.aspx" target="_blank"&gt;Jaime Rodriguez’s post&lt;/a&gt;. That’s a serious amount of free there. If you’re going to the PDC or are just in the area, it would be crazy to pass it up.&lt;/p&gt;  &lt;p&gt;Speaking of PDC, if you’re attending, check out the &lt;a href="http://windowsteamblog.com/blogs/developers/archive/2009/10/08/windows-7-at-pdc09.aspx" target="_blank"&gt;track of Windows 7 sessions&lt;/a&gt;. There’s a ton of great content in there, and since it’s the PDC, you know it’s going to be both high quality and technically deep.&lt;/p&gt;  &lt;h4&gt;Show me your App at PDC&lt;/h4&gt;  &lt;p&gt;I’ll be at the PDC this year with an HD video camera. I’m interesting in interviewing you and seeing your Windows applications (WPF, &lt;a href="http://www.windowsclient.net" target="_blank"&gt;Windows forms&lt;/a&gt;, C++) in action. It doesn’t need to use the latest or greatest version of our tools, it just needs to be an app you’re proud of.&lt;/p&gt;  &lt;p&gt;If you have something to show that you or your team wrote, bring it with you and email me at &lt;strong&gt;Pete.Brown /AT\ Microsoft.com&lt;/strong&gt; so I can meet up and talk to you about it. Nothing super fancy, just 10-15 minutes of you and me talking about something you think is cool. Email me sooner rather than later to make sure we reserve a slot.&lt;/p&gt;  &lt;h4&gt;Kindle App for Windows&lt;/h4&gt;  &lt;p&gt;If you’re a fan of ebooks, but haven’t yet sprung for a Kindle, be sure to sign up for the &lt;a href="http://www.amazon.com/gp/feature.html/ref=kcp_pc_mkt_lnd?docId=1000426311" target="_blank"&gt;Kindle for PC beta&lt;/a&gt;. This will allow you to read Kindle books on your Windows PC. Of course, with touch, font rendering enhancements, and all the other improvements in 7, the PC finally becomes a viable ebook reading platform that both looks and feels natural.&lt;/p&gt;  &lt;h4&gt;Feed Me&lt;/h4&gt;  &lt;p&gt;Oh, and if you’re in Japan, be sure to snag one of the &lt;a href="http://www.electronista.com/articles/09/10/21/microsoft.promos.win.7.with.bk.deal/" target="_blank"&gt;Windows 7 Whoppers&lt;/a&gt; (preferably follows by 777 minutes on a treadmill &amp;lt;g&amp;gt;)&lt;/p&gt;  &lt;p&gt;And while you’re on that treadmill, revisit &lt;a href="http://blogs.msdn.com/tims/archive/2009/01/12/the-bumper-list-of-windows-7-secrets.aspx" target="_blank"&gt;Tim Sneath’s Windows 7 Secrets blog post&lt;/a&gt; from January to bone up on shortcuts and lots of hidden gems in Win7. Keep in mind it was written on an early rev of Win7, but many/most still apply.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3966" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=WFt7S24ijco:vKuXiFpZvXA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=WFt7S24ijco:vKuXiFpZvXA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=WFt7S24ijco:vKuXiFpZvXA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=WFt7S24ijco:vKuXiFpZvXA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=WFt7S24ijco:vKuXiFpZvXA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=WFt7S24ijco:vKuXiFpZvXA:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=WFt7S24ijco:vKuXiFpZvXA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=WFt7S24ijco:vKuXiFpZvXA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/WFt7S24ijco" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/PDC09/default.aspx">PDC09</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/22/Welcome-Windows-7-_1320_-See-you-at-PDC09.aspx</feedburner:origLink></item><item><title>My new netbook er.. notebook er.. computer</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/IQwA22JafNs/My-new-netbook-er_2E002E00_-notebook-er_2E002E00_-computer.aspx</link><pubDate>Tue, 06 Oct 2009 04:42:33 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3937</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>2</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3937.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3937</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3937</wfw:comment><description>&lt;p&gt;My old laptop had to be returned to my employee when I left my job at the end of September. That left me with no computer to carry around, and with my Microsoft NEO coming up the week of the 12th, that just wasn’t going to do.&lt;/p&gt;  &lt;p&gt;I needed something decent, but cheap; Something I could lug around the airport without any trouble, and open on the cramped plane. I’m a big guy, so big laptops on tray tables end up sitting on my chest like a bib – not very useful. I also wanted something that would still have utility or novelty once I got my new work notebook.&lt;/p&gt;  &lt;p&gt;My budget was $500 or under. The typical netbook (Intel Atom, 1gig RAM, 160gb drive, Windows XP) go for between $299 and $399 depend on features. They also have 1024x600 resolution.&lt;/p&gt;  &lt;p&gt;The machine I ended up getting is the Acer Aspire 1410 in sapphire blue. Cost was $429 on sale at Micro Center up in Rockville, MD.&lt;/p&gt;  &lt;p&gt;Acer classifies the machine as a notebook, but the store had it on display with all the netbooks. The size is only about 1” wider than typical netbooks, and much smaller than all the laptops in the room. It seems to occupy some fuzzy space between true netbooks and full service laptops.&lt;/p&gt;  &lt;p&gt;Here’s a review I found: &lt;a title="http://www.liliputing.com/2009/09/acer-aspire-1410-review.html" href="http://www.liliputing.com/2009/09/acer-aspire-1410-review.html"&gt;http://www.liliputing.com/2009/09/acer-aspire-1410-review.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’ll be trying this out over the next week, and posting any interesting findings on &lt;a href="http://twitter.com/pete_brown" target="_blank"&gt;Twitter&lt;/a&gt;. My first task is to pave over vista with Win7, and install Office 2010. I can’t wait to try out the multi-touch trackpad with Win7. &lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/Mynewnetbooker..notebooker.computer_14B7B/image.png" width="300" height="293" /&gt; &lt;/p&gt;  &lt;p&gt;Here’s a shot of it, on my (obviously dusty) desk, with my mouse and trusty seltzer water for comparison. (As an aside, interesting how the flash makes my primary display look pink)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/Mynewnetbooker..notebooker.computer_14B7B/IMG_0549.jpg" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="IMG_0549" border="0" alt="IMG_0549" src="http://www.irritatedvowel.com/pub/blog/Mynewnetbooker..notebooker.computer_14B7B/IMG_0549_thumb.jpg" width="454" height="343" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Below are the specs. You tell me if you would consider this a netbook or a notebook, or neither.&lt;/p&gt;  &lt;table cellspacing="0" cellpadding="2"&gt;     &lt;tr&gt;       &lt;td&gt;CPU&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;Intel® Core™2 Solo Processor SU3500            &lt;br /&gt;(3MB L2 cache, 1.40GHz, 800MHz FSB)&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Chipset&lt;/td&gt;        &lt;td&gt;Mobile Intel® GS45 Express          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;VGA&lt;/td&gt;        &lt;td&gt;Intel GMA 4500HHD up to 732 MB DVMT          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;LCD&lt;/td&gt;        &lt;td&gt;11.6” HD LED LCD          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Memory&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;2GB (2GB installed in one of two memory slots) DDR2 667 SDRAM            &lt;br /&gt;User upgradeable up to 4GB (one 2GB memory card in each slot) subject to availability of 2GB cards&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Storage&lt;/td&gt;        &lt;td&gt;250GB HDD          &lt;br /&gt;          &lt;p&gt;5-in-1 card reader supports optional MultiMediaCard™, Secure Digital card, Memory Stick®, Memory Stick PRO™ or xD-Picture Card™            &lt;br /&gt;Optional external USB 1.44MB* floppy drive&lt;/p&gt;          &lt;p&gt;No optical drives&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Bluetooth&lt;/td&gt;        &lt;td&gt;yes          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Ports&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;DC-in            &lt;br /&gt;RJ-45 LAN             &lt;br /&gt;VGA             &lt;br /&gt;Headphones/speakers/line-out with SPDIF support             &lt;br /&gt;Microphone             &lt;br /&gt;HDMI™ (High-Definition Multimedia Interface™) with HDCP (high-bandwidth digital-content protection)             &lt;br /&gt;Three USB 2.0&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Audio&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;Integrated microphone            &lt;br /&gt;Microsoft® DirectSound® compatibility             &lt;br /&gt;Optimized second-generation Dolby® Sound Room audio enhancement             &lt;br /&gt;Headphones/speaker/line-out with SPDIF support and microphone ports&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;OS&lt;/td&gt;        &lt;td&gt;Windows Vista Home Premium (Micro Center offers free Win7 upgrade)          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Video&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;Acer® CineCrystal 11.6&amp;quot; WXGA (1366 x 768) high-brightness (200-nit) TFT display with 16:9 aspect ratio and LED backlight            &lt;br /&gt;Up to 16.7 million colors             &lt;br /&gt;Integrated Intel® Graphics Media Accelerator 4500MHD             &lt;br /&gt;Microsoft® DirectX® 10.0 support             &lt;br /&gt;MPEG-2 DVD, WMV9/VC-1 (Windows® Media Video 9, VC-1 standard), H.264/AVC decoding             &lt;br /&gt;VGA and HDMI™ (High-Definition Multimedia Interface™) with HDCP (high-bandwidth digital-content protection) support ports             &lt;br /&gt;Support for simultaneous display on notebook LCD and external monitor&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Communications&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;Intel® Wireless WiFi Link network connection supporting 802.11a/b/g/Draft-N wireless LAN, Acer® SignalUp technology for enhanced antenna efficiency, WI-FI CERTIFIED™            &lt;br /&gt;Gigabit LAN, Wake-on-LAN ready             &lt;br /&gt;Acer® Video Conference with integrated Acer® Crystal Eye webcam supporting Acer® PrimaLite technology, which consists of a premium sensor, firmware and lenses to provide superior video performance under low-light conditions&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;UI&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;84-key full-size Acer® FineTip keyboard, inverted T cursor layout, embedded numeric keypad, hotkey controls, international language support            &lt;br /&gt;10 function, four cursor, two Microsoft® Windows® keys             &lt;br /&gt;Multi-gesture touchpad supporting circular-motion scrolling, pinch-action zoom, page flip&lt;/p&gt;          &lt;br /&gt;&lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Dimensions and Weight&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;11.2&amp;quot; (285.0mm) W x 8.0&amp;quot; (204.0mm) D x 0.9&amp;quot; – 1.2” (22.1mm – 30.0mm) H            &lt;br /&gt;3.1 lb. (1.4kg)             &lt;br /&gt;Size and weight may vary depending on configuration&lt;/p&gt;          &lt;p&gt;&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;      &lt;tr&gt;       &lt;td&gt;Power&lt;/td&gt;        &lt;td&gt;         &lt;p&gt;30-watt AC adapter            &lt;br /&gt;Six-cell lithium ion battery: up to 6.0 hours life depending on configuration and usage (may be reduced if Windows Vista® Aero is enabled)&lt;/p&gt;       &lt;/td&gt;     &lt;/tr&gt;   &lt;/table&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3937" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=IQwA22JafNs:50m6cI4G_V4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=IQwA22JafNs:50m6cI4G_V4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=IQwA22JafNs:50m6cI4G_V4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=IQwA22JafNs:50m6cI4G_V4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=IQwA22JafNs:50m6cI4G_V4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=IQwA22JafNs:50m6cI4G_V4:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=IQwA22JafNs:50m6cI4G_V4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=IQwA22JafNs:50m6cI4G_V4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/IQwA22JafNs" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/win7/default.aspx">win7</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Hardware/default.aspx">Hardware</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/10/06/My-new-netbook-er_2E002E00_-notebook-er_2E002E00_-computer.aspx</feedburner:origLink></item><item><title>Now with more forehead! (or, a happy shade of blue)</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/4LajTUXEW38/Now-with-more-forehead_2100_-_2800_or_2C00_-a-happy-shade-of-blue_2900_.aspx</link><pubDate>Sat, 19 Sep 2009 05:01:00 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3905</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>14</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3905.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3905</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3905</wfw:comment><description>&lt;p&gt;&lt;img align="right" alt="dotnet" border="0" height="163" src="http://www.irritatedvowel.com/pub/blog/54f4df353181_1457A/dotnet.png" style="margin:5px 0px;display:inline;border-width:0px;" title="dotnet" width="172" /&gt; Over the past 13 1/2 years, I&amp;rsquo;ve had the pleasure of working with some really talented developers, architects and designers in what I and many others consider to be one of the very best .NET consulting companies on the east coast: Applied Information Sciences (&lt;a href="http://www.appliedis.com" target="_blank"&gt;AIS&lt;/a&gt;).&lt;/p&gt;&lt;p&gt;AIS hired me right out of college and moved me down to Maryland from New England back in 1996. During my interview, due to the thick central Massachusetts accent I had at the time, I was asked if I spoke any other languages besides Massachusetts :) The majority of my early projects were VB 4/5/6 applications that did the usual mix of forms over data combined with automating Word/Excel and the like. Way back, I architected a fairly large VB6 application that relied on Microsoft Transaction Server (later COM+) to handle middle tier components. Later on, I did more work in VB, and then in .NET with Windows Forms (VB and C#, several projects), a little ASP.NET and then several years of Silverlight. Prior to joining AIS, I was doing dBase/Foxpro, Borland C++, Delphi 1.0, PowerBuilder 3, and VB3 work for a medical billing company. (oh, and that company way back made me buy all my own (expensive) tools; they said programmers should be like carpenters. heh)&lt;/p&gt;&lt;p&gt;AIS has been great to me, and in return, I&amp;rsquo;ve done lots of things there that I am very proud of. I&amp;rsquo;ve managed projects with as many as 11 AIS direct reports (and twice that in client staff semi-reporting to me), architected solutions ranging from desktop apps to multi-headed client and web apps, and got my head firmly into the user experience space. My record is pretty good, and my experience is nicely varied between a huge number of problem domains and the gamut of Microsoft developer technologies and server products.&lt;/p&gt;&lt;p&gt;My main focus in the early to mid 2000s was in Windows Forms. I did enough Windows Forms development that I created my own website (&lt;a href="http://www.irritatedVowel.com"&gt;www.irritatedVowel.com&lt;/a&gt; which I sorely need to redo) just so I could ensure I had some actual hands-on ASP.NET experience.&lt;/p&gt;&lt;p&gt;Now I get to apply that project and client app dev experience, and my community work, to a new area.&lt;/p&gt;&lt;p&gt;In September 2009, I was offered a dream position: Senior Program Manager on Scott Hanselman&amp;rsquo;s team, with focus on the Windows Client (&lt;a href="http://windowsclient.net" target="_blank"&gt;WPF&lt;/a&gt;, C++/MFC, &lt;a href="http://www.windowsclient.net" target="_blank"&gt;Windows Forms&lt;/a&gt;) properties on MSDN and windowsclient.net. The team I&amp;rsquo;d be working with would be second to none (Scott, Tim Heuer, Joe Stagner and Jesse Liberty). I&amp;rsquo;ve known those guys for a while, and I couldn&amp;rsquo;t possibly think of a team I&amp;rsquo;d rather work with, or a domain I&amp;rsquo;d rather work in. So, of course, I accepted it. &lt;strong&gt;I start at Microsoft in the middle of October.&lt;/strong&gt;&lt;/p&gt;&lt;h4&gt;Windows Client? I thought you were a Silverlight guy?&lt;/h4&gt;&lt;p&gt;Back in 2007, I got into &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; because of my love for .NET client solutions and providing the best possible user experience for business applications. The rest of my company was going to web development (with a serious amount of SharePoint work as well). I saw Silverlight as a great way to bring my windows client skills to the web, and create better web apps faster, without forcing sub-par user experience on my customers. My going-in position with new clients, though, was always to recommend WPF for internal apps unless they proved to me they needed something only available in Silverlight, or it was a choice between Silverlight or HTML &amp;ndash; nothing else. I&amp;rsquo;ve produced a bunch of great Silverlight applications over the past couple years, mentored others on how to write for it, and helped a number of companies get off the ground with new SL projects. I&amp;rsquo;m really proud of what I accomplished.&lt;/p&gt;&lt;p&gt;I still think Silverlight is an absolutely amazing technology. It always had the feel of a new and unexplored frontier. I saw it born and saw it (quickly!) grow up into a real app dev platform. It has brought and continues to bring new people to Microsoft development &amp;ndash; people whose only past experience was with html/js and adobe products. I plan to stay engaged in the Silverlight community in the same hobbyist capacity I was before I decided to join Microsoft.&amp;nbsp; Happily, WPF, being a superset, will make it easier for me to keep SL as a hobby without letting skills in either go stale.&lt;/p&gt;&lt;h4&gt;Uh huh. But I thought you were a Silverlight guy?&lt;/h4&gt;&lt;p&gt;I was, for a bit over two years, but I&amp;rsquo;ve been doing this for almost 18 years now. I tend to change focus fairly often. What stays consistent though is I am into the technologies that make it possible to create the best user experience with the least effort and most flexibility. Silverlight definitely fits that category &amp;ndash; as does WPF and for many applications, Windows Forms. In fact, when I got a glimpse of Silverlight 2 and what it could do, &lt;a href="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/01/08/Why-Silverlight-2.0-will-Change-How-We-Build-Applications.aspx" target="_blank"&gt;I wrote an article&lt;/a&gt; where I mentioned that one of the great side effects of Silverlight 2 will be increased adoption of WPF.&lt;/p&gt;&lt;p&gt;There&amp;rsquo;s another thing that attracted me to this, though. Silverlight is getting TONs of attention right now. Most user groups get multiple Silverlight talks in a given year (I know, I&amp;rsquo;ve given a number of them); that&amp;rsquo;s saying something given the number of potential topics in the windows development space. There are lots of examples for Silverlight online. There are some of the best community folks I know (Tim, Jesse, and now John) who are dedicated 100% to Silverlight. &lt;/p&gt;&lt;p&gt;Windows client, on the other hand, has been a little neglected. Not for lack of love or lack of developers (it&amp;rsquo;s a huge percentage of all .NET development), but just lack of attention and visibility. &lt;strong&gt;There&amp;rsquo;s a ton of good work being done by windows client developers around the world&lt;/strong&gt;, and not enough attention being brought to it, and not enough support being given to it and the community around it. I will make an impact in both of those areas.&lt;/p&gt;&lt;h4&gt;What about the Silverlight book?&lt;/h4&gt;&lt;p&gt;I am absolutely committed to completing what I expect to be the best Silverlight book on the market. My new management knows about the book and there is nothing but encouragement there. Back in July we (my publisher, editor, and I) made some content changes that we&amp;rsquo;ll announce in the fall, but they are great changes and will result in a world-class Silverlight book. I&amp;rsquo;m not scaling anything back, and I&amp;rsquo;m not compromising. Stay tuned.&lt;/p&gt;&lt;p&gt;Keep up with the updates here: &lt;a href="http://manning.com/pbrown"&gt;http://manning.com/pbrown&lt;/a&gt;&lt;/p&gt;&lt;h4&gt;So what&amp;rsquo;s in store?&lt;/h4&gt;&lt;p&gt;With the release of Windows 7 and .NET 4, I can&amp;rsquo;t think of a better time to get back into the Windows Client space. Windows 7 is the most exciting OS in some time. I remember my friend and I going down to the store on our lunch break on release day to get Windows 95, and then barely able to contain ourselves from trying out the install on our work PCs (running Windows for Workgroups 3.11).&lt;/p&gt;&lt;p&gt;My goal over the next year is to show just how exciting Windows client development really is. Unlike web tech, client technology tends to be hidden behind firewalls, and inaccessible to the public. I want to change that, and provide ways for you all to showcase the the awesome apps you are creating every day. &lt;strong&gt;If you are creating something cool/useful/fun/interesting, tell me.&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;I&amp;rsquo;m also looking into doing some interesting web/desktop hybrid samples using the newer MS releases combined with client tech.&lt;/p&gt;&lt;p&gt;Oh, and when WPF was still known as Avalon, I started a kitchen PC project. I set it aside, and despite seeing some commercial implementations of the same, it may be good to reopen and open source that project.&lt;/p&gt;&lt;p&gt;That&amp;rsquo;s just the start. Once I get in there and start working with the rest of the teams, who knows what&amp;rsquo;s in store :)&lt;/p&gt;&lt;p&gt;&lt;strong&gt;And, of course, I&amp;rsquo;m here for you all. Tell me what interests you and then tell me what &lt;u&gt;excites&lt;/u&gt; you&lt;/strong&gt;.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3905" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=4LajTUXEW38:oR3FB_R5W3k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=4LajTUXEW38:oR3FB_R5W3k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=4LajTUXEW38:oR3FB_R5W3k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=4LajTUXEW38:oR3FB_R5W3k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=4LajTUXEW38:oR3FB_R5W3k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=4LajTUXEW38:oR3FB_R5W3k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=4LajTUXEW38:oR3FB_R5W3k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=4LajTUXEW38:oR3FB_R5W3k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/4LajTUXEW38" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Microsoft/default.aspx">Microsoft</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight+in+Action/default.aspx">Silverlight in Action</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Windows+Forms/default.aspx">Windows Forms</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WindowsClient/default.aspx">WindowsClient</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/09/19/Now-with-more-forehead_2100_-_2800_or_2C00_-a-happy-shade-of-blue_2900_.aspx</feedburner:origLink></item><item><title>What developer tweeps are using for their app dev</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/Z_vlmb6qWEM/What-developer-tweeps-are-using-for-their-app-dev.aspx</link><pubDate>Tue, 15 Sep 2009 02:57:15 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3895</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>0</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3895.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3895</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3895</wfw:comment><description>&lt;p&gt;Last week, I opened a &lt;a href="http://twtpoll.com/r/yyvbun" target="_blank"&gt;very unscientific poll&lt;/a&gt; on Twitter asking what MS technologies developers were using to build their current in-progress applications. It was retweeted about within the &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; community, but also with broader reach folks like Scott Hanselman, Brad Abrams, and Phil Haack, as well as a few people in the Windows Forms community.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/WhatdevelopersonTwitterareusingfortheira_D932/image.png" target="_blank"&gt;&lt;img style="border-right-width:0px;margin:5px;display:inline;border-top-width:0px;border-bottom-width:0px;border-left-width:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/WhatdevelopersonTwitterareusingfortheira_D932/image_thumb.png" width="400" height="434" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;(Please note that I allowed for multiple choices, to account for hybrid or multi-faced applications and simultaneous multi-project development).&lt;/p&gt;  &lt;p&gt;Considering the community of people who saw the RTs numbers somewhere in the 20k range, the sample size here is a bit small. However, you can still glean some interesting information from it. &lt;/p&gt;  &lt;p&gt;One interesting little stati is compiled client code (WPF, Windows Forms, C++, Silverlight) vs. browser-based HTML/JavaScript (ignoring “other”):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Code-on-Client: 386 votes&lt;/li&gt;    &lt;li&gt;HTML/JS: 404 votes - no, I didn’t make that up :) &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That’s a pretty close split considering that &lt;a href="http://twitter.com/pete_brown" target="_blank"&gt;Twitter&lt;/a&gt; leans more heavily towards people working in web development. &lt;strong&gt;I can almost guarantee that Windows Forms and WPF are underrepresented in those numbers&lt;/strong&gt;, but even at almost 50% it shows that code-on-the-client is still a big force in business application development. Keep in mind as well that I didn’t ask about XNA. While a business app in XNA could be pretty cool, I figured those were few and far-between :)&lt;/p&gt;  &lt;p&gt;I fully expect widespread adoption of Windows 7 (which is a very cool platform to develop for), as well as .NET 4 and the next version of Silverlight to make this an even more compelling story.&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3895" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=Z_vlmb6qWEM:_mWJ_DI6s10:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=Z_vlmb6qWEM:_mWJ_DI6s10:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=Z_vlmb6qWEM:_mWJ_DI6s10:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=Z_vlmb6qWEM:_mWJ_DI6s10:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=Z_vlmb6qWEM:_mWJ_DI6s10:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=Z_vlmb6qWEM:_mWJ_DI6s10:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=Z_vlmb6qWEM:_mWJ_DI6s10:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=Z_vlmb6qWEM:_mWJ_DI6s10:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/Z_vlmb6qWEM" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/.NET/default.aspx">.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/WPF/default.aspx">WPF</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Windows+Forms/default.aspx">Windows Forms</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/CPP/default.aspx">CPP</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/09/14/What-developer-tweeps-are-using-for-their-app-dev.aspx</feedburner:origLink></item><item><title>Divine Vision, black helicopters, or sleep deprivation?</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/luATBrs1zKQ/Divine-Vision_2C00_-black-helicopters_2C00_-or-sleep-deprivation_3F00_.aspx</link><pubDate>Mon, 17 Aug 2009 03:58:29 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3872</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>2</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3872.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3872</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3872</wfw:comment><description>&lt;p&gt;Today, while sitting at the kitchen table at my sister in law’s house in PA, waiting for my nephew’s 9th birthday party to kick into gear, I had a vision. By vision, I mean something along the lines of the &lt;a href="http://www.mahalo.com/jesus-cheeto" target="_blank"&gt;Cheesus&lt;/a&gt;, &lt;a href="http://www.keyc.com/node/13991" target="_blank"&gt;chipotle Mary&lt;/a&gt;, &lt;a href="http://www.blacktable.com/gillin041202.htm" target="_blank"&gt;chipped Jesus on toast&lt;/a&gt;, or &lt;a href="http://www.msnbc.msn.com/id/6511148" target="_blank"&gt;Virgin Mary grilled cheese&lt;/a&gt; sandwich kinds of revelations -- but perhaps closer to the &lt;a href="http://www.dvorak.org/blog/2008/07/30/i-believe-in-cheesus/" target="_blank"&gt;Dvorak toast&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.irritatedvowel.com/pub/blog/DivineVisionorBlackHelicopters_146B6/image.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/DivineVisionorBlackHelicopters_146B6/image_thumb.png" width="234" height="222" /&gt;&lt;/a&gt; &lt;a href="http://www.irritatedvowel.com/pub/blog/DivineVisionorBlackHelicopters_146B6/image_3.png" target="_blank"&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/DivineVisionorBlackHelicopters_146B6/image_thumb_3.png" width="244" height="210" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Was it a freak trick of lighting, a divine revelation, or was a Microsoft satellite using lasers to beam the image into the house, to the wall, to convince my 9yo cousin to lay off the Wii and get a real computer and waste countless hours in InPrivate mode instead of pretending to exercise in front of the TV?&lt;/p&gt;  &lt;p&gt;Is it a message to me to go door-to-door and inform people of the irresponsibility of staying on IE6? A blessed endorsement of IE8? Was I just seeing things because I’ve been up too late working on &lt;a href="http://silverlight.net" target="_blank"&gt;Silverlight&lt;/a&gt; projects?&lt;/p&gt;  &lt;p&gt;Nerd Pareidolia. You decide.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;(All in good fun - no offense intended to anyone, except maybe someone who thinks revelations come from frito-lay. Please pipe all complaints to /dev/null.)&lt;/em&gt;&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3872" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=luATBrs1zKQ:Mlace5UJ538:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=luATBrs1zKQ:Mlace5UJ538:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=luATBrs1zKQ:Mlace5UJ538:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=luATBrs1zKQ:Mlace5UJ538:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=luATBrs1zKQ:Mlace5UJ538:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=luATBrs1zKQ:Mlace5UJ538:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=luATBrs1zKQ:Mlace5UJ538:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=luATBrs1zKQ:Mlace5UJ538:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/luATBrs1zKQ" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/IE/default.aspx">IE</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Web+Development/default.aspx">Web Development</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/08/16/Divine-Vision_2C00_-black-helicopters_2C00_-or-sleep-deprivation_3F00_.aspx</feedburner:origLink></item><item><title>Expression Blend 3 + SketchFlow RTW</title><link>http://feedproxy.google.com/~r/PeteBrown/~3/aLTKobvsxM0/Expression-Blend-3-_2B00_-SketchFlow-RTW.aspx</link><pubDate>Thu, 23 Jul 2009 21:56:33 GMT</pubDate><guid isPermaLink="false">cacdcc58-34f3-4df0-8221-29ec23b1c1c3:3842</guid><dc:creator>Pete.Brown</dc:creator><slash:comments>2</slash:comments><comments>http://community.irritatedvowel.com/blogs/pete_browns_blog/comments/3842.aspx</comments><wfw:commentRss>http://community.irritatedvowel.com/blogs/pete_browns_blog/commentrss.aspx?PostID=3842</wfw:commentRss><wfw:comment>http://community.irritatedvowel.com/blogs/pete_browns_blog/rsscomments.aspx?PostID=3842</wfw:comment><description>&lt;p&gt;Congratulations to the Microsoft Expression teams for &lt;a href="http://www.microsoft.com/expression/" target="_blank"&gt;another great release&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;If you are an MSDN Premium subscriber, you’ll probably want to wait a week or so until Expression Studio 3 show up on MSDN. That will take about a week or so. The exciting news buried in that sentence is that &lt;strong&gt;MSDN Premium Subscribers will get all of Expression Studio 3 (including SketchFlow) as part of their subscription&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;You can download and install the trial now if you wish, but you’ll need to uninstall once you get the MSDN version.&lt;/p&gt;  &lt;p&gt;&lt;img style="border-bottom:0px;border-left:0px;margin:5px;display:inline;border-top:0px;border-right:0px;" title="image" border="0" alt="image" src="http://www.irritatedvowel.com/pub/blog/ExpressionBlend3SketchflowRTW_FB6F/image.png" width="502" height="105" /&gt;&lt;/p&gt;&lt;img src="http://community.irritatedvowel.com/aggbug.aspx?PostID=3842" width="1" height="1"&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=aLTKobvsxM0:bL1iF-eKmRM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=aLTKobvsxM0:bL1iF-eKmRM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=aLTKobvsxM0:bL1iF-eKmRM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=aLTKobvsxM0:bL1iF-eKmRM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=aLTKobvsxM0:bL1iF-eKmRM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=aLTKobvsxM0:bL1iF-eKmRM:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/PeteBrown?a=aLTKobvsxM0:bL1iF-eKmRM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/PeteBrown?i=aLTKobvsxM0:bL1iF-eKmRM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/PeteBrown/~4/aLTKobvsxM0" height="1" width="1"/&gt;</description><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Expression+Design/default.aspx">Expression Design</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Expression+Blend/default.aspx">Expression Blend</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Expression+Encoder/default.aspx">Expression Encoder</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/Expression+Web/default.aspx">Expression Web</category><category domain="http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/tags/SketchFlow/default.aspx">SketchFlow</category><feedburner:origLink>http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2009/07/23/Expression-Blend-3-_2B00_-SketchFlow-RTW.aspx</feedburner:origLink></item></channel></rss>
