简体   繁体   English

WPF中的Windows Phone / Windows 8样式水平滚动?

[英]Windows Phone/Windows 8-style horizontal scrolling in WPF?

I'm writing an app in C# WPF and I'm hoping to implement a similar kind of touch-based horizontal scrolling that's featured prominently in Windows 8. At the moment I'm using ScrollViewer with content inside it. 我正在用C#WPF编写一个应用程序,希望实现Windows 8中的一种类似的基于触摸的水平滚动。此刻,我正在使用ScrollViewer,其中包含内容。 This works fine as far as the scrolling is concerned, but it creates problems when interacting with controls inside of it (for example, sliders). 就滚动而言,这可以正常工作,但与其中的控件(例如,滑块)进行交互时会产生问题。

With my limited programming knowledge (a month ago the most I'd done was create a mockup in Photoshop :P), I'd assume this was because the touch hits the ScrollViewer first? 以我有限的编程知识(一个月前,我最多要做的就是在Photoshop:P中创建一个模型),我认为这是因为触摸首先触及了ScrollViewer? Is there some way of flipping this around? 有什么办法可以解决这个问题吗? I would be happy even if you had to hit a white space to be able to scroll, I just need the user to be able to interact with the controls inside easily without accidentally scrolling all over the place ^_^ 即使您必须在空白处滚动才能滚动,我也很高兴,我只需要用户能够轻松地与内部控件交互,而不会在整个位置意外滚动^ _ ^

Unfortunately, I can't just code for Windows 8 as this is specifically for a bunch of touch-enabled Windows 7 machines. 不幸的是,我不能只为Windows 8编写代码,因为它专门针对一堆启用触摸功能的Windows 7计算机。

Look for the Metro theme here you might find some usful style here that you can modify and use.. 在这里查找Metro主题,您可能会在这里找到一些有用的样式,可以修改和使用。

Also you can check this website for information and guidelines on Metro UI on WPF 您也可以在WPF上查看网站以获取有关Metro UI的信息和指南。

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

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