Why can't I refer to ActualWidth
as a value from, which I was able to use in code.
XAML:
<StackPanel>
<Button x:Name="cmdVibrate" HorizontalAlignment="Center">
<Button.Triggers>
<EventTrigger RoutedEvent="Button.MouseEnter">
<BeginStoryboard>
<Storyboard >
<DoubleAnimation From="{Binding RelativeSource={RelativeSource Mode=Self},Path=ActualWidth}" By="200" AutoReverse="True" Duration="0:0:1" Storyboard.TargetProperty="Width"></DoubleAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
Mouse over me to shake
</Button>
</StackPanel>
</Window>
RelativeSource={RelativeSource Mode=Self}
will probably be refering to theDoubleAnimation
(which doesn't have anActualWidth
property). Try to find the ancestorButton
insteadXaml