更改ScrollViewer滚动条自动隐藏计时器的默认时间 [英] Change default time of auto-hide timer of ScrollViewer scrollbars

查看:73
本文介绍了更改ScrollViewer滚动条自动隐藏计时器的默认时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当ScrollViewer上显示滚动条,并且光标在大约3秒钟内未移动时,滚动条会自动隐藏.

When a ScrollViewer has scrollbars showing, and the cursor is not moved for around 3 seconds, the scrollbars auto hide.

是否可以将时间设置为大于或小于默认时间?

Is there a way to set that time to more or less than the default time?

编辑

复制如下:

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

将光标移到ScrollViewer上以显示滚动条.让光标静止不动3秒钟,以查看滚动条消失.我想将这3秒更改为1.

Move the cursor over the ScrollViewer to show the scrollbar. Leave the cursor motionless for 3 seconds to see the scrollbar disappear. I want to change those 3 seconds to 1.

编辑2

后续问题-为什么此ScrollViewer的ScrollBar出现两次?a>.

Follow-up question - Why does this ScrollViewer's ScrollBars appear twice? .

推荐答案

我想我必须开始改掉在评论中进行快速回答的习惯,这样;

I suppose I need to start breaking the habit of doing quickie answers in comments anyway so;

根据上面的原始评论进行. Scrollbar 的控件样式模板在 VisualStateManager 部分中嵌入了嵌套在各种状态中的FadeIn/FadeOut的ThemeAnimation.

Carrying from the original comments above. The control style templates for Scrollbar have embedded ThemeAnimation's for FadeIn/FadeOut nested in various states in the VisualStateManager portion.

因为它们是动画继承于顺序

对象-> DependencyObject->时间轴

Object -> DependencyObject -> Timeline

...它们确实支持诸如 BeginTime Duration 之类的依赖项属性,这些属性使我们能够更改其动作的默认行为.因此,要纠正这种情况,您可以选择将它们从 VisualStateManager 内的相应状态中完全删除,也可以更改属性以更好地满足自己的时间轴要求.

...they do support Dependency Properties such as BeginTime and Duration that allows us to alter the default behavior of their action. So to remedy your scenario you have the options of either removing them entirely from their respective states within the VisualStateManager or you can alter the properties to better suit your needs of your own timeline requirements.

执行此操作仅是使用VS或Blend提取控件模板,然后将更改显式应用于模板副本或全局覆盖默认值.

Doing this is just a matter of extracting the control template using either VS or Blend and either applying changes explicitly to a copy of the template or overriding the default globally.

很高兴您找到了补救措施.:)

Glad you found your remedy. :)

这篇关于更改ScrollViewer滚动条自动隐藏计时器的默认时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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