I have a storyboard and I want to have it animated when the data is loaded. I couldn't assign the TargetName there since I think control inside datatemplate is not visible to outside. So I was trying to use FindName to locate the control and do SetTarget in codebehind. However FindName always return null. I checked another post here and it said something about in different namespace so FindName won't work.
What I did is I catch the Loaded event from the control inside DataForm, and assign it to a variable. Then I do the SetTarget and Begin in another event (I use DataLoaded in DomainDataSource) to start the animation. Is there a better way?
What I did is I catch the Loaded event from the control inside DataForm, and assign it to a variable. Then I do the SetTarget and Begin in another event (I use DataLoaded in DomainDataSource) to start the animation. Is there a better way?
<
UserControl.Resources
>
<
Storyboard
x:Name
=
"myStoryboard"
>
<
DoubleAnimation
Storyboard.TargetProperty
=
"(UIElement.Projection).(PlaneProjection.RotationY)"
From
=
"-180.0"
To
=
"0.0"
Duration
=
"0:0:2"
AutoReverse
=
"False"
/>
</
Storyboard
>
</
UserControl.Resources
>