简体   繁体   English

全屏WPF程序中的Metro风格Appbar

[英]Metro-style Appbar in fullscreen WPF program

I am currently working on a desktop C# WPF application where the goal is to make it look and feel like a "real" Windows Store App. 我目前正在开发一个桌面C#WPF应用程序,其目标是让它看起来像一个"real" Windows应用商店应用程序。

I want to add an appbar that should be shown when the user swipes up from the bottom. 我想添加一个应用appbar ,当用户从底部向上滑动时应该显示该应用栏。 To do this in a normal app you just position your finger outside the screen area, and swipe up. 要在普通应用程序中执行此操作,只需将手指放在屏幕区域外,然后向上滑动即可。 But if I do that in a fullscreen WPF program I don't receive any TouchDown or TouchMove events - probably because the finger is already down when entering the actual screen area. 但是,如果我在全屏WPF程序中执行此操作,则不会收到任何TouchDownTouchMove事件 - 可能是因为手指在进入实际屏幕区域时已经关闭。 I have tried with the Manipulation framework also, but same result here. 我也尝试过Manipulation框架,但这里结果相同。 Even when I hook directly into the message queue using WndProc or other hooks I get no events at all. 即使我使用WndProc或其他钩子直接挂钩到消息队列,我根本没有事件。

The funny thing is that I can see the "touch cursor" move around the screen, so at least something in the underlying framework is notified. 有趣的是,我可以看到"touch cursor"在屏幕上移动,因此至少会通知底层框架中的某些内容。

Does anyone have an idea how to do this? 有谁知道如何做到这一点?

ps It is not an option for me just to use a windows store app instead, because of hardware connectivity issues ;-) ps由于硬件连接问题,我不能仅仅使用Windows应用商店应用程序;-)

You will need to keep track of the cursor location coordinates, and see when the cursor (swipe) starts at the edge of the screen and moves in. When that triggers (with whatever trigger you want, distance covered most likely) you can fire up your Appbar. 您将需要跟踪光标位置坐标,并查看光标(滑动)何时从屏幕边缘开始并移入。当触发时(无论您想要什么触发,最有可能的距离),您可以启动你的Appbar。

There was a similar question asked on MSDN: https://social.msdn.microsoft.com/Forums/vstudio/en-US/d85dcde7-839a-44d3-9f2a-8b47b947576c/swipe-gesture-and-page-change?forum=wpf 在MSDN上有一个类似的问题: https//social.msdn.microsoft.com/Forums/vstudio/en-US/d85dcde7-839a-44d3-9f2a-8b47b947576c/swipe-gesture-and-page-change?forum = WPF

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM