Why does this ScrollViewer's ScrollBars appear twice?

帅比萌擦擦* 提交于 2019-12-22 01:16:47

问题


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?

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>

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?


回答1:


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.



来源:https://stackoverflow.com/questions/37467867/why-does-this-scrollviewers-scrollbars-appear-twice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!