I'm trying to create a secondary tile for a windows 8.1 application, i need this tile to contain images for all sizes and all of them come from internet. this is my code :
string dynamicTileId = selectedItem.UniqueId;
string sLogo = selectedItem.logo;
string wLogo = selectedItem.widelogo;
string lLogo = selectedItem.imagen3;
Uri logo = new Uri(sLogo);//150x10 image
Uri wideLogo = new Uri(wLogo);//310x150 image
Uri largeLogo = new Uri(lLogo);//310x310 image
string tileActivationArguments = dynamicTileId;
var secondaryTile = new SecondaryTile(dynamicTileId, selectedItem.Title, tileActivationArguments, largeLogo, TileSize.Square310x310);
secondaryTile.VisualElements.ForegroundText = ForegroundText.Light;
secondaryTile.VisualElements.BackgroundColor = Colors.CadetBlue;
secondaryTile.VisualElements.Square310x310Logo = largeLogo;
secondaryTile.VisualElements.Square150x150Logo = logo;
secondaryTile.VisualElements.Wide310x150Logo = wideLogo;
await secondaryTile.RequestCreateAsync();
I'm having this error while the app tries to use the 310x310 logo:
WinRT information: Could not initialize secondary tile with provided arguments.
All the other images work fine. I'm using this picture for testing : http://www.usatodayeducate.com/staging/wp-content/uploads/2013/03/310x310-0313-gapyear.jpg
if i comment the line that includes the 310x310 logo everything works fine. Any idea why this is happening?
You cannot link to web resources. They must be either local in the app (A path within the deployed app package. This path is resolved for languages and DPI plateau supported by the app.) or on the user device (A file found in the per-user app storage.).
Documentation of this: http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.startscreen.secondarytilevisualelements.square310x310logo.aspx