为什么这个 ScrollViewer 的 ScrollBars 会出现两次? [英] Why does this ScrollViewer's ScrollBars appear twice?

查看:22
本文介绍了为什么这个 ScrollViewer 的 ScrollBars 会出现两次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编辑了一个 ScrollViewer 的模板,只等待 0.5 秒后隐藏滚动条,这在当时成功隐藏了它们,但它们又重新出现了 0.5 秒.为什么?

I edited a ScrollViewer's template to wait only 0.5 seconds before hiding the scrollbars, and this succeeds in hiding them at that time, but they reappear for another 0.5 seconds. Why?

要重现,请使用默认模板 (在 MSDN 上找到它) 并将 "3" 的 3 次出现更改为 "0.5".然后使用以下 XAML:

To reproduce, create a page resource for a ScrollViewer's Style with the default Template (find it here on MSDN) and change the 3 occurances of "3" to "0.5". Then use the following XAML:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <ScrollViewer Height="500" Width="500" Style="{StaticResource ScrollViewerControlTemplate1}">
        <Grid Background="Blue" Height="1000" Width="1000">
        </Grid>
    </ScrollViewer>
</Grid>

将光标移到 ScrollViewer 上以显示滚动条.让光标不动 0.5 秒,滚动条就会消失.然后它再次出现 0.5 秒.为什么?

Move the cursor over the ScrollViewer to show the scrollbar. Leave the cursor motionless for 0.5 seconds to see the scrollbar disappear. It then reappears for another 0.5 seconds. Why?

推荐答案

我觉得你不会让它工作,但如果你真的认为这值得你花时间 - 你可以把 ScrollBars 在您自己的网格中,并在您决定要这样做时在网格上运行您自己的动画.

I have a feeling you're not going to make it work, but if you REALLY think it's worth your time - you could put the ScrollBars in your own grids and run your own animations on the grids whenever you decide you want to do that.

这篇关于为什么这个 ScrollViewer 的 ScrollBars 会出现两次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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