The exception shown above is thrown on this XAML for a Silverlight 4 application:
<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="NewtonsCradle.MainPage"
Width="640" Height="480">
<StackPanel Orientation="Horiontal">
<TextBlock Height="100" Name="TestText">Test</TextBlock>
<StackPanel.Triggers>
<EventTrigger RoutedEvent="Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="TestText"
Storyboard.TargetProperty="Height"
To="500"
Duration="0:0:1"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</StackPanel.Triggers>
</StackPanel>
</UserControl>
The code behind:
using System.Windows.Controls;
namespace NewtonsCradle
{
public partial class MainPage : UserControl
{
public MainPage()
{
// Required to initialize variables
InitializeComponent();
}
}
}
What's up? It seems perfectly reasonable code to me, coming from a WPF background.