Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AnimationPath RepeatBehavior="1" not work as expected #766

Closed
GF-Huang opened this issue Apr 5, 2021 · 5 comments
Closed

AnimationPath RepeatBehavior="1" not work as expected #766

GF-Huang opened this issue Apr 5, 2021 · 5 comments

Comments

@GF-Huang
Copy link
Member

GF-Huang commented Apr 5, 2021

Describe the bug

<hc:AnimationPath Data="M 0,0 l 5,5 l 8,-8" Stroke="White" StrokeThickness="2" RepeatBehavior="1"
                  StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" />

pqyO3kRWr3

Expected behavior
The animation only run once then stop.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • .net: .NET 5
  • IDE VS2019
  • Version 3.1.0

Additional context
Add any other context about the problem here.

@ghost1372
Copy link
Member

Did you try RepeatBehavior="Forever" ?

@GF-Huang
Copy link
Member Author

GF-Huang commented Apr 5, 2021

Forever show me same behavior.

@GF-Huang
Copy link
Member Author

GF-Huang commented Apr 5, 2021

I found that is the Microsoft stupid design.

image

https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.animation.repeatbehavior?f1url=%3FappId%3DDev16IDEF1%26l%3DZH-CN%26k%3Dk(System.Windows.Media.Animation.RepeatBehavior);k(DevLang-csharp)%26rd%3Dtrue&view=net-5.0

So I use "1x" instead of "1" works well.

@GF-Huang
Copy link
Member Author

GF-Huang commented Apr 5, 2021

But how to holds the animation path after end? Now after finish, the path disappeared.

<hc:AnimationPath Data="M0,0 l4,5 l8,-8" Stroke="White" StrokeThickness="1.5" RepeatBehavior="1x" Duration="0:0:1"
                  StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" />

cY59vAgQSM

@NaBian NaBian closed this as completed in bebe9b8 Apr 25, 2021
@NaBian
Copy link
Member

NaBian commented Apr 25, 2021

But how to holds the animation path after end? Now after finish, the path disappeared.

<hc:AnimationPath Data="M0,0 l4,5 l8,-8" Stroke="White" StrokeThickness="1.5" RepeatBehavior="1x" Duration="0:0:1"
                  StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeLineJoin="Round" />

cY59vAgQSM

after bebe9b8 you can use RepeatBehavior="1x" FillBehavior="HoldEnd"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants