Search code examples
xamlsilverlightwindows-phone-7icons

Custom ApplicationBarIconButton


I've created a custom icon for the ApplicationBarIconButton. I would like to use it unchanged for both dark and light theme.

<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="{StaticResource PhoneBackgroundColor}" Opacity="0.9" >
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/settings.png" Text="settings" /> 
</shell:ApplicationBar>

When dark theme is set, button looks like it should be. But when I press and hold my custom icon it disappears. This is not big inconvenience because in quick tap is barely noticed. However, there is a major problem when I set light theme. Instead of my custom icon there is a circle filled with black. Interesting thing is that the custom icon appears when I tap and hold the button.

How to handle theme changes and press states?

If somebody has some hints, please share with me.


Solution

  • If you create an icon for the dark theme (basically a white icon on a transparent background) wp7 should automatically convert it when the light theme is used.

    I can see that your icon is not white. Plus you don't need the circle around it as WP7 adds it automatically.

    Have a look at the icons supplied in the dark icons folder. My folder is here:

    C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Icons

    There is already a settings icon in there that you could use.