I want to create a ScrollView that only shows the horizontal scroll bar when the mouse is over it, so I tried the following (note how I simply try to trigger the HorizontalScrollBarVisibility to Auto when the mouse is over and predefine my ScrollViewer to have a Disabled HorizontalScrollBarVisibility):
<Window x:Class="OnMouseOverStackPanel.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<Style x:Key="Triggers" TargetType="ScrollViewer">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="HorizontalScrollBarVisibility" Value="Auto"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Grid.Row="0" Content="I'm a content filler."/>
<ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" Style="{StaticResource Triggers}">
<StackPanel Orientation="Horizontal" Height="30">
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
<Button Content="Hey, I'm a button!"/>
</StackPanel>
</ScrollViewer>
<Button Grid.Row="2" Content="I'm a content filler."/>
</Grid>
</Window>
Unfortunately this isn't working for me. How can I append triggers to this object to get it to work?