[Feature] AnimatedCornerRadius #241
Replies: 6 comments
-
Hello, 'AbdAlghaniAlbiek! Thanks for submitting a new feature request. I've automatically added a vote 👍 reaction to help get things started. Other community members can vote to help us prioritize this feature in the future! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the example @AbdAlghaniAlbiek, did you have a scenario in mind where you were trying to animate the corners of an element? @Sergio0694 thoughts on this? Can we not animate them in another method already? |
Beta Was this translation helpful? Give feedback.
-
@michael-hawker In Telegram when you swip an item from your contracts list, the corners of swiped item will be rounded like Screenrecorder-2021-12-09-21-52-22-114.mp4The problem is that there isn't a "DoubleAnimation" that can make animate each of corner of this control in AnimationBuilder |
Beta Was this translation helpful? Give feedback.
-
Yes, and it's not a coincidence that this animation type was removed on UWP: it's absolutely terrible for performance. It's even worse than regular double animations targeting properties such as eg. "Opacity". If we want to add a way to animate corner radiai, we should do that with a proper composition animation targeting the right property on the shadow visual, if there's one. Also, side note: you can animate what you're describing with |
Beta Was this translation helpful? Give feedback.
-
hmm .. You mean the same reason that make you deleting light animation -> for performance reasons If you don't have the desire to implement it in the toolkit, It's ok I'll close this issue .. you always know what is the best for this toolkit 👍👍 |
Beta Was this translation helpful? Give feedback.
-
Not really. All light effects are pretty fast as they run on the GPU. We also still have them in the new Microsoft Store 🙂
I didn't say we shouldn't add this. I just said if we want to add this, this is not the correct implementation for this. |
Beta Was this translation helpful? Give feedback.
-
Describe the problem this feature would solve
I have made a TemplatedControl that have 4 new properties (TopLeftCorner, TopRightCorner, BottomLeftCorner, BottomRightCorner) and each of them control in the radius of corner that associated with.
And the purpose of doing this that in WPF there type of animation called: "ThicknessAnimation" and this animation provide me the ability to animate the properties that are from thickness class like: (margin, padding, borderThickness ...) and because this animation isn't available in UWP the solutions simply was making a dependency property for each paramerter of the thickness and animate them all such as: (make four properties for the Margin => LeftMargin, TopMargin, RightMargin, BelowMawrgin, and animate all of them or some of them depending on your needs in one storyboard) and in my sample here I made animation for the corners of border
The generic xaml for this TemplatedControl :
And .cs file
and I define this control in MainPage and put the storyboard inside the same control and I made this storyboard ""Begin"" in code behind:
But then I think to make this properties as Attached properties to be possible to any one to implement it directly in any dependency object but then I figured out that It is impossible to animate attached properties, so I need your help to choice what is the better choice to deal with (making entirely new control to animate the corners OR there is some way else in behaviors and AnimationBuilder that can do it ????)
Describe the solution
Making Animating CornerRadius possible using custom control
Describe alternatives you've considered
It's a good idea to add this type of animation (CornerRadiusAnimation or ThicknessAnimation) to AnimationBuilder if this possibole
Additional context & Screenshots
recordedVideo2021-12-07-232948.mp4
Beta Was this translation helpful? Give feedback.
All reactions