关于 xaml:Triggering on a ScrollViewer\\’s scroll bar visibility (WPF)

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

是否可以创建基于 ScrollViewer 的滚动条可见性触发的触发器?我有一个 ScrollViewer,它的 VerticalScrollBarVisibility 设置为 Auto,我只想在滚动条实际可见时更改 ScrollViewer 的某些属性。

类似这样的:

1
2
3
4
5
6
7
<ScrollViewer VerticalScrollBarVisibility="Auto">
    <ScrollViewer.Triggers>
        <Trigger Property="IsScrollBarVisible" Value="True">
            <!-- Setters -->
        </Trigger>
    </ScrollViewer.Triggers>
</ScrollViewer>

ComputedVerticalScrollBarVisibility.

上触发