I want to animate lives tiles in UAP applications. But I am getting this exception:
Cannot implicitly convert type 'NotificationsExtensions.Tiles.TileImageSource' to 'string'.
I am using this code:
TileBindingContentAdaptive largebindingContent = new TileBindingContentAdaptive()
{
PeekImage = new TilePeekImage()
{
Source = new TileImageSource("Assets/Apps/Hipstame/hipster.jpg")
},
Children =
{
new TileText() {Text =Description, Wrap = true, Style = TileTextStyle.BodySubtle}
}
};
How can I animate my live tiles?
The reason you are getting this exception is because as of May 2016 NotificationsExtensions received some updates where there have been changes made to
TileBackgroundImage
andTilePeekImage
. You can see the details of these changes here in the msdn update post.Specifically, the property type for
Source
changed fromTileImageSource
tostring
. This change means that you need to change the way you are settingSource
. Note in the code below (yours, which I modified) where theSource
is simply astring
. This should resolve the exception you are getting.As far as animating your live tiles there are a variety of things you can do and I cannot give any specific advice unless you specify what you want to do with your tiles. For example, if you want to cycle through images in your live tile you can take a look at this example here for cycling multiple images with an animation through a live tile. You can also refer to the msdn Adaptive Tile Templates documentation if you want to read through in more detail about what else you can do with your tiles.