我有故事板:
<Storyboard x:Key="St1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imageBlue">
<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
我想提取 keyTime 值并将其放置在某处。换句话说,我一直在努力使这项工作:
<UserControl.Resources>
<sys:TimeSpan x:Key="FadeInBeginTime">0:0:2</sys:TimeSpan>
<Duration x:Key="FadeInDuration">0:0:1</Duration>
<Storyboard x:Key="St1">
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="imageBlue">
<EasingDoubleKeyFrame KeyTime={StaticResource FadeInDuration}" Value="0"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</UserControl.Resources>
注意我正在使用命名空间:
xmlns:sys="clr-namespace:System;assembly=mscorlib"
由于某种原因不起作用