idunnololz
idunnololz

Reputation: 8363

WP8 Change the color behind the application bar

I am writing a WP8 app that overrides the color theme on the phone to always be white. Now before people discredit me for this decision, the app itself is supposed to be a messenger like application and the white background simply makes everything easier to read. In the future I do want to allow people to be able to choose between black or white in case battery life is important but I need to get over this hurdle first.

Currently the problem is that even after overriding the theme colors the color BEHIND the application bar still refuses to change. I'm not talking about the background color of the application bar but the rectangle drawn behind the application bar as it is animated to pop upwards from the bottom of the screen. It is very visible and it is quiet annoying even if it only appears for about a second.

I know there must be a way to do this as applications like Office, Google Mail and Skype all override the color theme and implement the white theme instead and they do not have this same problem.

If anyone could help that would be great!

Upvotes: 0

Views: 706

Answers (1)

idunnololz
idunnololz

Reputation: 8363

I've found a solution but it's not a very nice one. If anyone finds a better solution please let me know.

I solved this problem by setting the application bar opacity to be near 1 but not 1 (I set it to 0.99). This will tell windows to not rescale the window (which is the cause of the black background).

I then set the bottom margin of that page to be the height of the application bar.

Here's the code for anyone interested:

 private void panoramaMain_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
    Panorama p = (Panorama) sender;
    if(p.SelectedIndex == 1) {
       messageList.Margin = new Thickness(0, 0, 0, ApplicationBar.DefaultSize);
       ApplicationBar.IsVisible = true;
    } else {
       messageList.Margin = new Thickness(0, 0, 0, 0);
       ApplicationBar.IsVisible = false;
    }
 }

Upvotes: 1

Related Questions