I am trying to create a SecondaryTile using a JPG that I extracted to temporary storage (). When I create a URI from this file I get an error from the constructor of the SecondaryTile class. The error message I get is very helpful, it says "Incorrect parameter".
I have tried passing in a URI to the filename like this:
new Uri("file://C:/Users/{username}/AppData/Local/Packages/{myAppPAckage}/TempState/{filename}.jpg");
I have also tried ms-appx even though I don't think that is the right way given my file is stored in temporary app storage.
new Uri("ms-appx:///C:/Users/{username}/AppData/Local/Packages/{myAppPAckage}/TempState/{filename}.jpg");
Using ms-appx:/// as the prefix allows the tile to be pinned without error but the image does not display.
The file system path that I am getting is obtained from ApplicationData.Current.TemporaryFolder.
I found this documentation that provided the uri prefix for the folder I am using to source the image.
new Uri("ms-appdata:///temp/{filename}.jpg");
Unfortunately, this also gives the Incorrect parameter error.
How do I use an image file that is stored in App Temporary Storage?
I needed to use ApplicationData.Current.LocalFolder and the prefix "ms-appdata:///Local".