0

i am developing a windows phone app where application has an option to pin the application to home screen. And i am using ShellTileSchedule class to do schedule the update periodically. Some reason my app is not pushing any update to tile. My app data is completely local, no data is coming from outside.

In my tile update, i am not updating any image on the lile, but only changing the data to display.

 foreach (ShellTile tile in ShellTile.ActiveTiles)
 {
            IconicTileData tileData = GetTileData();

            tileSchedule = new ShellTileSchedule(tile, tileData);
            tileSchedule.Interval = UpdateInterval.EveryHour;
            tileSchedule.Recurrence = UpdateRecurrence.Interval;
            tileSchedule.Count=GetUserData();
            tileSchedule.StartTime = DateTime.Now;
            tileSchedule.Start();

            tile.Update(tileData);
}

Any help in this regard? Or do i need to background agent to update the tile?

4

3 回答 3

6

ShellTileSchedule 只能从网络上提取图像,而不是从手机本身。这是 ShellTileSchedule 的限制之一。如果您想为手机上的资源设置背景图像,请考虑使用推送通知。

资料来源:http ://www.silverlightshow.net/news/WP7-Using-ShellTileSchedule-to-update-your-app-s-Live-Tile-background.aspx

于 2012-11-08T07:31:56.703 回答
1

Shouldn't you be setting a ShellTileSchedule.RemoteImageUri somewhere? I mean, that's kinda what ShellTileSchedule is there for, to update your tile image from a remote Uri on a regular interval... See sample of how to use this class for secondary tiles here.

于 2012-11-08T06:07:00.057 回答
0

您必须填写 IconicTileData 的属性。在您的示例中,您只需创建空数据结构并将其用于计划,这是行不通的。我这样使用它:

IconicTileData newTileData = new IconicTileData
{
    Title = SharedResources.AppName,
    Count = BatteryHelper.BateryLevel,
    SmallIconImage = new Uri(@"/Assets/IconicSmall.png", UriKind.Relative),
    IconImage = new Uri(@"/Assets/IconicMedium.png", UriKind.Relative),
};
于 2012-11-08T08:26:09.887 回答