开发者

WP7 - How can I display a menu when holding down my finger on a ListBoxItem

Alm开发者_JAVA百科ost everywhere in Windows Phone (for instance in the People hub), when you hold down your finger anywhere, a context-menu-ish menu pops up that says "Refresh".

How can I recreate this menu in my own application? I don't even know what to call it.


You can achieve this by using the toolkit's (August 2011) ContextMenu.

       xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

       <ListBoxItem>
            <toolkit:ContextMenuService.ContextMenu>
               <toolkit:ContextMenu>
                     <toolkit:MenuItem Header="something" Command="{Binding SomeCommand}" />
                     <toolkit:MenuItem Header="something else" Command="{Binding SomeOtherCommand}" />
               </toolkit:ContextMenu>
            </toolkit:ContextMenuService.ContextMenu>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜