How to display a .ico image file in a XAML app?

2k Views Asked by At

Is it possible to display a .ico file in a XAML C# app? It's for a WinRT Windows Phone 8.1 app using Visual Studio 2015.

<Image Source="http://www.stackoverflow.com/favicon.ico"/> shows the icon fine in the designer, but not when run in the emulator.

I've tried using a downloaded icon, downloading an icon programmatically, saving as a .png file, loading from the LocalFolder, using the Assets folder, etc...but the image is still not shown. Seems like there should be an easy solution for this, or that it's just not possible.

Can it be done?

1

There are 1 best solutions below

0
On BEST ANSWER

Basically...no, it's not possible.

The following working code that works in the designer and shows the image is very misleading:

<Image Source="http://www.stackoverflow.com/favicon.ico"/>

See this page for clear evidence: Windows class - Windows app development

Note Icon files supported on Windows only. Not supported on Windows Phone 8.1