Triggering on a ScrollViewer's scroll bar visibility (WPF)

╄→гoц情女王★ 提交于 2020-01-02 00:47:50

问题


Is it possible to create a Trigger that is triggered based on a ScrollViewer's scroll bar visibility? I have a ScrollViewer with its VerticalScrollBarVisibility set to Auto and I want to change some of the ScrollViewer's properties only when the scroll bar is actually visible.

Something like this:

<ScrollViewer VerticalScrollBarVisibility="Auto">
    <ScrollViewer.Triggers>
        <Trigger Property="IsScrollBarVisible" Value="True">
            <!-- Setters -->
        </Trigger>
    </ScrollViewer.Triggers>
</ScrollViewer>

回答1:


Trigger on ComputedVerticalScrollBarVisibility.



来源:https://stackoverflow.com/questions/1580036/triggering-on-a-scrollviewers-scroll-bar-visibility-wpf

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