【问题标题】:Windows Phone - ScheduledTaskAgent update the Live Tile CountWindows Phone - ScheduledTaskAgent 更新动态磁贴计数
【发布时间】: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


    【解决方案1】:

    问题已解决:缺少命名空间

    System.Linq;

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多