Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

VB: How to return the image to its start position?

$
0
0

Hi Guys!

This is my first post.

I am very new to WPF and I am trying to keep the things simple.

I have

<Grid.Resources><Storyboard x:Key="TransformImage"><DoubleAnimation 
        Storyboard.TargetName="C1" 
        Storyboard.TargetProperty="(Image.RenderTransform).(TranslateTransform.X)"
        By="100" Duration="0:0:1"></DoubleAnimation></Storyboard><Storyboard x:Key="TransformImageBack"><DoubleAnimation 
        Storyboard.TargetName="C1" 
        Storyboard.TargetProperty="(Image.RenderTransform).(TranslateTransform.X)"
        By="-100" Duration="0:0:1"></DoubleAnimation></Storyboard></Grid.Resources><Grid.Triggers><EventTrigger RoutedEvent="Button.MouseEnter" SourceName="C1"><BeginStoryboard Storyboard="{StaticResource TransformImage}"/></EventTrigger><EventTrigger RoutedEvent="Button.MouseLeave" SourceName="C1"><BeginStoryboard Storyboard="{StaticResource TransformImageBack}"/></EventTrigger></Grid.Triggers>

It simply moves image C1.png on mouseover. First I thougth that moving -100 on mouseleave will send image back to its starting point. But back to position precesses if you don't wait for the first animation finishes completely.

Now what I need is to sent image to its start position without moving on X axis as -100. I am good with VB but I want to handle this in xml interface if it's possible.

Thanks a lot!







Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>