-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Allow setting custom Animator in property to Setter #6077
Allow setting custom Animator in property to Setter #6077
Conversation
Wouldn't this API be confusing outside of animations?
Maybe it's possible to use attached property "Animation.Animator" and explicit "IAnimationSetter.Type Animator" implementation to read value from that attached property? |
That is something I have considered and it would be better api solution, but I was just bit worried about performance of attached properties. |
@maxkatz6 The issue is that |
Can attached properties work without it being an |
Seems to be working https://github.com/wieslawsoltes/Avalonia/tree/feature/SetterAnimatorAttachedPropertyHack |
Open draft PR with attached property solution #6082 |
Better solution without breaking changes in #6082 |
What does the pull request do?
Allows setting custom Animator in style setter. This allows granular control of animator per property setter in styles useful for implementing custom geometry animators etc.
Example usage:
What is the current behavior?
You can only register global animators.
What is the updated/expected behavior with this PR?
You can set custom Animator in style setter.
How was the solution implemented (if it's not obvious)?
Added Animator property to Setter class and IAnimationSetter interface.
Checklist
Breaking changes
Animator
property has been added toIAnimationSetter
interface.Animator
property has been added toSetter
class as required byIAnimationSetter
interface contract.Obsoletions / Deprecations
Fixed issues