AppBarUtils 1.0 Beta 4

Rating: No reviews yet
Downloads: 17
Released: Aug 14, 2011
Updated: Aug 15, 2011 by allenlooplee
Dev status: Beta Help Icon

Recommended Download

Source Code AppBarUtils 1.0 Beta 4 Source.zip
source code, 143K, uploaded Aug 14, 2011 - 10 downloads

Other Available Downloads

Application AppBarUtils 1.0 Beta 4 Binary.zip
application, 5K, uploaded Aug 14, 2011 - 7 downloads

Release Notes

Forth release.

As the functionality grows, I soon realized that whenever I wanted to add a new feature, I had to put almost identical code into two different type of classes, one for application bar button, the other for application bar menu item. The copy-and-past work made me crazy and could cause maintenance issue. Therefore, I refactored the toolkit.

With this release, you can now work with only three classes:
  • AppBarItemCommand
  • AppBarItemNavigation
  • AppBarItemTrigger

The trick is that IApplicationBarIconButton, the interface implemented by ApplicationBarIconButton, also inherits from IApplicationBarMenuItem, the interface implemented by ApplicationBarMenuItem. In short, you can treat IApplicationBarIconButton as an IApplicationBarMenuItem when all you want to do is just hooking the Click event. In fact, IApplicationBarIconButton inherits the Click event from IApplicationBarMenuItem.

This solution opened a new issue that we needed a way for the behaviors/triggers to know what type of item we wanted to hook. I introduced an AppBarItemType enum with which the behaviors/triggers knew where to find the item you specified.

The demo shipped within the source code shows how to utilize these new classes.

Note, Windows Phone SDK 7.1 Beta 2 is required. For Windows Phone Developer Tools 7.0, please use the related behaviors provided by Prism instead.

Reviews for this release

No reviews yet for this release.