1.
Double Animation
<Canvas>
<Rectangle Name="menu1" Height="100" Width="100" Canvas.Top="10" Canvas.Left="10" Stroke="Bisque" StrokeThickness="5" Fill="LightSeaGreen" >
<Rectangle.Triggers>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard x:Name="story1">
<DoubleAnimation Storyboard.TargetName="menu1" Storyboard.TargetProperty="(Canvas.Left)" From="10" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="menu1" Storyboard.TargetProperty="Height" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="menu1" Storyboard.TargetProperty="Width" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="menu1" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:2" AutoReverse="True" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
<Button Height="50" Width="50" Canvas.Top="150" Canvas.Left="10" Click="Button_Click_1"></Button>
</Canvas>
private void Button_Click_1(object sender, RoutedEventArgs e)
{
story1.Begin();
}
Yorumlar
Yorum Gönder