【发布时间】:2013-04-19 20:23:33
【问题描述】:
我有 ScheduledTaskAgent,在这个代理中,当某些条件为真时,我想更新 Live Tile 中的计数。像这样的代码:
ShellTile tile = ShellTile.ActiveTiles.First();
if ( tile != null)
{
StandardTileData data = new StandardTileData();
data.Title = "Title text here";
data.Count = 1;
tile.Update(data);
}
但在第一行,我有这个例外:
'System.Collections.Generic.IEnumerable' 不包含“First”的定义,也没有扩展方法 'First' 接受类型的第一个参数 'System.Collections.Generic.IEnumerable'
我应该怎么做才能解决这个异常?我必须导入一些库或以某种方式将 ScheduledTaskAgent 与应用程序连接起来?
【问题讨论】:
标签: c# windows-phone-7 windows-phone-8 scheduled-tasks live-tile