在GridView中检测滚动事件(Windows 8) [英] Detecting a scroll event in GridView (Windows 8)

查看:86
本文介绍了在GridView中检测滚动事件(Windows 8)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们如何在诸如默认GridView模板示例应用程序之类的东西上检测GridView中的滚动事件(例如ScrollViewer上的ViewChanged)?我想复制netflix应用程序在左侧红色条上所做的效果.

How do we detect a scrolling event in GridView (like ViewChanged on ScrollViewer) on somethig like the default GridView template sample app? I'd like to replicate the effect that the netflix App does on the left red strip.

我曾尝试将GridView放在scrollviewer中,但在将其拉伸以填充不同分辨率的屏幕方面一直没有成功.

I tried putting the GridView inside a scrollviewer, but I've been unsuccessful at stretching it to fill the screen for different resolutions.

更新:我打算将它与NuGet上的VariableGrid控件一起使用-尽管它不是官方控件,但它继承了GridView

Update: I intend to use this with VariableGrid control that's on NuGet - though it's not an official control, it inherits GridView

推荐答案

执行此操作的最佳方法似乎是您可以通读控件的组件并为其分配事件.根据此示例中发生的情况

The best way to do this seems that you can read through the components of the control, and assign events to it. based on what's happening in this example

我使用VisualTreeExtensions抓住了对滚动条的访问权限,并且可以捕获事件Scroll,就像在示例中一样.当网格的Loaded事件被触发时,我必须阅读孩子们的内容.

I grabbed access to the scrollbar, suing the VisualTreeExtensions and I could capture the event Scroll, just like in the example. I had to read the children when the Loaded event of the grid was fired.

这篇关于在GridView中检测滚动事件(Windows 8)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆