Currently viewing the tag: "C#"

Problem:

I have the following line: ShellTile TileToFind = ShellTile .ActiveTiles.First(); to get the first application tile of my Windows Phone 7 application, but First() doesn’t get recognized and I get this error:

Error 2 ‘System.Collections.Generic.IEnumerable<Microsoft.Phone.Shell.ShellTile>’ does not contain a definition for ‘First’ and no extension method ‘First’ accepting a first argument of type ‘System.Collections.Generic.IEnumerable<Microsoft.Phone.Shell.ShellTile>’ could be found (are you missing a using directive or an assembly reference?)

Solution:

Add the following using statement at the top of your .cs file.

using System.Linq;