Windows Phone: how to get accent color in your app
Mood: cheerful
Posted on 2013-01-02 23:20:00
Tags: windowsphone wpdev
Words: 227
As I mentioned in my post about icon design, I'm terrible at art, and I'm also not very good at making apps attractive.
But I do know that a splash of color helps, and since Windows Phone has user-selectable themes, you can use the theme accent color and make the app look "at home" on the phone, since the Start screen will have the theme accent color all over the place.
In XAML, this is very simple, for example for a TextBlock you can use Runs like:
<TextBlock TextWrapping="Wrap">
<Run>Better with a</Run>
<Run Foreground="{StaticResource PhoneAccentBrush}">splash</Run>
<Run>of color!</Run>
</TextBlock>
Brush accent = Application.Current.Resources["PhoneAccentBrush"] as Brush;
This backup was done by LJBackup.