<Canvas>
<Ellipse x:Name="elips" Width="200" Height="100" Canvas.Left="100" Canvas.Top="50" >
<Ellipse.Fill>
<SolidColorBrush x:Name="renk" Color="Red"/>
</Ellipse.Fill>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.MouseEnter">
<BeginStoryboard>
<Storyboard x:Name="story1">
<ColorAnimationUsingKeyFrames AutoReverse="False" Duration="0:0:1" Storyboard.TargetName="renk" Storyboard.TargetProperty="Color" >
<LinearColorKeyFrame KeyTime="0:0:0" Value="Red"/>
<LinearColorKeyFrame KeyTime="0:0:1" Value="Green"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Ellipse.MouseLeave">
<BeginStoryboard>
<Storyboard x:Name="story2">
<ColorAnimationUsingKeyFrames AutoReverse="False" Duration="0:0:1" Storyboard.TargetName="renk" Storyboard.TargetProperty="Color" >
<LinearColorKeyFrame KeyTime="0:0:0" Value="Green"/>
<LinearColorKeyFrame KeyTime="0:0:1" Value="Red"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard x:Name="story3">
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="(Canvas.Left)" From="10" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Height" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Width" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Button x:Name="Basla" Width="100" Height="20" Content="MOUSE OVER" Canvas.Top="10" Click="Basla_Click"/>
<Button x:Name="Dur" Width="100" Height="20" Content="MOUSE LEAVE" Canvas.Top="30" Click="Dur_Click"/>
<Button x:Name="tekrarla" Width="100" Height="20" Content="TEKRARLA" Canvas.Top="50" Click="tekrarla_Click"/>
</Canvas>
private void Basla_Click(object sender, RoutedEventArgs e)
{
story1.Begin();
}
private void Dur_Click(object sender, RoutedEventArgs e)
{
story2.Begin();
}
private void tekrarla_Click(object sender, RoutedEventArgs e)
{
story3.Begin();
}
<Ellipse x:Name="elips" Width="200" Height="100" Canvas.Left="100" Canvas.Top="50" >
<Ellipse.Fill>
<SolidColorBrush x:Name="renk" Color="Red"/>
</Ellipse.Fill>
<Ellipse.Triggers>
<EventTrigger RoutedEvent="Ellipse.MouseEnter">
<BeginStoryboard>
<Storyboard x:Name="story1">
<ColorAnimationUsingKeyFrames AutoReverse="False" Duration="0:0:1" Storyboard.TargetName="renk" Storyboard.TargetProperty="Color" >
<LinearColorKeyFrame KeyTime="0:0:0" Value="Red"/>
<LinearColorKeyFrame KeyTime="0:0:1" Value="Green"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Ellipse.MouseLeave">
<BeginStoryboard>
<Storyboard x:Name="story2">
<ColorAnimationUsingKeyFrames AutoReverse="False" Duration="0:0:1" Storyboard.TargetName="renk" Storyboard.TargetProperty="Color" >
<LinearColorKeyFrame KeyTime="0:0:0" Value="Green"/>
<LinearColorKeyFrame KeyTime="0:0:1" Value="Red"/>
</ColorAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="Window.Loaded">
<BeginStoryboard>
<Storyboard x:Name="story3">
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="(Canvas.Left)" From="10" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Height" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Width" From="100" To="200" Duration="0:0:2"/>
<DoubleAnimation Storyboard.TargetName="elips" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:2" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Button x:Name="Basla" Width="100" Height="20" Content="MOUSE OVER" Canvas.Top="10" Click="Basla_Click"/>
<Button x:Name="Dur" Width="100" Height="20" Content="MOUSE LEAVE" Canvas.Top="30" Click="Dur_Click"/>
<Button x:Name="tekrarla" Width="100" Height="20" Content="TEKRARLA" Canvas.Top="50" Click="tekrarla_Click"/>
</Canvas>
private void Basla_Click(object sender, RoutedEventArgs e)
{
story1.Begin();
}
private void Dur_Click(object sender, RoutedEventArgs e)
{
story2.Begin();
}
private void tekrarla_Click(object sender, RoutedEventArgs e)
{
story3.Begin();
}
Hi Goes Teacher I Love You Sow Mach..
YanıtlaSil