Chapter 13. ApplicationBar and context menus

 

This chapter covers

  • Working with the application bar
  • Dynamically changing buttons
  • Displaying a context menu

The Windows Phone comes with its own edition of the XAML framework found in WPF, Silverlight, and Windows 8. This means that if you know how to build XAML applications, you know how to build Windows Phone applications. By this point in the book, you’ve already used many of the XAML controls in the Windows Phone SDK. This chapter is the first of six chapters that take a closer look at XAML controls and discuss how to use them on the phone platform.

Windows Phone has redefined how an application displays a toolbar and menu. Applications use the new ApplicationBar control to show up to four shortcut icons for the most common operations on the page. If additional options are available but don’t fit in the bar containing shortcuts, or a different level of granularity must be provided, developers can add textual menu items as well. In this chapter we cover how to create a basic menu that can be used in your applications.

We venture beyond the standard Windows Phone SDK and show how to implement a context menu with a set of controls from the Windows Phone Toolkit. The Windows Phone Toolkit ContextMenu mimics the tap-and-hold context menu behavior seen in many of the built-in phone applications.

13.1. Working with the ApplicationBar

13.2. ContextMenu

13.3. Summary