问题
When I create a new tile (TileManager.AddTileAsync
) that tile does not appear in the Microsoft Health app on the phone.
Additionally, if I loop through all the tiles in the tiles collection (using TileManager.GetTilesAsync()
that new tile is the only one that is returned -- the default tiles provided with the band are not returned. Am I correct in assuming that it is up to the app I create to provide a storage mechanism and tile management for these tiles? Where to store it? In isolated storage on the phone?
回答1:
Assuming you have the latest version of the Microsoft Health application, all custom Tiles added to the Band should be listed as a "Third Party Tile" on the Manage Tiles page of the application. This ensures that Tiles can be removed from a Band even when the application that added the Tile has been uninstalled. When called by an application, IBandTileManager.GetTilesAsync() will enumerate only Tiles that have previously been added by that application. That is, applications will only see its own Tiles and no others, nor will it see the built-in Tiles.
If the application uses a fixed number of custom Tiles I would recommend that each custom Tile use a fixed (i.e. static) Tile ID (as opposed to generating a unique GUID when adding the Tile to the Band). This ensures that application can identify each of its Tiles without using any other storage mechanism and regardless of the phone with which the Band happens to be paired.
If the application generates a dynamic number of Tiles, then obviously it must store a map between a particular Tile (ID) and the entity represented by that Tile.
来源:https://stackoverflow.com/questions/29222586/microsoft-band-tiles