我在下面有结构,它可以工作:
<Storyboard x:Key="GrowOnStart">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Canvas.Left)" Storyboard.TargetName="window">
<EasingDoubleKeyFrame KeyTime="0" Value="1024"/>
如果我尝试这样的事情为什么它不起作用:
<EasingDoubleKeyFrame KeyTime="0" Value="{DynamicResource StartingPositionLeft}"/>
是的,我在故事板之前定义了资源。像下一个这样的声明也不起作用:
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding StartingPositionLeft}"/>
是的,它是背后代码的公共属性,并且this.DataContext设置为this。