The page has been moved to GitHub

BindableApplicationBar

Package: MyToolkit.Extended
Platform: WP7SL, WP8SL

A wrapper around the ApplicationBar control with support for bindings for the properties and commands.

<phone:PhoneApplicationPage 
    ...
    xmlns:Paging="clr-namespace:MyToolkit.Paging;assembly=MyToolkit.Extended">

	...

	<Paging:BindableApplicationBar.ApplicationBar>
		<Paging:BindableApplicationBar>
			<Paging:BindableApplicationBarIconButton ... Command="{Binding ...}" />
		</Paging:BindableApplicationBar>
	</Paging:BindableApplicationBar.ApplicationBar>
</phone:PhoneApplicationPage>

To have direct bindings to the ViewModel defined in the page resources:

<phone:PhoneApplicationPage 
    ...
    xmlns:Paging="clr-namespace:MyToolkit.Paging;assembly=MyToolkit.Extended">

	<phone:PhoneApplicationPage.Resources>
		<viewModels:ListPageViewModel x:Key="viewModel" />
	</phone:PhoneApplicationPage.Resources>

	<Grid x:Name="LayoutRoot" Background="Transparent" DataContext="{StaticResource viewModel}">
        ...
    </Grid>

	<Paging:PhonePage.ApplicationBar>
		<Paging:BindableApplicationBar DataContext="{Binding viewModel}">
			<Paging:BindableApplicationBarIconButton Command="{Binding MyCommand}" />
		</Paging:BindableApplicationBar>
    </Paging:PhonePage.ApplicationBar>
</phone:PhoneApplicationPage>

Last edited Jun 3, 2015 at 10:58 PM by rsuter, version 7