I am wondering is it possible to detect primary app tile size (small or wide) within code using c#? I want to implement live tiles functionality and I need to know which size is the app tile to select appropriate tile template.
Asked
Active
Viewed 793 times
1
-
Hi there, are you using the [NotificationExtensions](http://msdn.microsoft.com/en-us/library/windows/apps/hh969156.aspx) or working with the XML directly? – nkvu Apr 10 '13 at 22:04
-
Notifications Extensions. – Rade Milovic Apr 10 '13 at 22:04
-
I just need to know the size before I send request to the web api from which I retreive data. – Rade Milovic Apr 10 '13 at 22:06
-
2Ah, OK. I've never found a way to do it myself (though perhaps someone here knows) but if you look at the Wide tile classes, they have a property to also include a Square template so I've always been creating both, setting the Square tile to the property in the Wide tile and then passing that out as a notification. The [guidelines](http://msdn.microsoft.com/en-us/library/windows/apps/hh465403.aspx#choosing_between_a_square_and_wide_tile_size) seem to imply that this is the way to go as well in terms of including both a Square and Wide as you can't know the current size of the tile. – nkvu Apr 10 '13 at 22:11
-
So, you're suggesting me to request both small and wide template just to be sure. – Rade Milovic Apr 10 '13 at 22:15
-
1That's certainly an approach which has worked for me in the past (not saying it is the best way, just that it's worked for me). The top of [this](http://msdn.microsoft.com/en-us/library/windows/apps/hh465403.aspx) seems to imply you can't know the size: `If you use a wide tile, the user can resize the tile from wide to square or square to wide at any time. You don't know which size is currently displayed.` – nkvu Apr 10 '13 at 22:22
-
@nkvu you should make your comments into an answer, since you are correct about the app not being able to detect current tile size and providing both templates in the notification as proper way of addressing it. – Denis Apr 11 '13 at 00:03
-
Answer to a similar question here: http://stackoverflow.com/a/12605685/1656796 – Nathan Kuchta Apr 11 '13 at 03:19
-
Rade, nkvu (and Denis and Nathan Kuchta) are correct. You can't tell what size the end user will make the tile, and so you must provide both sizes in one payload. Remember, the user could always change the tile size AFTER you send the notification, and you would still want your live tile text/images to be displayed. I have an article on this at http://blogs.msdn.com/b/jennifer/archive/2012/11/20/real-world-live-tiles-working-with-live-tiles-in-windows-8-apps.aspx. – Jennifer Marsman - MSFT Apr 11 '13 at 14:06
1 Answers
3
Please check MSDN documentataion of Guidelines and checklist for tiles and badges (Windows Store apps). You will see two important points.
- If you use a wide tile, the user can resize the tile from wide to square or square to wide at any time. You don't know which size is currently displayed.
So you have to request both type of tile images i.e. small and large
- The user can turn tile notifications off and on at any time.
That's you also can't know whether live tile is turn on or off programmatically.
You can combine large and small tile XML schema in one single XML, check this stack overflow answer.

Community
- 1
- 1

Farhan Ghumra
- 15,180
- 6
- 50
- 115