atticus3000
atticus3000

Reputation: 409

How to get type of LIveTile on Windows Phone 8?

I want to write a method which will change the main tile in my Windows Phone 8.

To access the main tile I'm using

var tile = ShellTile.ActiveTiles.FirstOrDefault();

But how do I know the type (Flip, Cycle, Iconic) of this tile? Because if I want to update the tile with

tile.Update(...);

And if I use the wrong type I will get an exception. Thanks.

Upvotes: 0

Views: 162

Answers (1)

atomaras
atomaras

Reputation: 2568

2 ideas you could try are:

1) Try/Catch the Update call and fallback to replacing the tile (delete the existing one) See this blogpost.

2) Or add a query parameter in the NavigationUri like "&tileType=Cyclic" when creating it and then lookup for that parameter in the same property when updating it. See here.

Very weird though that the API does not expose any obvious way for someone to figure this out.

Upvotes: 1

Related Questions