Design view goes "Whoops" on my XAML code, but it will compile and run.

I posted a similar issue earlier, the difference here is that it runs properly.

Nonetheless, the design pane can't deal with it. Complains thusly

Error 9 Objects of type 'System.Windows.Media.Animation.BeginStoryboard' do not have child object collections. <my local path removed here>Window1.xaml 67 13 WinFxRotate

Here's the XAML (no C# code required).

<Windowx:Class="WinFxRotate.Window1"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

Title="WinFxRotate"Height="200"Width="300"

>

<CanvasBackground="Gray"Height="200"Width="300"HorizontalAlignment="Center"> <!--Storyboards moved to root-->

<StackPanelHorizontalAlignment="Center">

<!-- Filler canvas. Use StackPanel-->

<CanvasWidth="300"Height="25"HorizontalAlignment="Center">

</Canvas>

<CanvasBackground="#00000000"Width="60"Height="60"Name="SpinCanvas"HorizontalAlignment="Center">

<!-- Create the objects to animate.-->

<EllipseName="Wheel"

Canvas.Top="0"Canvas.Left="0"Fill="blue"

Width="60"Height="60"Stroke="black"StrokeThickness="2">

<Ellipse.RenderTransform>

<RotateTransformAngle="0"CenterX="25"CenterY="25" />

</Ellipse.RenderTransform>

</Ellipse>

<EllipseName="YellowFilter"

Canvas.Top="44"Canvas.Left="24"Fill="Yellow"

Width="12"Height="12"Stroke="black"StrokeThickness="1">

</Ellipse>

<EllipseName="GreenFilter"

Canvas.Top="4"Canvas.Left="24"Fill="Green"

Width="12"Height="12"Stroke="black"StrokeThickness="1">

</Ellipse>

<EllipseName="RedFilter"

Canvas.Top="24"Canvas.Left="4"Fill="Red"

Width="12"Height="12"Stroke="black"StrokeThickness="1">

</Ellipse>

<EllipseName="WhiteFilter"

Canvas.Top="24"Canvas.Left="44"Fill="White"

Width="12"Height="12"Stroke="black"StrokeThickness="1">

</Ellipse>

<EllipseName="Axle"

Canvas.Top="28"Canvas.Left="28"Fill="Gray"

Width="4"Height="4"Stroke="Black"StrokeThickness="1">

</Ellipse>

<Canvas.RenderTransform>

<RotateTransformAngle="0"CenterX="30"CenterY="30" />

</Canvas.RenderTransform>

</Canvas>

<CanvasWidth="300"Height="25"HorizontalAlignment="Center">

</Canvas>

<StackPanelOrientation="Horizontal"HorizontalAlignment="Center">

<!-- Create some buttons to control the animations.-->

<ButtonName="startButton">Start</Button>

<ButtonName="stopButton">Stop</Button>

<StackPanel.Triggers>

<EventTriggerRoutedEvent="Button.Click"SourceName="startButton">

<BeginStoryboardName="myBeginStoryboard">

<Storyboard>

<!-- This timeline is used to control the animations in this example.-->

<!-- Animate the angle of the RotateTransform from

0 to 360 over 4 seconds.-->

<DoubleAnimationStoryboard.TargetName="SpinCanvas"

Storyboard.TargetProperty="(Canvas.RenderTransform).(RotateTransform.Angle)"

From="0"To="360"RepeatBehavior="Forever"Duration="0:0:1"/>

</Storyboard>

</BeginStoryboard>

</EventTrigger>

<EventTriggerRoutedEvent="Button.Click"SourceName="stopButton">

<StopStoryboardBeginStoryboardName="myBeginStoryboard" />

</EventTrigger>

</StackPanel.Triggers>

</StackPanel>

</StackPanel>

</Canvas>

</Window>

[25886 byte] By [NickNotYet] at [2008-2-24]
# 1

Hi Nick,

The issue you are seeing is due to a known XAML Load Limitation in the Cider May CTP.

To make it work you have to wrap the <StoryBoard> in a <BeginStoryBoard.StoryBoard> like this:

<BeginStoryboard.Storyboard> <!-- added workaround -->

<Storyboard>

<!-- This timeline is used to control the animations in this example. -->

<!-- Animate the angle of the RotateTransform from 0 to 360 over 4 seconds. -->

<DoubleAnimation Storyboard.TargetName="SpinCanvas"

Storyboard.TargetProperty="(Canvas.RenderTransform).(RotateTransform.Angle)"

From="0" To="360" RepeatBehavior="Forever" Duration="0:0:1"/>

</Storyboard>

</BeginStoryboard.Storyboard> <!-- added workaround -->

If you are interested you can take a look at the Cider XAML Load Limitations for the MayCTP here:

http://channel9.msdn.com/wiki/default.aspx/Cider.MayCTPXAMLLoadLimitations

In particular the StoryBoard limitation can be found here:

http://channel9.msdn.com/wiki/default.aspx/Cider.MayCTPAnimationLimitations

Hope this helps,

Nikola

nikolami at 2007-9-10 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...
# 2

That did the trick.

Thanks much.

NIK

PS. I did glance at the limitations during the install process, but it wasn't very meaningful to me at the time.

NickNotYet at 2007-9-10 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...
# 3

Yes, the culprit is

<BeginStoryboard Name="myBeginStoryboard">

<Storyboard>

In the May CTP Cider has a load limitation with that. You can workaround this by doing this:

<BeginStoryboard>
<BeginStoryboard.Storyboard>
<Storyboard>

Please have a look through the load limitations wiki pages at: http://channel9.msdn.com/wiki/default.aspx/Cider.MayCTPXAMLLoadLimitations

JimNakashima-MSFT at 2007-9-10 > top of Msdn Tech,Visual Studio Orcas,WPF Designer (Cider)...

Visual Studio Orcas

Site Classified