4

The main UI on WP7 uses tap-and-hold everywhere to implement context menus.

I have a ListBox that uses DataTemplates for the items. I would like to have a behavior identical to the app list on the main UI. That is, when the user holds down on an item, a context menu appears nearby.

I have read posts here: http://social.msdn.microsoft.com/Forums/en/windowsphone7series/thread/e6d2a444-91d9-4d69-937e-689b24c36c09 that enumerate some hacky ways to implement this.

Has Microsoft released any specific guidance on how to achieve this effect?

Frank Krueger
  • 64,851
  • 44
  • 155
  • 203

1 Answers1

5

The toolkit includes a ContextMenu for just this situation.

You can find an article on it's use at http://windowsphonegeek.com/articles/WP7-ContextMenu-in-depth--Part1-key-concepts-and-API

Matt Lacey
  • 64,328
  • 10
  • 87
  • 143
  • 1
    also covered http://blogs.msdn.com/b/delay/archive/2010/09/16/pining-for-windows-phone-7-controls-we-got-ya-covered-announcing-the-first-release-of-the-silverlight-for-windows-phone-toolkit.aspx and http://www.codebadger.com/blog/post/2010/11/02/WP7-Tip-of-the-Day-Silverlight-Toolkit-Context-Menus.aspx – Mick N Jan 02 '11 at 00:22