Animation's FillBehavior property set to "Stop" seems has no effect.
Hi there,
When setting Animation's FillBehavior to "Stop", is seem to have no effect. Which means when animation ended, it's still overriding the target property with animation value, but the expected result should be the target property value rollback to original.
Below is my code sample:
When setting Animation's FillBehavior to "Stop", is seem to have no effect. Which means when animation ended, it's still overriding the target property with animation value, but the expected result should be the target property value rollback to original.
Below is my code sample:
Code: Select all
var storyboard = new Storyboard();
var duration = new Duration(TimeSpan.Parse("0:0:1"));
var tAnimation = new StringAnimationUsingKeyFrames() {
Duration = duration,
FillBehavior = FillBehavior.Stop
};
tAnimation.KeyFrames.Add(new DiscreteStringKeyFrame() {
Value = "hello world",
KeyTime = KeyTime.FromPercent(0.5f)
});
Storyboard.SetTarget(tAnimation, heroCard);
Storyboard.SetTargetProperty(tAnimation, new PropertyPath(HeroControl.MessageProperty));
storyboard.Children.Add(tAnimation);
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Animation's FillBehavior property set to "Stop" seems has no effect.
I just tried the following xaml and it is working as expected:
There must be something different in your scenario that we are not managing correctly. Could you please create a ticket in our bugtracker and attach the xaml, classes and code involved in that example so we can reproduce the problem?
Thanks.
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<Storyboard x:Key="anim" TargetName="txt" TargetProperty="Text">
<StringAnimationUsingKeyFrames Duration="0:0:1" FillBehavior="Stop">
<DiscreteStringKeyFrame KeyTime="50%" Value="Hello world"/>
</StringAnimationUsingKeyFrames>
</Storyboard>
</Grid.Resources>
<Grid.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard Storyboard="{StaticResource anim}"/>
</EventTrigger.Actions>
</EventTrigger>
</Grid.Triggers>
<TextBlock x:Name="txt" Text="---" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="50"/>
</Grid>
Thanks.
Re: Animation's FillBehavior property set to "Stop" seems has no effect.
Hi sfernandez,
I have found the problem here. If I start the storyboard with "storyboard.Begin(this)", everything works as expected, just like you demo. But if I start the storyboard with "Storyboard.Begin(this, true)", then the origin value will be lost. I have submitted a ticket: https://bugs.noesisengine.com/view.php?id=1127
I have found the problem here. If I start the storyboard with "storyboard.Begin(this)", everything works as expected, just like you demo. But if I start the storyboard with "Storyboard.Begin(this, true)", then the origin value will be lost. I have submitted a ticket: https://bugs.noesisengine.com/view.php?id=1127
-
sfernandez
Site Admin
- Posts: 2984
- Joined:
Re: Animation's FillBehavior property set to "Stop" seems has no effect.
Thanks for your feedback, it was helpful to find the source of the problem.
We will solve it for the next release.
We will solve it for the next release.
Who is online
Users browsing this forum: Google [Bot], Semrush [Bot] and 90 guests