我是 WPF 新手,正在尝试创建一个简单的流行效果。但我收到以下错误“在类型 newwindow 中找不到可附加属性触发器。下面是 XAML 代码:
<Window x:Class="WpfApplication6.newwindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="newwindow" Height="295" Width="371">
<Grid Height="257" Width="349">
<Label Content="Label" Height="28" HorizontalAlignment="Left" Margin="115,0,0,112" Name="label1" VerticalAlignment="Bottom" Width="127" />
<newwindow.Triggers>
<EventTrigger RoutedEvent="newwindow.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</newwindow.Triggers>
</Grid>
</Window>
我正在使用带有 .net 3.5 框架的 VS 2010。
谢谢你。