Create and delete a pinned tile programmatically

It’s simple to add and remove pinned tiles, used for Deep Linking within your app.    You’ll need to declare the following using directive (click images to view):

Here’ s a quick example of deep linking to a specific page within your app:

Here’s how to delete the same tile:

For more information, go to:  http://msdn.microsoft.com/en-us/library/hh202979(v=VS.92).aspx

Note:  I was getting “Sequence contains no mathcing element”” error message when using the Lambda expressions in functions built to remove tiles, if the tile did not exist.  Hence using the foreach loop in ShellTile.ActiveTiles, which works fine.

Here is a view of Page1.xaml where we navigated to from the MainPage.xaml.    Very simple, just so you can see the View:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s