0
我想弄清楚如何用MouseOver來改變邊框的邊框顏色。我嘗試了將TargetName設置爲StackPanel的VSM內邊框的名稱。我知道我的路要走,但我寧願嘗試一些...更改控件周圍的邊框顏色
<Border x:Name="LinksBorder" >
<StackPanel x:Name="LinksStackPanel" Margin="10" Orientation="Horizontal" FlowDirection="RightToLeft" HorizontalAlignment="Center" Width="311">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
</VisualState>
<VisualState x:Name="MouseOver">
<Storyboard>
<ColorAnimation
Duration="0" Storyboard.TargetName="LinksBorder" Storyboard.TargetProperty="(BorderBrush).(SolidBrush)" To="#FF0000" />
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>