Maku
Maku

Reputation: 389

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.

Upvotes: 0

Views: 1212

Answers (2)

Stefan Wick  MSFT
Stefan Wick MSFT

Reputation: 13850

You cannot really customize AppBar icons in the current release in this way. The system automatically inverts your icon when the user switches to the light theme.

You can still use custom icons, but you should follow the design/color patterns that the standard icons use.

Upvotes: 2

Steve Chadbourne
Steve Chadbourne

Reputation: 6953

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.

Upvotes: 2

Related Questions