Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 745
theMaxx Avatar asked Aug 10 '16 18:08

theMaxx


1 Answers

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

like image 51
theMaxx Avatar answered Sep 22 '22 20:09

theMaxx