我想在 XAML 中制作一个同时增长和旋转的标签。为什么我的代码不起作用?(文本增长,但不旋转)
<Window
xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x = "http://schemas.microsoft.com/winfx/2006/xaml"
Title = "Animation"
Height = "600" Width = "1000" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Storyboard x:Key="Storyboard">
<DoubleAnimation
Storyboard.TargetProperty="FontSize"
From = "12" To = "200" Duration = "0:0:4"
RepeatBehavior = "Forever" AutoReverse="True"/>
<DoubleAnimation
Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
From="0" To="360" Duration="0:0:4"
RepeatBehavior="Forever"/>
</Storyboard>
</Window.Resources>
<Label x:Name="myLabel" Content = "Some text">
<Label.Triggers>
<EventTrigger RoutedEvent="Label.Loaded">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{StaticResource Storyboard}"/>
</EventTrigger.Actions>
</EventTrigger>
</Label.Triggers>
</Label>
</Window>