开发者

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

开发者 https://www.devze.com 2023-04-10 05:23 出处:网络
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\".

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

精彩评论

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