I am working on a WPF application where I need smooth animations and transitions between pages.
On startup, I instantiate all my controls, with Visibility : Collapsed, and when I go from a control to another, I animate the two controls and change the visibility.
My problem is on a control with several images : the first time I display it, we don’t see the animation (probably because it loads the images in the same time). When I load it a second time, there’s no problem.
Is there a way to preload this control in order to always have smooth animations ?
In the codebehind you can have an event handler
OnLoaded()for when the your control is loaded for the first time. Here you can load in the images or even have them start asVisibleso they are loaded and at the end of the handler, have them go back to beingCollapsed.