在许多Windows Phone 7应用程序中,应用程序栏默认为隐藏状态,当您按住屏幕上的按钮时,应用程序栏将变为可见。由于许多WP7应用程序都有这种行为,所以我想知道,是否有与ApplicationBar的这种行为的内置支持,以及如何使用它?WP7 - show hide应用程序栏
3
A
回答
6
您可以使用toolkit中的手势服务来检测Hold
事件。
例如。
如果你有一个页面上此XAML:
<TextBlock TextWrapping="Wrap" Text="lorem ipsum ...">
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Hold="TapAndHold" />
</toolkit:GestureService.GestureListener>
</TextBlock>
和事件处理程序如下:
private void TapAndHold(object sender, GestureEventArgs e)
{
this.ApplicationBar.IsVisible = !this.ApplicationBar.IsVisible;
}
然后按住该文本块的任何地方将切换应用程序任务栏的显示。
如果您希望切换用户在页面上的任意位置轻敲并保持,则可以将手势监听器附加到页面的根对象。例如
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<toolkit:GestureService.GestureListener>
<toolkit:GestureListener Hold="TapAndHold" />
</toolkit:GestureService.GestureListener>
的
1
使用当前页面的ApplicationBar属性并相应地切换IsVisible属性以显示/隐藏ApplicationBar。 ApplicationBar由操作系统处理,因此用于显示和隐藏它的动画将为您处理。
相关问题
- 1. Hide&Show右侧栏
- 2. WP7其他应用程序栏?
- 3. jquery show hide division
- 4. Hide/Show DataTemplate
- 5. javascript hide show
- 6. jquery hide show
- 7. hide show menu getElementsByClassName
- 8. IE6 show hide divs
- 9. onmousedown hide/show div
- 10. jQuery .show().hide()不起作用
- 11. wxPython:使用Show()和Hide()
- 12. Angular hide show not working
- 13. show hide image inside div
- 14. jquery onclick hide/show div
- 15. Javascript:Ajax和Show/Hide Div
- 16. jQuery Modal + .show()和.hide()
- 17. Show and Hide Div onMouseOver
- 18. 以编程方式显示应用程序栏菜单(wp7)
- 19. PHP会话与jQuery show()/ hide()
- 20. 路由 - Ng -hide,Ng-show AngularJS
- 21. JQuery if/else with show/hide
- 22. jQuery .show()/ .hide()保持闪烁
- 23. jQuery Show/Hide on Checkbox Not Working
- 24. jquery hide show输入对象
- 25. jquery hide/show or condiiton failing
- 26. C#.net Winform -Multiple forms show&hide
- 27. Jquery show hide不工作
- 28. JQuery show hide div链接
- 29. jQuery show/hide/mouseenter问题
- 30. Coldfusion查询show hide div
可能重复的[Windows Phone 7的隐藏应用程序栏(http://stackoverflow.com/questions/4116311/windows-phone-7-hiding-the-application-bar) – 2011-01-14 06:13:28