Question

I have ScheduledTaskAgent and in this agent, when some condition is true, I want update the count in Live Tile. Something like this code:

ShellTile tile = ShellTile.ActiveTiles.First();
if ( tile != null)
{
    StandardTileData data = new StandardTileData();
    data.Title = "Title text here";
    data.Count = 1;
    tile.Update(data);
}

but in the first line, I have this Exception:

'System.Collections.Generic.IEnumerable' does not contain a definition for 'First' and no extension method 'First' accepting a first argument of type 'System.Collections.Generic.IEnumerable'

What I shloud do to solve this exception? I have to import some library or somehow connect the ScheduledTaskAgent with app?

Was it helpful?

Solution

problem solved: missing namespace

System.Linq;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top