WP8.1 AppBarButton 持有事件 [英] WP8.1 AppBarButton holding event
本文介绍了WP8.1 AppBarButton 持有事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何检测 AppBarButton 是否被按住?有一个 Hold 事件,但它永远不会触发,即使我将 AppBarButton 的属性 IsHoldingEnabled 设置为 true.甚至当我将 CommandBar 的 IsHoldingEnabled 设置为 true 时.
How do I detect if AppBarButton is being held? There is a Holding event, but it never fires, even if I set AppBarButton's property IsHoldingEnabled to true. Or even when I set CommandBar's IsHoldingEnabled to true.
推荐答案
在 xaml
代码中为 appbar
试试这个代码.
Try this code within your xaml
code for your appbar
.
<page.BottomAppBar>
<commandBar>
<commandBar.PrimaryCommands>
<appBarButton Label="formatting"
IsHoldingEnabled="True"
Holding="AppBarButton_Holding">
<appBarButton.Icon>
<pathIcon HorizontalAlignment="Center" VerticalAlignment="Center" Data="Some path"/>
</appBarButton.Icon>
</appBarButton>
</commandBar.PrimaryCommands>
</commandBar>
</page.BottomAppBar>
希望有帮助!
这篇关于WP8.1 AppBarButton 持有事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文