Controls on Pivot disappear

C#.NetWindows Phone-8

C# Problem Overview


I have an app with a pivot control. The pivot control has two items (pages), both contain a grid. The grids contain a few buttons and one a map and the other a text block. When the app first runs the pivot works as expected. However, after the app has been running some time, like a day, all the controls on the pivot disappear after pivoting (or swiping). They appear momentarily while swiping, but disappear again once the pivot rests.

Has anyone else experienced this? What could be the cause and solution?

Video: http://www.youtube.com/watch?v=nd7bfTJ53Nk

Code: https://github.com/JamieKitson/TrackLog/

C# Solutions


Solution 1 - C#

Quite old question, but still unanswered. It seems like it's because of Application_Deactivated event handler, which runs when application is sent to background:

private void Application_Deactivated(object sender, DeactivatedEventArgs e)
{
     diagLog("Deactivated, reason: " + e.Reason);
}

In this event handler you should set RunningInBackground = true

Hope that helps

Solution 2 - C#

I am facing the same issue, and its solved weirdly.

If I use Grid inside PivotItem this Issue comes but when I use some other control like StackPanel or something else it works fine.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJamie KitsonView Question on Stackoverflow
Solution 1 - C#UmriyaevView Answer on Stackoverflow
Solution 2 - C#Rahul SononeView Answer on Stackoverflow