Я придумал решение, которое выглядит довольно хорошо. Пример XAML, который я записал в Blend 2.0 SP1, выглядит следующим образом:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ScreenGlintApplication.Window1"
x:Name="Window"
Title="Window1"
Width="500" Height="250" Background="#FF000000" Foreground="#FF3EE229" >
<Grid x:Name="LayoutRoot">
<TextBlock TextWrapping="Wrap" FontSize="40" >
<Run Text="This is some sample text to have something to work with. Have a nice day! /Johan"/>
</TextBlock>
<Canvas Panel.ZIndex="99" >
<Rectangle x:Name="ScreenGlintRect"
Width="{Binding Path=ActualWidth, ElementName=Window, Mode=Default}"
Height="{Binding Path=ActualHeight, ElementName=Window, Mode=Default}"
Opacity="0.4" >
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="ScreenGlintRect"
Storyboard.TargetProperty="(Canvas.Left)"
From="-500" To="1000" Duration="0:0:2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,1" EndPoint="1,1">
<GradientStop Color="Transparent" Offset="0.0" />
<GradientStop x:Name="GlintColor" Color="LightGreen" Offset="0.50" />
<GradientStop Color="Transparent" Offset="1" />
</LinearGradientBrush>
</Rectangle.Fill>
</Rectangle>
</Canvas>
</Grid>
</Window>
Можно сделать это в коде, что довольно удобно, если вы хотите иметь детальный контроль над анимацией. Например:
ScreenGlintRect.Width = Width;
ScreenGlintRect.Height = Height;
var animation = new DoubleAnimation
{
Duration = new Duration(TimeSpan.FromSeconds(2)),
From = (-Width),
To = Width * 2
};
ScreenGlintRect.BeginAnimation(Canvas.LeftProperty, animation);
Это код, который я использую, и он выглядит достаточно хорошо для меня. Если вы получили ускорение HW, вы можете попробовать добавить к нему немного размытия. Возможно, вам придется настроить код и скрыть / показать прямоугольник, но в основном это все.