albilaga
albilaga

Reputation: 439

Change border color application bar button windows phone

How do I change the application bar from this application bar original

to be like this

application bar I want.

I already try code like this

<phone:PhoneApplicationPage.ApplicationBar> <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False" Mode="Minimized" BackgroundColor="#01A3BE"> <shell:ApplicationBarIconButton x:Name="About" Text="About" IsEnabled="True" Click="About_Click" IconUri="/Assets/AppBar/Icon Navigation.png"/> </shell:ApplicationBar> </phone:PhoneApplicationPage.ApplicationBar>

but the border still like picture number 1 with black border. And when I open Blend it just looks like application bar style can not be edited.

Upvotes: 0

Views: 909

Answers (3)

Murat
Murat

Reputation: 149

This is what u want

this.ApplicationBar.ForegroundColor = Color.FromArgb(255, 255, 255, 255);

You can create ApplicationBar in code like:

ApplicationBar = new ApplicationBar();
ApplicationBar.BackgroundColor = Color.FromArgb(255, 52, 73, 94);
ApplicationBar.ForegroundColor = Color.FromArgb(255, 255, 255, 255);

Hope this helps.

Upvotes: 0

har07
har07

Reputation: 89325

ApplicationBar color is following current phone theme, as also stated in @Gerrit answer. So to force it change to white, you can try applying light theme locally for your application (not changing phone theme entirely) using PhoneThemeManager.

ThemeManager.ToLightTheme();

Different ways to force your application displayed in light theme offered as answers to this question How to force windows phone 8 app to be run in light theme. And using Jeff Wilcox's PhoneThemeManager is the easiest, in my opinion.

Upvotes: 0

Gerrit F&#246;lster
Gerrit F&#246;lster

Reputation: 964

The ApplicationBar and ApplicationBarIconButton are theme aware, they will automatically change their foreground color if you change your phone's theme to light or dark.

To style other elements, you can access the current themes foreground color via

{StaticResource PhoneForegroundBrush}

Upvotes: 1

Related Questions