WindowsPhoneGeek

WPAppInfo

Login | Join (Why?)

rss rss rss
logo

Advanced ApplicationBar for Windows Phone

published on: 1/3/2012 | Views: N/A | Tags: AppBar

by Sheriev Akhmed

I have released an AdvancedApplicationBar library recently, enhancing the standard ApplicationBar in WP7.
It's a wrapper over the standard ApplicationBar which adds DataBinding support, Visibility property and Panorama / Pivot elements support.

Supporting DataBinding, ICommand, Visibility

<Sh:AdvancedApplicationBar>
    <Sh:AdvancedApplicationBarIconButton 
        IsEnabled="{Binding AppBarIconButtonEnabled}"
        Text="{Binding AppBarIconButtonText}"
        IconUri="{Binding IconUri}"
        Click="AdvancedApplicationBarIconButton_Click"
        />

    <Sh:AdvancedApplicationBarIconButton 
        Text="{Binding AppBarIconButtonText}"
        IconUri="{Binding AppBarIconButtonText}"
        Visibility="{Binding Visibility}"
        Command="{Binding DeleteCommand}"
        CommandParameter="42"
        />
    <Sh:AdvancedApplicationBarIconButton 
        Text="static text"
        IconUri="/Images/appbar.feature.settings.rest.png"
        />
    <Sh:AdvancedApplicationBarMenuItem Text="MenuItemTxt" />
</Sh:AdvancedApplicationBar>

Supporting Panorama/Pivot

In order to show some elements in specific Panoram tabs only, you just have to move Buttons and Menu Elements into that Tab.
The elements that should be shown before the Panoram/Pivot buttons, should be placed before the Panoram element in XAML.

<Grid x:Name="ContentPanel">
  <Sh:AdvancedApplicationBarIconButton ... />
      <controls:Panorama>
          <controls:PanoramaItem>
              <Grid>
                   ...
                   <Sh:AdvancedApplicationBarIconButton .../>
                  <Sh:AdvancedApplicationBarIconButton ... />
                  <Sh:AdvancedApplicationBarMenuItem ... />
              </Grid>
          </controls:PanoramaItem>
          <controls:PanoramaItem>
              <Grid>
                  <Sh:AdvancedApplicationBarIconButton ... />
              </Grid>
          </controls:PanoramaItem>
      </controls:Panorama>
   <Sh:AdvancedApplicationBar>
       <Sh:AdvancedApplicationBarIconButton ... />
   </Sh:AdvancedApplicationBar>
</Grid> 

How to use:
- Download the library here:  http://shwp.codeplex.com/releases/view/76914
- Add reference to "sh.dll" to your Project
- Add namespace in your Page:

xmlns:Sh="clr-namespace:Sh;assembly=Sh"

Attention: This library wraps the ApplicationBar, it does not substitute it.
AdvancedApplicationBar should be placed inside the main Panel (usually a Grid).

<Grid x:Name="ContentPanel">
   <Sh:AdvancedApplicationBar . />
</Grid> 

Demo Video:

Download sample code here

You can also follow us on Twitter @winphonegeek

Akhmed Sheriev

About the author:

All articles by this author

Comments

I like the approach with per pivot/panorama-item buttons

posted by: Filip Skakun on 1/5/2012 9:49:22 PM

Can I use it in my BindableApplicationBar? Perhaps it could be extended to the likes of a ListBox or ListPicker...

> Can I use it in my BindableApplicationBar?

posted by: Sheriev Akhmed on 1/6/2012 2:01:09 AM

Can I use it in my BindableApplicationBar? Of course! if I can than help, I will be glad to help.

Add comment to 'Advanced ApplicationBar for Windows Phone'

Comment

Our Top Articles & Free books

Our Top Tips & Samples