【问题标题】:WP8.1 AppBarButton holding eventWP8.1 AppBarButton 持有事件
【发布时间】:2014-08-12 10:14:40
【问题描述】:

如何检测 AppBarButton 是否被按住? 有一个 Hold 事件,但它永远不会触发,即使我将 AppBarButton 的属性 IsHoldingEnabled 设置为 true。甚至当我将 CommandBar 的 IsHoldingEnabled 设置为 true 时。

【问题讨论】:

标签: c# xaml windows-phone-8 windows-phone-8.1


【解决方案1】:

在您的xaml 代码中为您的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

希望对你有帮助!

【讨论】:

  • 遗憾的是,它仍然不起作用。顺便说一句,此代码不正确。它应该说“AppBarButton”、“CommandBar”等等。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多