locked
Custom WinControl slows loading of ListView

    Question

  • I am noticing that my ListViews are taking a long time to load. I eventually tracked down one of the issues being that I have a custom winControl within the ListView items' template. The purpose of the custom winControl is to display a loading indicator until the item's image has been loaded. (@see https://social.msdn.microsoft.com/Forums/en-US/7234abc0-3555-466f-b1e8-811deb35f24b/changing-default-loading-animation-of-mediaplayer?forum=winappswithhtml5)

    If I remove the winControl and load the image directly in the item's template, then the loading of the ListView is cut from 3 seconds to about 1 second, which is much more reasonable. However, even a load time of about 1 second still causes a problem. My main launch page has 4 ListViews. The 1 second delay causes a cascading effect where one loads immediately after another.

    1. I still need the custom winControl. How do I speed up the listView with the winControl?
    2. When the winControl is not present, is there a way to speed up the loading of the listView then? 


    Monday, October 20, 2014 5:59 PM

All replies

  • Hi Jaxim,

    Here I have some ideas, for instance we can extend the Splash screen time to leave more time for your page, or can we decide the launch flow of the page.

    See more information here: http://blogs.msdn.com/b/windowsappdev/archive/2012/05/21/creating-a-fast-and-fluid-app-launch-experience.aspx

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Wednesday, October 22, 2014 7:56 AM
    Moderator
  • Just for verification I would create an empty custom control and display that instead of your loading indicator. This is to check wether any control creates the issue or if the implementation of your custom control is such that it's slow which is causing the slowdown.

    How many items are contained in your respective ListViews? Do those ListViews use virtualization as creating a huge number of controls is going to take quite a long time?

    Wednesday, October 22, 2014 9:03 AM
  • On my launch page I have 4 hubs. Three of them have 6 items each. The ListView in the last hub (the 1st hub) has 3 items. The first hub loads instantly - maybe because it is the 1st hub. The remaining hubs load one after 4 each other.

    I also use this custom control on other (sub) pages. I have noticed that there is a delay in loading the subpages with those listViews. Same goes for the launch page, when I click the back button from a sub page - there is a noticeable delay in returning back to the launch page.

    The page not loading immediately is probably a bigger issue because it makes the app seem unresponsive. I have fixed this issue by creating a timeout timer that delays the loading of the listView(s) on that page. The delay can only be 1 millisecond, but it's a long enough of a delay to get the pages to navigate immediately. Once the timeout timer is done, then I load the ListView.

    When the app 1st loads, I also continue to display the splash page until all 4 ListViews on the launch page had loaded. This helps the appearance of the app at launch, but it still doesn't fix the issue of the listViews are not visible for 2 seconds when the user goes back to the launch page from a subPage.

    If I remove the loading of the image within the custom control, then the listView loads probably a second faster. If i remove the custom control and load the image directly into the ListView Items, then that too is about 1 second (maybe more than 1 second) faster than the normal custom control. One second doesn't seem very long, but I think having to wait for the listViews to load for nearly 2 seconds while watching a page w/ no content is pretty noticeable. I think <= 1 second would be ideal.

    Two second may not be ideal, but it's probably something I can live with for now. It;s much better than better now that I create a timer delay and way to show all the listViews until all of the listViews are done loading.

     

    Wednesday, October 22, 2014 2:45 PM