I am new to WPF and am trying to create a simple pop in effect. But I get the following error “The attachable property Triggers was not found in type newwindow. Below is the XAML code:
<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>
I am using VS 2010 with .net 3.5 framework.
Thank you.
Replace newwindow.Triggers through Window.Triggers and newwindow.Loaded through Window.Loaded.
The programm knows that you want to refer to your newwindow because its in the xaml of your newwindow-Window (And consider renaming your “newwindow”)^^.
(You could have edited your old Question…)