This project is read-only.

ApplicationBarButtonCommand

Jan 5, 2011 at 2:44 PM

Hi there,

 

I am started loving nRoute but having some trouble to move from Prism to nRoute.

IN Prism i can bind Commands to an ApplicationBar, is that possible also in nRoute?

 

Sample:

 <phoneNavigation:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar Opacity="0.7">
                    <shell:ApplicationBarIconButton IconUri="/icons/AppBarIcon HeartPlus.png" Text="Favorite" />
        </shell:ApplicationBar>
    </phoneNavigation:PhoneApplicationPage.ApplicationBar>

 

 <Custom:Interaction.Behaviors>
        <nBehaviors:BridgeViewModelBehavior/>

        <prismInteractivity:ApplicationBarButtonCommand ButtonText="Favorite"
                                                        CommandBinding="{Binding MarkFavoriteCommand}"
                                                         />
    </Custom:Interaction.Behaviors>

Best regards

  Dima

Jan 5, 2011 at 8:49 PM

Well, the native ApplicationBar isn't bindable - so it doesn't matter if you use Prism or nRoute it won't/shouldn't work. Here's a workaround http://blog.humann.info/post/2010/08/27/How-to-have-binding-on-the-ApplicationBar.aspx

Cheers,
Rishi 

Jan 11, 2011 at 7:14 AM

Thank you Rishi, works perfekt!