I’m trying to animate my window’s location.
SCENARIO:
I have a window, and when i click on my button, I want the window to move smoothly 100px from it’s current location.
EXAMPLE:
Private Sub minimize_button_Click(sender As System.Object, e As System.Windows.RoutedEventArgs) Handles minimize_button.Click
Dim windowsize as integer = window1.top
windowsize = windowsize - 100
End Sub
But with XAML animation. I have no idea how to make this animation in this type of scenario.
Any answer is appreciated, Sincerely VenoMDee.
I don’t believe you’re going to be able to do this with a XAML animation, but you could still achieve this effect through either a DispatcherTimer or a Storyboard.
With every tick (time-based frame) you can reset the position of the window in code. Just fire the ticks of the timer to reproduce about 40 frames per second (every 150 milliseconds).
Hope that helps!