[WPDEV] How a typo helped me to force SystemTray.Foreground to be White

Today was a sad day. My app was not going through Windows Phone Store certification because of logo issues., so I needed to change that all. That is bad on one side, because it really gets difficult to get the app approved now before the holidays.

But on the other side it was good, as I found some theming issues which I was able to iron  out. Well, at least nearly all of them.

One theming problem was remaining, no matter what I tried.

My app has its own theme, the ForegroundColor is White.  As I use the SystemTray to display the ProgressBar while loading data from the internet, I want it to be white, too (of course).

 

All was running good until I switched the phone’s background to light. The SystemTray was always black.

I tried several things, for example set in XAML:

 shell:SystemTray.ForegroundColor="White"

Next I tried to add it in code behind:

SystemTray.SetForegroundColor(this, Colors.White);

But my app seemed to ignore the word “White” completely. No error showed up, it just  did not work.

Finally, I tried to set it via the RGB code for white (255,255,255), but I made a typo in there:

 SystemTray.SetForegroundColor(this, Color.FromArgb(255, 254, 255, 255));

And the most funny thing is, it just worked!

 

Summary: Windows Phone seems to not like “White” in SystemTray. If you want to force it, just use the code above, and it will work!

I hope my typo will be helpful for some of you.

Happy coding!

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Prev
Sean’s Editorial: This Is How I Use “Rooms” For WP

Sean’s Editorial: This Is How I Use “Rooms” For WP

Next
Manage your Facebook fan page(s) on the go with Page Manager for Windows Phone

Manage your Facebook fan page(s) on the go with Page Manager for Windows Phone

You May Also Like

This website uses cookies. By continuing to use this site, you accept the use of cookies.  Learn more