When developing apps for Windows Phone 8, every developer needs to know how to create and manage the App Bar. The problem is you cannot use databindings and/or localization in App bar buttons and menu items, you also cannot bind the colors or enabled state or even use commands bound to the buttons.

Most apps I've seen uses tedious programmatic initialization in code, repetitive entering of same resource values, or even not localized App bar at all. But there is an easy solution - the AppBarUtils library.

With this library you can use databinding for all AppBar properties, use Commands, even use dynamic app bar content for currently selected pivot/panorama item or your own state like logged-in/logged-out user. Let's see, how to do it.

Here we use App bar stub + Behaviors from the AppBarutils library.AppBarPropertyBinder is used for changing properties of the ApplicationBar, each AppBarItemCommand is bound with one ApplicationBarIconButton or ApplicationBarMenuItem using the Text <=> Id matching.
As you can see we use application wide resources for the App bar Foreground and Background colors, we use databound localized labels (MainViewModel with "AppResources Loc" property is used as DataContext on current page). We also use binding to Commands that are located within our MainViewModel as well. It is really that easy.

Another example is how to implement dynamic App bar based on selected pivot item.

This is really simple example from my app Astronomy Lock Screen for WP8 - here I got Pivot with two pivot items and I want to show the App bar only when the first pivot item is active, and hide it for the other item.

Just try to imagine, how would you implement such behavior manually with working localization and command binding? You don't have to, just use this library: