Pre-build out the XAML at app start (or On Navigated to)?

71 Views Asked by At

I've got a Windows Phone 8.1 app with a user preferences page. There is a color picker on that page that is initially 'collapsed' until the user taps a part of the page. When they do, it takes XAML about 3 seconds to build the color picker (140 little colored text blocks all bound to a list). The user sees a 3-second delay the first time they tap on the control. Once rendered, coming back to that color picker a second time (as long as the page has remained open) is instantaneous.

Basically, I've got a really complicated XAML page with hundreds and hundreds of Textboxes and I want to pre-build it so there's no delay when I want to display it.

Is there a way I can tell XAML or my code-behind to pre-build the color picker so that it's ready to display if and when the user taps on the box to show it?

I have seen the answer to a similar question at: How to preload XAML at app startup? and I don't understand it, or even know if it applies to me.

1

There are 1 best solutions below

2
On

The question you are referring to have answer to your problem. If you need to load so many items then you can use that approach. The only thing you need to keep in mind is that if user taps to make color picker visible before it's fully loaded then it will not be ready and a delay will be shown.