O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying a ContextMenu

ContextMenu is an expanding menu control that is displayed when a host FrameworkElement is tapped and held. A ContextMenu can be added to any FrameworkElement using the ContextMenuService.ContextMenu attached property. The following excerpt shows a Button that has a context menu assigned to it, displaying three menu items:

<Button Margin="0,12" VerticalAlignment="Center" Padding="16"        Content="Using Click Events">    <toolkit:ContextMenuService.ContextMenu>        <toolkit:ContextMenu>            <toolkit:MenuItem                Header="option 1"                Click="MenuItem_Click"/>            <toolkit:MenuItem                Header="option 2"                Click="MenuItem_Click"/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required