How can I improve the performance of a slide animation?

256 Views Asked by At

Situation:

I have a keyboard (in the example a blue Rectangle) that slides in from the bottom of the window. I managed that animation with a Thicknessanimation that changes the MarginProperty of the keyboard. The "Content Grid" gets smaller and the content itself gets scrollable.

enter image description here

The animation works fine in the prototype but is too slow and stucks in the real application. I guess the content contains just too many controls and it calculates the shrinking for each frame.

Research:

In my research on improving the animation performance, I only came up with changing the frame rate of the animation.

In a tutorial for animated pages, they used the RenderTargetBitmap class to take a snapshot and only animated that snapshot in order to improve the performance.

Question:

Is the RenderTargetBitmap class the way to go? Are there other solutions and how would you improve the performance?

The goal is a slide in of a touch keyboard, like on the smartpone (e.g. iPhone).

Source:

MainWindow.xaml

MainWindow.xaml.cs

0

There are 0 best solutions below