WP7, ApplicationBar, ImageUri and the Icon not showing up

I know this may sound stupid but when working with the WP7 ApplicationBar make sure the images you are using have the following properties:

Build Action: Content
Build Action: Content
Copy to Output: Copy always (or ‘Copy if newer’, either should work)

I spent a half an hour trying to figure out why my application bar was showing an “X” instead of the image I was putting in IconUri. When first adding images the properties default to:

Build Action: Resource
Copy to Output: Do not copy

Since the application bar is referencing the image by Uri it can’t seem to find it embedded in the application.

My xaml looks like:

<phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
        <shell:ApplicationBarIconButton
            IconUri="/Images/appbar.feature.settings.rest.png"
            Text="Settings"/>
    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>

Comments (5)

  1. Onions

    How can get to this Build Action. Is it the project build properties ? or application bar icon properties. We could not get to this Build Action: Content

  2. I’ve added a screenshot of the properties window for the image. As you can see it’s the properties on the image itself.

  3. Dan

    I’m glad I’m not the only one who was stumped by this. Thanks for the post. I’m new to coding, but I feel like perhaps this should be the default for images…

  4. JD

    I also have to thank you for this. I’ve been trying to figure out why it wasn’t working and your post pretty much summed everything up. If only I had searched earlier though and I would have saved myself 15 minutes or so…

  5. Jesper

    Thanks for the usefull tip – Saved my evening!

Leave a Reply

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