Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to bind a command directly to an app bar button?

I'm creating an MVVM style application for windows phone. With a regular button, you can bind anything that inherits from ICommand to the Command property on a xaml button, like so:

The command property does not seem to exist for buttons in the phones app bar ("shell:ApplicationBarIconButton"). Has anyone figured out how to bind their click event to a Command yet?

like image 311
Mr. Spoof Avatar asked Dec 11 '12 22:12

Mr. Spoof


1 Answers

It's not possible from the SDK directly, but the AppBarUtils library ( http://nuget.org/packages/AppBarUtils or http://appbarutils.codeplex.com/ ) works nicely.

The codeplex site has example code for different scenarios such as reusing or switching the app bar in a page.

like image 197
Paul Annetts Avatar answered Jan 03 '23 13:01

Paul Annetts