locked
How can I handle FlipView currentPage change immediately? ("pageselected" event is very slow)

    Question

  • Hi all,

    I have a big FlipView that contains articles and everything works fine so far (except that items' display is sometimes delayed)

    I have some things to do each time the currentPage changes so I added an eventhandler on the "onpageselected" event but the event is firing sometimes 2 to 5 seconds after the page actually changed ... :(

    Is there something I can do to catch page changing event more immediatly?

    Thanks!

    Thursday, January 24, 2013 2:11 PM

Answers

  • Hi Pierre,

    I have taken it over from Matt and did some research on it.

    It seems there really is some work involved that results in this delay. At the moment, you'll have to do with pagevisibilitychanged event and work off of that to provide a little better experience.

    However, the right folks are aware about this problem and things MAY improve in the future.

    - Ashish [MSFT]


    Ashish Sahu [MSFT]

    Thursday, January 31, 2013 8:41 PM

All replies

  • Hi,

    I suggest you debugging first. And check why there has 2 to 5 seconds delay.

    #WinJS.UI.FlipView object (Windows)

    http://msdn.microsoft.com/en-us/library/windows/apps/br211711.aspx


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 25, 2013 9:41 AM
  • Hi,

    Thank you for your answer.

    This is what is weird: when I debug, my app doesn't do anything during those 2 to 5 seconds ... :(

    I have the feeling that everything's ready (the page of the FlipView is rendered and shows up in less than a second) but for some weird reason, the event is fired way after everything's complete ...

    I've even used VS 2012 performance analyzer to track any heavy resource consumption code but it doesn't point anything particularly greedy in CPU ...

    Friday, January 25, 2013 3:26 PM
  • Hi,

    I will involve more experts to investigate it.


    Roy
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, January 28, 2013 7:32 AM
  • Thanks, it would be great!

    FYI: I've calculated the render time for each page of the FlipView (the time my code takes to execute) and my pages take 5 to 10 milliseconds to render, therefore, it seems the FlipView event really has a problem...

    Monday, January 28, 2013 8:44 AM
  • Pierre - I'm checking into this and will update you when I know more.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, January 28, 2013 5:12 PM
    Moderator
  • Hi Matt,

    It would really make my day! :)

    I can't figure out why the event fires so late and since it handles an index visible on the page, the UI is really weird: when you change the current page of the FlipView, it updates the index with a delay of 2 to 5 seconds ... really not Fast & Fluid ... :(

    Wednesday, January 30, 2013 8:51 AM
  • Hi Pierre,

    I have taken it over from Matt and did some research on it.

    It seems there really is some work involved that results in this delay. At the moment, you'll have to do with pagevisibilitychanged event and work off of that to provide a little better experience.

    However, the right folks are aware about this problem and things MAY improve in the future.

    - Ashish [MSFT]


    Ashish Sahu [MSFT]

    Thursday, January 31, 2013 8:41 PM
  • Hi Ashish,

    Thank you for your answer!

    Just to be sure, to get the same behavior that the pageselected event, I'll have to filter the pagevisibilitychanged event on "e.detail.visible == true", is that correct?

    PS: It's good to see that common people like me can reach the right folks for problems like that, that's not the case for every OS on the market! ;)
    Friday, February 1, 2013 9:22 AM
  • Yes - you are right.

    - Ashish [MSFT]


    Ashish Sahu [MSFT]

    Friday, February 1, 2013 8:23 PM