我正在编写一些基本动画,并希望在不构建/部署整个项目的情况下看到它的渲染。如果我没记错的话,我在代码隐藏中创建动画时已经设法看到了这样的预览。我现在正在使用 xaml 并试图找出如何获得相同的结果。
我知道有“混合”解决方案,但我想避免它。“打开渲染效果”和“启用项目代码”按钮在 xaml 设计器中处于活动状态。
<Image
Name="CompressorGreySmokeNormalWay"
Source="/VirtualTrain.Setrag.GT46AC;component/Resources/Images/Common/SmokeIconGrey.png"
Width="{Binding ActualWidth, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}}"
Height="{Binding ActualHeight, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Canvas}}}" >
<Image.Triggers>
<EventTrigger
RoutedEvent="UserControl.Loaded">
<BeginStoryboard>
<Storyboard
AutoReverse="True"
Storyboard.TargetProperty="Opacity">
<DoubleAnimation
RepeatBehavior="Forever"
BeginTime="0:0:00.00"
From="1.0"
To="0.0"
Duration="0:0:01.00"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Image.Triggers>
</Image>
我希望设计师预览不透明度的变化,但实际上并没有。我错过了什么吗?