I want to flip a Grid in my UserControl but the animation doesn't work
First approach:
XAML
<UserControl.Resources>
<Storyboard x:Name="flipping">
<DoubleAnimation Duration="0:0:5" From="0" To="180" Storyboard.TargetName="content" Storyboard.TargetProperty="(UIElement.Projection)(PlaneProjection.RotationY)"/>
</Storyboard>
</UserControl.Resources>
<Grid x:Name="content">
<Grid.Projection>
<PlaneProjection/>
</Grid.Projection>
...
</Grid>
Code behind:
flipping.Begin();
throws an Exception:
Cannot resolve TargetProperty (UIElement.Projection)(PlaneProjection.RotationY) on specified object.
Second approach:
content.Projection = new PlaneProjection();
var pointedStoryboard = new Storyboard();
var doubleAnnimationX = new DoubleAnimation();
doubleAnnimationX.Duration = TimeSpan.FromMilliseconds(500);
doubleAnnimationX.To = 2;
pointedStoryboard.Children.Add(doubleAnnimationX);
Storyboard.SetTarget(doubleAnnimationX, content);
Storyboard.SetTargetProperty(doubleAnnimationX, "(UIElement.Projection).(PlaneProjection.RotationY)");
pointedStoryboard.Begin();
Same error
Translating and Scaling using this code works without any issues.
Can anyone help me ?