by Administrator 3. August 2009 23:38

This weekend I was trained in the ancient art of Sabrage for Champagne (or sparkline wine).  Rather than the pedestrian practice of removing the cage and pushing on the cork with your thumbs, you chop the top off of the bottle with a champagne saber or chef’s knife.  Here’s my first successful cut:



There is, as you may suspect, a trick to it.  I was taught the ancient secrets by sensei Phil at Thief Wine.  As if my love for Champagne wasn’t already great enough, now I also have an amazing party trick to go with it.


New Server

by Administrator 3. August 2009 23:33

I have just switch over to some better iron.  If you’re seeing this, all is well!


Silverlight 3 Clipping Animation

by Administrator 15. July 2009 01:46

One natural way to create some visual effects would seem to be animating the clipping path of a visual element.  Sitting down in either Visual Studio or Blend 3 will immediately show there’s not a straightforward way to do this.  There have been some other means of doing this posted online involving  creating a Storyboard and DoubleAnimation entirely in a code-behind.  Since one of our goals when using Silverlight and Blend should be a clean designer/developer separation,  I didn’t care for this approach. 

We’re going to build a “wipe” effect using animation and clipping paths and the only code behind will be the Storyboard trigger.


I’m first going to create a Silverlight 3 Navigation application and throw in my own styles.  I add a Page called AnimateClip.xaml and throw in a DataGrid containing some sample wine data and a button I can push to test the “wipe” effect.  The application looks like this when I navigate to the new page:



DataGrid XAML

I’m going to apply the Wipe effect to the DataGrid.  Here’s the initial XAML defining my grid.  As you’ve already seen above I created some Sample Wine data to populate the DataGrid.

<data:DataGrid x:Name="WineGrid" AutoGenerateColumns="True" IsReadOnly="True" CanUserResizeColumns="True" Grid.Row="1" Width="500" Height="200" RenderTransformOrigin="0,.5">
        <RectangleGeometry Rect="0,0,500,200">
                <ScaleTransform x:Name="WipeScale" ScaleX="1" ScaleY="1"/>

Note that I’ve given the DataGrid a clipping geometry that exactly matches the bounds the DataGrid has anyway.  The RectangleGeometry gets its dimensions from a Rect property.  The struct Rect has a Width property, but Rect.Width does not appear to be backed by a DependecyProperty, so we can’t simply animate the Width of a Rect.  Without creating new Rect structs and manually animating in C#, some trial and error was needed in order to find a workable XAML-only solution.  The solution is to name the ScaleTransform and animate its Properties.

I’m going to create the Storyboard manually in XAML, we’ll see why when moving to Blend 3 in a minute.

<Storyboard x:Name="WipeGrid">
    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="WipeScale"
        <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
        <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0"/>

So, this is fairly simple once we figure out how to effectively animate the bounds of the DataGrid.  Ordinarily this Storyboard would produce a uniform “shrink in” effect.  The default RenderTransformOrigin is of course the very center of a UIElement.  Because the RenderTransformOrigin of the DataGrid is set to 0, .5 we get the desired “wipe” effect as we are calculating from the left side rather than the center.

When I press the Wipe Out button the code-behind starts the Storyboard.  The wipe effect now works as desired.


As I enjoyed how the wipe effect looked, I thought perhaps I’d use some of the new built in easing functions to make it even better.  In the recently released Expression Blend 3 + SketchFlow, this is what I see when attempting to edit my Storyboard:


Despite the fact that the Storyboard works,  the clipping path is missing something needed for Blend to be able to show it for timeline editing.  I assume this is because it’s technically not a visual element in the tree, but just a humble RectangleGeometry used to modify a visual element.  I really don’t feel like learning the ins and outs of all of the easing functions and their parameters, so for now I had to create a bogus storyboard and copy it to this Page.  The Quadratic Ease (InOut) produced the effect I was going for.

<Storyboard x:Name="WipeGrid">
    <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="WipeScale"
        <EasingDoubleKeyFrame KeyTime="00:00:00" Value="1">
                <QuarticEase EasingMode="EaseInOut"/>
        <EasingDoubleKeyFrame KeyTime="00:00:00.5000000" Value="0">
                <QuarticEase EasingMode="EaseInOut"/>

So, while that would not be bad as far as hand-crafting XAML it would be better if I didn’t have to build fake Storyboards to create my visual effects.  With a more complex Storyboard mistakes might be made in the manual copy & conversion process.  You now have an alternate way to animate clipping paths in Silverlight using XAML.


INETA Regional Speaker

by Administrator 5. July 2009 20:06

I have just applied to join the recently created INETA Regional Speaker program.  It’s unclear whether or not there is an approval process.  This program is meant for people who “are not ready for the national program”; read: I’m no Scott Hanselman.  This is the “farm team” for the national program.  I have asked them to add Parallel Programming as a topic and I hope to take my Silverlight and PFX show on the road.


MVP Award: Client App Dev

by Administrator 1. July 2009 17:11

I am proud to be able to announce today that I have been award the Microsoft MVP award in the proficiency of Smart Client technologies. 

I’m extremely appreciative of my nomination and of my new MVP Lead Suzanna Moran.  I’m already excited about the summit next year!  There’s a lot of exciting things coming from MSFT, and I’ve got a lot of community involvement planned for the coming year.


Getting hammered

by Administrator 26. June 2009 20:58

Personal updates: there is no code in this post!

The next stage in my career starts soon, as I have accepted a new full time position as a senior engineer with Big Hammer.

I will say only that I’m very excited about this role.  The interview process showed me that there are some fantastic people there, and I expect to have to work very hard to catch up to them.  Let’s be honest, you can’t top that company name either!  I will be taking care of loose ends next week and spending some time with my family.

I also bought something today.

Something big.

Quite possibly the most irresponsible expenditure I have ever made.

You will have to wait some time to learn of it…


Solid thinking

by Administrator 23. June 2009 00:26

My wonderful workstation has not been super stable over the course of the past year; no, it wasn’t Vista.  Most of my issues were related to my network card, on-board my P5N-T.  Things like rebooting (vs. starting cold) would usually lose my Blu-ray drive, some apps would not run due to the network issues, occasionally on cold boot Vista would report that my BIOS was not ACPI compatible.  My circle of hardware buddies agree the motherboard had to go.  I will never buy an nForce chipset again.

I’ve been dealing with a couple of reasonably sized databases and a lot of image processing, so I was about out of disk space on my Raptor.  I decided to dip my toe into the realm of solid state storage.  The best drives seem to be made by Intel however they also carry the largest price premiums, $700 for 64GB is a bit steep.  I did some research and decided on the OCZ Vertex series, $375 for 120GB.  Still not cheap, but with excelled claimed specs I thought I could at least experiment.  I got a 2.5” –> 3.5” converter and rebuilt my main workstation with Win7, the new Gigabyte mobo, and the SSD.

SSD Performance

Windows 7 installed very fast but I didn’t have the foresight to time it.  Windows 7 can shut down in 2 seconds.  Visual Studio 2008 installed in 9 minutes ( I think it was 45 last time).  Office 2007 installed in 5 minutes.  Write speed was looking very good.  Visual Studio 2008 could be launched literally as fast as I could hit the button.  Later, once I had VS add-ins, startup was less stellar. 

Much of the boot time is in the BIOS and can’t be helped except by better BIOS.  Still, once I get to the point where Windows is loading it takes about 10 seconds.  Read speeds are looking very good.  When playing Left 4 Dead, I’m the first one into the map – the speedups here weren’t quite what I expected due to the amount of the work being network related.

All in all, I’m still very happy.  It’s very easy to get used to, I feel like it must not be that fast anymore until I boot up my laptop (no slouch!) and realize this workstation is in fact insanely fast.  I don’t see quite the crazy performance you can read about here but then again I cheaped out, relatively speaking.

All in all, I can’t wait for this technology to go mainstream.

Windows 7

When Vista was getting bad press, I was scratching my head.  I’ve had no Vista related issues.  Now that I’m running the Win7 RC on a critical machine, I’m scratching my head again.  Win7 is getting fantastic press and it seems so incredibly similar to Vista that I have to attribute both cases to the hype machine.  I like jump lists and the new task bar, I can’t comment on how responsive it is since I’ve made major hardware changes.

My Win7 issues have been extremely small, which I would expect since I’m really looking at a slightly prettier version of the Vista kernel.  I have had some warnings like “Install SP1 before running SQL Server 2008” and once in a while when I recover from sleep mode one of my monitors won’t come back to life without flipping the switch on and off.  I wasn’t up to speed with what was in and out of Win7, so I was disappointed that WMP didn’t automagically play my blu-ray discs but I’ll survive.

It’s nice to see Microsoft getting some positive press.  I just hope I can transition to a “real” version of Win7 without rebuilding my machine.


Parallel xUnit source

by Administrator 28. May 2009 19:27

As promised, I am releasing my Parallel xUnit solution built on top of the Task Parallel Library.  Last year I released partial code for a solution built on top of my own thread pool.  I updated the solution for xUnit 1.1 and used the previous CTP of the Parallel Extensions for .NET; the code should also work with the recently released .NET 4/VS 2010 beta. 

As shown in my Parallel Extensions talk at the FVNUG Day of .NET, the unit of parallelism here is the class.  Enjoy, and please send me any comments.

Download xunit 1.1 with parallel test runner


Consider it &ldquo;Mixed up&rdquo;

by Administrator 20. May 2009 02:04

For me, the Mix it Up! Tour is over.  Chicago (qua spectator), Indianapolis, Milwaukee, Madison, Appleton (also doing a Parallel Extensions talk at the Fox Valley Day of .NET) , and Eau Claire.  I wish the other folks who are still finishing up some tour dates good luck and I hope they make the necessary bad jokes during my demo code.

I can now return to my regularly scheduled tech blogging.  I’ve got a lot of incubating things that need to be blogged about as well as posting some code related to the Mix it Up! Tour.

Time to rock out some .NET 4 and blog about it.



Fox Valley Day of .NET flyer

by Administrator 5. May 2009 20:35

The Fox Valley .NET user’s group has posted a hand-out for the two sessions I’m doing this Saturday.  Cool!

{Edit: Here's the schedule of events too. I hope to see familiar faces there tomorrow.}


About the author

Damon Payne is a Microsoft MVP specializing in Smart Client solution architecture. 

INETA Community Speakers Program

Month List

Page List

flickr photostream