Change default time of auto-hide timer of ScrollViewer scrollbars

前端 未结 1 1998
情深已故
情深已故 2021-01-13 14:29

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 le

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-13 14:56

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

    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.

    Being that they're animations inheriting in order of;

    Object -> DependencyObject -> Timeline

    ...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.

    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. :)

    0 讨论(0)
提交回复
热议问题