Open dr1rrb opened 5 years ago
This is me reporting my findings with the way animations interact on Windows when they affect shared Transforms and the many cases around the idea of animations and transforms being used for multiple targets. This was initially noticed as one of many CommandBar problems being solved in #13214. From here on out, I will refer to cases of a transform being used multiple times as SharedTransform. Similarly, I will name a single animation that's used for different elements, SharedAnimation.
Code for all cases can be found at https://gist.github.com/ramezgerges/909df0982622c021caf0d5c62f46e631
Storyboard.TargetName="SharedTransform" Storyboard.TargetProperty="X"
)Storyboard.TargetName="Border1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
).Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
on the Button, or Storyboard.TargetProperty="X"
on the transform directly.Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
. Trying to reference a shared StaticResource Transform from inside the template causes name resolution problems, so I couldn't test with Storyboard.TargetName="SharedTransform" Storyboard.TargetProperty="X"
.Some general related findings
All in all, it seems that the most interesting observation is that StaticResource transforms are cloned at the point of running an animation, but not before.
Gist
GitHub Gist: instantly share code, notes, and snippets.
I'm submitting a...
Current behavior
Animations are tightly coupled with the control (or
RenderTransform
) that they are animating They cannot be declared in resources and re-used on multiple controls as they can be on Windows.Expected behavior
A transform can be declared in resources, re-used as
RenderTranform
on multiple controls across an application, and then animated.Environment
Nuget Package: Uno.UI Package Version(s): irrelevant Affected platform(s):
Visual Studio: irrelevant Relevant plugins: none