Windows Phone 7 Dev – Images and ApplicationBarIconButton

Number of Views : 4142

I have been working on a windows 7 phone application. I know, many of you may give me a hard time about developing for winphone7 vs iPhone or android. Well, I’m working on getting to each of them eventually. Currently Phone 7 made sense.

So far development has been pretty straight forward. I was adding an application bar to the bottom of the app to allow for menu items and icons for actions. In doing so I could not for the life of me get the icons to show. I tried chaning he names the uri path and even the case of the images. No matter what I did I could not figure out why they would not show.

In the end, after some googling I found that it is an issue with the image file. In my case mail.png file.

The (.png) file has a visual studio property of Build Action set to Resource by default. If you change the image to content the image will show. What a crazy setting.

The fix was to change it to content. It seems strange that this would not be the default action for an image in a Win7Phone project.

Thanks to the UK solutions development team:
http://blogs.msdn.com/b/mcsuksoldev/archive/2010/07/14/windows-phone-applicationbariconbutton-not-displaying-icons.aspx

Leave a Reply

Your email address will not be published. Required fields are marked *