0

As far as I have understood, if you register a periodic task to deal with your WP7 live tiles, it will not update more than once every half hour. However, I would like to update the data the background agent works on every time the user exits the app.

My scenario is that I have a live tile displaying the first entry in a planner - and depending on what the user does within the app, that planner might get its entries deleted or have a new one up front. To have the live tile present outdated info is not very appealing.

Is this possible - and if so, how to?

Kris Selbekk
  • 7,438
  • 7
  • 46
  • 73
  • You can't force the agent to run more quickly; but, you can do whatever the background agent would have done from within the app itself (whenever you want, like at exit--although you have a limited time to do things when exiting). – Peter Ritchie Jul 10 '12 at 18:28
  • So I can create the live tile directly from the application basically? Decent. – Kris Selbekk Jul 10 '12 at 19:26

1 Answers1

0

I dont know if this is what you are looking for.

My app updates livetiles when the user exits the app. But then I have had problems such as, if the user does not open the app for few days then it does not get updated.

protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
    {            
        ShellTile PrimaryTile = ShellTile.ActiveTiles.First();
        StandardTileData tile = new StandardTileData();

        if (PrimaryTile != null)
        {
            tile.BackTitle = resMan.GetString("liveTileTitle");
            tile.BackBackgroundImage = new Uri("/Background.png", UriKind.Relative);


            if (pCycMan.GetStartDate() == pCycMan.GetDefaultDate())
            {
                tile.Title = resMan.GetString("liveTileNotTrackingStatus");
            }
            else
            {
                tile.Title = App.m_liveTileText;
            }

            PrimaryTile.Update(tile);
        }
   }
alfah
  • 2,077
  • 1
  • 31
  • 55
  • @KrisSelbekk I have updated the answer. May be you could update the data that the PeriodicTask fetches every time the user exits the app. What I have done is update the tiles directly. – alfah Jul 10 '12 at 11:22