One of the built in UI elements for WP7 is the Application Bar. This is a bar that allows you to put buttons or menu items on in order to allow your user to interact with your application. The major downside to the Application Bar is that it is not a ‘native’ XAML control. This means it is not bindable and is not skinable w/ templates. Which by the way SUCKS (I hope this changes at some point in the future).
However you are still able to change the Background and Foreground colors in order to spice up application.
Adding a value for Background and Foreground could not be simpler. All you need to do is the following:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Opacity="0.75" ForegroundColor="#FF9D386E" BackgroundColor="#FF8B8888" >
<shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/Images/appbar_button1.png" Text="Button 1"></shell:ApplicationBarIconButton>
<shell:ApplicationBarIconButton x:Name="appbar_button2" IconUri="/Images/appbar_button2.png" Text="Button 2"></shell:ApplicationBarIconButton>
<shell:ApplicationBar.MenuItems>
// menu go here
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
In the XAML above I have bolded three attributes of the ApplicationBar. Opacity, Foreground and Background. All you need to do is provide your colors (or opacity) to these attributes and your app bar will have a new style set to it.
One thing is I was NOT able to get a gradient to work in ANY capacity which sucks, but hopefully it will come in a future release.
Till next time,
Posted
08-31-2010 12:49 PM
by
Derik Whittaker