显示上下文菜单
尽管搜索了一段时间,但我很难找到这方面的良好文档。
我希望在我的应用程序中有一个上下文菜单,它可以复制其他点击并按住上下文菜单所见的行为,例如将应用程序从应用程序列表固定到开始屏幕。
这是我的上下文菜单:
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu x:Name="sectionContextMenu">
<toolkit:MenuItem Header="Hide this section from this list" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
如何让它显示?
I'm having difficulty finding good documentation for this, despite searching for a while.
I'd like to have a context menu in my app that replicates the behavior seen with other tap-and-hold context menus, like pinning an app to the start screen from the app list.
Here is my Context menu:
<toolkit:ContextMenuService.ContextMenu>
<toolkit:ContextMenu x:Name="sectionContextMenu">
<toolkit:MenuItem Header="Hide this section from this list" />
</toolkit:ContextMenu>
</toolkit:ContextMenuService.ContextMenu>
How do I make it show?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
上下文菜单需要附加到您希望用户点击并按住的元素。
用户现在可以通过点击并按住此
Border
元素的内容来调用上下文菜单。The context menu needs to be attached to the element that you want the user to tap and hold.
The user can now invoke the context menu with a tap and hold on the content of this
Border
element.根据内容不同项目的独特上下文菜单。
Unique context menu for different items depending on the content.