Storyboard c++
Hey, how can I have control of storyboard C++? Can I have any callbacks methods when finished? Or started?
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Storyboard c++
You can register to the Completed event of the Storyboard:
Code: Select all
Storyboard* storyboard = FindResource<Storyboard*>("SomeAnimation");
storyboard->Completed() += [](BaseComponent*, const TimelineEventArgs&)
{
// do something
};
storyboard->Begin(this);
Re: Storyboard c++
Ok thanks its what I needed exactly, but now I have some WPF question.
Why does that code not moving my object? Its change its opacity but doesnt move :/
Code: Select all
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1"/>
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
<EasingDoubleKeyFrame KeyTime="0" Value="-400"/>
<EasingDoubleKeyFrame KeyTime="0:0:1" Value="300"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: Storyboard c++
Probably because your object doesn't have a TranslateTransform set in its RenderTransform property.
Code: Select all
<Rectangle>
<Rectangle.RenderTransform>
<TranslateTransform/>
</Rectangle.RenderTransform>
</Rectangle>
Re: Storyboard c++
Yes, thats was it! I tested it on something other ThanksProbably because your object doesn't have a TranslateTransform set in its RenderTransform property.Code: Select all<Rectangle> <Rectangle.RenderTransform> <TranslateTransform/> </Rectangle.RenderTransform> </Rectangle>
Who is online
Users browsing this forum: No registered users and 30 guests