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"/> ...

Get Windows® Phone 8 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.