windows-phone-7 – WP7 – 显示隐藏应用程序栏
发布时间:2021-01-24 10:56:38 所属栏目:系统 来源:网络整理
导读:在许多 Windows Phone 7应用程序中,默认情况下隐藏应用程序栏,当您按住屏幕时,应用程序栏会显示.由于许多WP7应用程序都有这种行为,我想知道,如果使用ApplicationBar有这种行为的内置支持,我该如何使用它呢? 解决方法 您可以使用 toolkit中的GestureService
在许多 Windows Phone 7应用程序中,默认情况下隐藏应用程序栏,当您按住屏幕时,应用程序栏会显示.由于许多WP7应用程序都有这种行为,我想知道,如果使用ApplicationBar有这种行为的内置支持,我该如何使用它呢? 解决方法您可以使用 toolkit中的GestureService来检测Hold事件.例如. <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; } 然后按住文本块上的任何位置将切换ApplicationBar的显示. 如果您想要切换,如果用户点击并保持在页面上的任何位置,那么您可以将手势监听器附加到页面的根对象.例如 <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> (编辑:92站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐
热点阅读