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

We cannot change the value of a DependencyProperty which has been animated #631

Closed
3 of 5 tasks
dr1rrb opened this issue Feb 27, 2019 · 2 comments · Fixed by #11865
Closed
3 of 5 tasks

We cannot change the value of a DependencyProperty which has been animated #631

dr1rrb opened this issue Feb 27, 2019 · 2 comments · Fixed by #11865
Assignees
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/animations 🎡 Categorizes an issue or PR as relevant to animations

Comments

@dr1rrb
Copy link
Member

dr1rrb commented Feb 27, 2019

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

Once an animation has been used to alter a DependencyProperty, we cannot change its value using the property accessor.

Expected behavior

During the animation, the SetValue(DP, value) has no effect (but the value is stored for future animations), and once the animation is completed, we can change the value using SetValue(DP, value), and future animations use this new value as initial value.

Minimal reproduction of the problem with instructions

  1. Alter a property using an animation
var animation = new DoubleAnimation
{
	To = 50,
	Duration = new Duration(TimeSpan.FromSeconds(10))
};
Storyboard.SetTargetProperty(animation, nameof(TranslateTransform.Y));
Storyboard.SetTarget(animation, _transform);

new Storyboard
{
	Children = { animation}
}.Begin();
  1. Alter the property using SetValue:
_transform.Y = 0; // This won't have any effect
Assert.IsTrue(_transform.Y == 50); // This will pass 😱

Workaround

You cant alter the value using another animation.

Environment

Nuget Package: Uno.UI
Package Version(s): irrelevant
Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • Windows
  • Build tasks

Visual Studio: irrelevant
Relevant plugins: none

@jeromelaban jeromelaban added the kind/bug Something isn't working label Mar 6, 2019
@ghuntley ghuntley added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform labels May 22, 2019
@jeanplevesque
Copy link
Member

I have the same problem.
This is my workaround:

_transform.Y = y; // Just this doesn't work.
#if __IOS__ || __ANDROID__
_transform.SetValue(TranslateTransform.YProperty, y, DependencyPropertyValuePrecedences.Animations);
#endif

@MatFillion
Copy link
Contributor

@dr1rrb

@jeromelaban jeromelaban added priority/important-longterm project/animations 🎡 Categorizes an issue or PR as relevant to animations labels May 27, 2020
@francoistanguay francoistanguay added this to the 3.1 milestone Aug 29, 2020
@dr1rrb dr1rrb modified the milestones: 3.1, 3.2 Sep 23, 2020
@jeromelaban jeromelaban added the difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. label Feb 15, 2021
@MartinZikmund MartinZikmund added difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding and removed difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels May 31, 2021
@MartinZikmund MartinZikmund added this to the 3.9 milestone May 31, 2021
@jeromelaban jeromelaban removed this from the 3.9 milestone Aug 11, 2021
@Xiaoy312 Xiaoy312 self-assigned this Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform project/animations 🎡 Categorizes an issue or PR as relevant to animations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants