<Canvas>
<Rectangle Height="50" Width="100" Stroke="Yellow" StrokeThickness="2" x:Name="rek" >
<Rectangle.Fill>
<SolidColorBrush Color="Black" x:Name="dikrenk"/>
</Rectangle.Fill>
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard x:Name="st1">
<ColorAnimationUsingKeyFrames AutoReverse="True" Duration="0:0:6" RepeatBehavior="Forever" Storyboard.TargetName="dikrenk" Storyboard.TargetProperty="Color">
<LinearColorKeyFrame KeyTime="0:0:0" Value="Black"/>
<LinearColorKeyFrame KeyTime="0:0:3" Value="Red"/>
<LinearColorKeyFrame KeyTime="0:0:6" Value="Yellow"/>
</ColorAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="rek" Storyboard.TargetProperty="(Canvas.Left)" From="10" To="100" Duration="0:0:6" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
<Rectangle Height="50" Width="100" Stroke="Yellow" StrokeThickness="2" x:Name="rek" >
<Rectangle.Fill>
<SolidColorBrush Color="Black" x:Name="dikrenk"/>
</Rectangle.Fill>
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard x:Name="st1">
<ColorAnimationUsingKeyFrames AutoReverse="True" Duration="0:0:6" RepeatBehavior="Forever" Storyboard.TargetName="dikrenk" Storyboard.TargetProperty="Color">
<LinearColorKeyFrame KeyTime="0:0:0" Value="Black"/>
<LinearColorKeyFrame KeyTime="0:0:3" Value="Red"/>
<LinearColorKeyFrame KeyTime="0:0:6" Value="Yellow"/>
</ColorAnimationUsingKeyFrames>
<DoubleAnimation Storyboard.TargetName="rek" Storyboard.TargetProperty="(Canvas.Left)" From="10" To="100" Duration="0:0:6" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</Canvas>
Yorumlar
Yorum Gönder