The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
[UWP][XAML] Windows 10 UWP app (XAML and C#): Sometimes images are not loaded after resume RRS feed

  • Question

  • Hi all,

    I have problems I cannot resolve connected with a Windows 10 UWP app/game (Yatzy Free - http://bit.ly/YatzyFree). The reason why this is bit more critical is because the game is very dependent on images (showing dice, dice holders, levels, game types and so on.) and sometimes when this issue happens the game logic appears as if its broken.

    More details:
    - there is no strict scenario to recreate but it happens when the app is the background for some time (the app is suspended), and when you resume it and continue using it some images are not shown
    - Most of the time happens on mobile (various mobile devices)
    - random images are disappearing (some times is button, dice, dice holder, level progress...). Both for images set as uri source in XAML, XAML binding, or images created in code behind (it doesn't matter)
    - when an image dispersals from one place it also not shown in every instance of that same image
    - Only the image is not shown however the UI element acts normally (i.e. if the case is button, you can't see the button, but if you know the exact position you can click it and the code behind will be executed as it should)

    Have you had similar problem? any suggestions?

    Regards,
    Stevan Mitic.
    Tuesday, October 25, 2016 12:25 PM

All replies

  • Hi Seavus Games,

    >>” nd sometimes when this issue happens the game logic appears as if its broken.”

    I want to know if you can get some exception message? You could debug your app in the real device.

    >>” random images are disappearing (some times is button, dice, dice holder, level progress...). Both for images set as uri source in XAML, XAML binding, or images created in code behind”

    We really need a simple reproducible code sample to reproduce the problem. You can remove any confidential information or business logic from it.

    Best Regards,

    Xavier Eoro


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 26, 2016 6:12 AM
  • Hi Xavier,

    >>” nd sometimes when this issue happens the game logic appears as if its broken.”
    There are not exceptions happening when the images are disappearing, the only noticeable thing is that the image is missing. You can continue playing the game as everything is normal, but as I mentioned that the game is pretty depended on images, and it looks like the logic is broken. 
    Simple example from the game flow: after rolling the dice you can choose which dice you want to hold for the next roll, now when you hold a dice I show dice holder image that looks like the dice is locked. Now when this issue happens with the dice holder image, the image is not shown when you hold a dice and it looks like the game logic is broken.

    It looks to me more like a memory/or image redrawing issue on the platform.

    >>" We really need a simple reproducible code sample to reproduce the problem. You can remove any confidential information or business logic from it."
    For sure I cannot share the solution of the game, but I'll try to create some sample project and try to reproduce the issue. If I succeed in this, I'll share the project here.

    Thank you,
    Stevan Mitic.

    Wednesday, October 26, 2016 7:03 AM
  • @Seavus Games

    Ok. I'll wait for your code sample :)


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, October 27, 2016 1:28 AM
  • Hi Xavier, 

    Unfortunately I could not create sample project where this issue could be recreated.

    Just for your reference here are two images where you can see how one control looks normal (with all images properly visible) and another image when this issue happens after resume (where some of the images are not visible, and some are distorted).

    Good one

    Bad one

    Friday, October 28, 2016 2:01 PM
  • Hi Stevan

    I also have this problem. I have a GridView with a bunch of Image controls. When the page is sent to the background sometimes one or two of the images are not shown when it is brought to the foregound again. It is completely random and the bug cannot be reproduced. 

    As most of my testing is on the WM emulator, I don't remember if the problem occurs on an actual device too.

    Saturday, October 29, 2016 4:25 PM
  • Hi binaryfish,

    I've never tested the app on emulator, we generally test our game on all types of devices and this issue happens on mobile devices after "fast application start" (where you don't purposely close the app, but you just leave it minimized), which from one side is very good feature because because it does what it says - fast start up, and usually avoids additional waiting from 1 to 5 seconds (when the splash screen is shown) and all code from OnLaunched event is executed, but on the other side this issue with the images happens 100% (from my experience so far) in this scenario of fast app start.

    Regarding the GridView, I can confirm that it happens both when showing items in items/list/grid view controls, however also happens when adding single custom user control on the visual tree (which is more common scenario in my experience with our game).

    Sunday, October 30, 2016 8:12 AM
  • I am experiencing the same problem. Have you been able to resolve it?
    Sunday, November 12, 2017 6:50 AM
  • Good to hear that I'm not the only one :P

    I have had the same problem with a game I written for the longest. It's hard to create a reliable repro since I yet to see the logic behind the occurrences (probably memory usage), but it does happens quite often. And it seems to happen more to images that are being animated.

    Please please please look into this.

    Thursday, January 25, 2018 7:46 PM
  • It happens with static images too. It can't be reproduced. It just appears randomly or should I say disappears randomly!
    • Edited by FishInPond Friday, January 26, 2018 1:29 AM
    • Proposed as answer by Kmors Friday, April 13, 2018 10:39 PM
    • Unproposed as answer by Kmors Friday, April 13, 2018 10:39 PM
    Friday, January 26, 2018 1:29 AM
  • Seems C++/XAML have similar issue on GridView of images on recently update of system, random images  were not loaded on the first time.  It maybe hardware issue, since my disk is slow, but as far as I can remember, it has never happened before.

    Fortunately, no user reported this by email. (over 1 million downloads.) So I thought it maybe my PC's problem. Sometimes it has exception, maybe 0x8000000A.






    • Edited by Exilerrr Friday, January 26, 2018 11:55 AM
    Friday, January 26, 2018 3:50 AM

  • It is happening after an sleep or hibernate, then the application make a refresh. To catch it, use the "OnNavigationTo" method and re-make the images when a refresh is detected.

    In my case , I'm using bindings for the paths of the images, mode: two way and UpdateSourceTrigger: property changed in xaml

     

    • Edited by Kmors Friday, April 13, 2018 11:17 PM
    Friday, April 13, 2018 10:43 PM
  • Has there been any update on this?  We are having the same issue, Windows 10 v 1809.  Adding new items to the list (each with its own image control) results in random images appearing.  This happens infrequently, and our customers are reporting to us when it does happen.  Makes the app look very unprofessional.

    Navigating away from the page and coming back does not fix the issue. It is only fixed by restarting the app completely.


    We use the ms-appx:/// URI scheme to grab an image from the package to display it, if that helps any.

    Friday, August 2, 2019 2:07 PM