WP8.1 AppBarButton holding event

空扰寡人 提交于 2019-12-23 22:19:26

问题


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.


回答1:


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>

Reference

Hope it helps!



来源:https://stackoverflow.com/questions/25261742/wp8-1-appbarbutton-holding-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!