UWP - Image Uri in Application Folder

前端 未结 5 1347
自闭症患者
自闭症患者 2020-12-10 10:51

I\'m having a little issue here in showing images.

So when I\'m trying to load images from XAML, I can use a relative uri to the image source like this :

<         


        
5条回答
  •  被撕碎了的回忆
    2020-12-10 11:39

    I believe WPF is more forgiving and paths like "Assets/image.png" are possible. If you are writing a UWA (win 10) app then you need to use the "ms-appx" URI's.

    My experience is "ms-appx:///Assets/image.png" works fine.

    Yes, three "/"s (!) and no need for the name of the app in the path.

提交回复
热议问题