Search code examples
.netxamluwpisolatedstorage

Getting a Uri from a path in UWP


I'm using a service that saves images in my application inside paths that look like:

C:\Users\user\AppData\Local\Packages\43108ba3-ad13-4b7a-93b6-7ebdc6a91606_5gyrq6psz227t\LocalState\private\image.jpg

I would like to show the images, but Image.Source requires a Uri.

How can I create a Uri for Image.Source based on that kind of paths?

I have tried with new Uri(new Uri("ms-appdata:///", "local/private/image.jpg")), but it doesn't work :(


Solution

  • You should be able to just use new Uri("ms-appdata:///local/private/image.jpg")