Search code examples
c#windows-phone-8windows-phonelive-tile

Update Primary Live tile for every one hour?


I'm updating my Live Tile when user open the app using the OnNavigated method like below:

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        ShellTile tile = ShellTile.ActiveTiles.First();
        if (null != tile)
        {
            StandardTileData data = new StandardTileData();
            data.BackTitle = ContentHead;
            data.BackContent = ProductText;
            tile.Update(data);
        }
    }

But if the user doesn't access the app, LiveTile will not be updated. I don't want this.

I wish to update the LiveTile for every one hour, ContentHead and ProductText should be updated on the LiveTiles for every one hour.

Can anyone please guide me how to achieve this one?

Many thanks in advance!


Solution

  • You need to add a BackgroundAgent in to your solution and use it to set the Live tile Periodically. Add a ScheduledTaskAgent to your Solution. This periodic update happens about every 30 mins. Refer to these links on how to implement that. http://developer.nokia.com/community/wiki/Working_with_Live_Tiles_on_Windows_Phone