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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.