theMaxx
theMaxx

Reputation: 4086

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?

Upvotes: 6

Views: 2232

Answers (1)

theMaxx
theMaxx

Reputation: 4086

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

Upvotes: 7

Related Questions