How can I create a “wipe” effect to transition between two images in WPF?

In film editing a “wipe” is a technique for transitioning from one scene to another. We can create a similar effect in WPF by overlapping two items (for instance by placing them both in a single-cell grid) and specifying a LinearGradientBrush as the OpacityMask on the top-most item.  Then by animating the Offset property of the GradientStops of the brush we can create the wipe effect. By modifying the start time of the second DoubleAnimation you can modify the width of the “in-between” area.  An earlier start-time will give a narrower region that shows pieces of both items.

Xaml Code (RC1)
<Window x:Class=“LearnWPF.WipeEffect.Window1”
    Title=“LearnWPF.WipeEffect” Height=“500” Width=“700” Name=“mainWindow”
      <Image Source=“Images/UFO.jpg” />
      <Image Source=“Images/ladder.jpg”>
          <LinearGradientBrush StartPoint=“0,0” EndPoint=“1,0”>
              <GradientStop Offset=“0” Color=“Black” x:Name=“BlackStop”/>
              <GradientStop Offset=“0” Color=“Transparent” x:Name=“TransparentStop”/>
    <EventTrigger RoutedEvent=“Window.Loaded”>
            <DoubleAnimation Storyboard.TargetName=“TransparentStop”
                             Storyboard.TargetProperty=“Offset” By=“1”  Duration=“0:0:2”   />
            <DoubleAnimation Storyboard.TargetName=“BlackStop”
                             Storyboard.TargetProperty=“Offset” By=“1” Duration=“0:0:2”
                             BeginTime=“0:0:0.05” />


A BeginTime of 50ms for the second animation produces a “tighter” wipe A BeginTime of 1 second for the second animation produces a more gradual transition
earlier start time on second animation Longer begin time