WP7 Action on App Bar Button

Oct 29, 2010 at 5:13 AM


How do I handle a click event on an ApplicationBarIconButton?

It doesn't seem to handle actions automatically like a button.

I can't do this:

            cal:Message.Attach="[Event Click] = [Action MeButtonClick]"

as It tells me I can't attach to an app bar icon button.

Any ideas?



Oct 30, 2010 at 6:54 AM

You need to use our built-in menu and button objects. Set the Message property on those and it will work. This is a limitation in WP7 so we have the custom work around for that.

Nov 1, 2010 at 2:29 AM

What is the name of the built in menu and button objects?

Nov 5, 2010 at 3:49 AM

Had a good look round but can't find the name of these controls. 

Can someone lt me know the name of them please.



Nov 5, 2010 at 9:26 AM
Edited Nov 5, 2010 at 9:28 AM

I guess Rob meant something like:


		<shell:ApplicationBar IsVisible="True">
				<cal:AppBarButton IconUri="/Images/target.png"
				                  Message="MeButtonClick" />


See the CM+WP7 documentation here: http://caliburnmicro.codeplex.com/wikipage?title=Working%20with%20Windows%20Phone%207&referringTitle=Documentation

Nov 6, 2010 at 3:31 AM

Thanks Marco. Just what I was looking for.