Advanced ApplicationBar for Windows Phone
published on: 1/3/2012 | Views: N/A | Tags: AppBar
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
|
|
About the 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.
Our Top Articles & Free books
- Our FREE e-book: "Windows Phone Toolkit In Depth" 2nd edition
- 400+ Windows Phone Development articles in our Article Index
- 21 WP7 Toolkit in Depth articles covering all controls
- 12 WP7 Coding4Fun Toolkit in Depth articles covering all controls
- Performance Tips when creating WP7 apps
- Creating a WP7 Custom Control in 7 Steps
- WP7 working with VisualStates: How to make a ToggleSwitch from CheckBox
- What makes a WP7 App successful
- Creating theme friendly UI in WP7 using OpacityMask
- Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector
- All about Splash Screens in WP7 – Creating animated Splash Screen
- Getting Started with Unit Testing in Silverlight for WP7
- WP7 WatermarkedTextBox custom control
Our Top Tips & Samples
- All about WP7 Isolated Storage series
- WP7 Dynamically Generating DataTemplate in code
- 5 tips for a successful WP7 Marketplace submission
- WP7: Navigating to a page in different assembly
- WP7 ContextMenu: answers to popular questions
- WP7 ListBox: answers to popular questions
- WP7 working with Images: Content vs Resource build action
- WP7 Element Binding samples
- WP7 working with XML: reading, filtering and databinding
- Drawing in WP7: #2 Drawing shapes with finger
- WP7 TextBox Light theme problems - the solution
- Changing the WP7 Panorama Background Image dynamically with Animation

