These are chat archives for AvaloniaUI/Avalonia

27th
May 2018
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 03:45
@grokys @jmacato I've started investigating using the Setter class in animations and I've found a few roadblocks. First one is how we would determine which Animator subclass to use for each type of value. This is currently handled via attributes on the setter types. Second, Setter has a lot of behavior that's tied to the styling/template/namescope layer that is completely not applicable to how it would be used in the animation layer.
We can make Setter inherit IAnimationSetter and solve the second problem, but I'm not sure about how to solve the first problem.
Unless we just move that attribute knowledge into Setter, which we could do.
Jumar Macato
@jmacato
May 27 2018 03:48
@jkoritzinsky the solution that we thought was to make a special logic just for Setter
Just make it inherit IAnimationSetter and the animations code will add a special case for it
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 03:48
I really don't like that...
Jumar Macato
@jmacato
May 27 2018 03:49
yeah, but that's the only compromise we have thought of... :(
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 03:49
I'm thinking of adding a method to IAnimationSetter called GetAnimator that creates the right animator. That should work.
And then we can get rid of the other setters.
I'll try it out.
Jumar Macato
@jmacato
May 27 2018 03:50
Sure, keep us posted
I should've asked you earlier, ohwell
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 03:52
:+1:
Jumar Macato
@jmacato
May 27 2018 03:56
So, if i understand this correctly, Setterwill have a GetAnimator method and from that method, it'll return the proper animator type depending on the Setters target prop?
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 03:58
I tried that. It doesn't work unless I add a dependency on Visuals from Styling.... I'd prefer to not have to do that so I'm currently investigating alternatives.
Jumar Macato
@jmacato
May 27 2018 03:59
Yeah, that was the dependency issue that showed up in animation's early phase
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 04:11
I've got an idea that I'm trying out. I'll let you know if it works.
Jumar Macato
@jmacato
May 27 2018 04:13
Alright that's great to know! :smile:
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 05:00
@jmacato take a look at the commit I just pushed to #1594 (Commit hash starting in 4b8c6df9). I was able to get setters working pretty cleanly and allowing an extension mechanism similar to ExpressionObserver.
Jumar Macato
@jmacato
May 27 2018 05:14
Neat! Will look on it now
Jumar Macato
@jmacato
May 27 2018 05:20
Wow, that is just super clever
Does it handle double properties yet? i may have missed it on my glance on it
Jumar Macato
@jmacato
May 27 2018 05:26
Nevermind that, just saw the default initializer with DoubleAnimator on it 😂
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 05:32
Only thing it doesn't handle yet is bindings since those are special-coded for styling.
We'll have to come up with a way to deal with that at some point (i.e. for the progressbar indeterminate animation)
Jumar Macato
@jmacato
May 27 2018 05:37
Yeah, and if possible, if we could fully stylize in xaml the indefinite animation itself
just listening to :indefinite pseudoclass would triggee such animation, which can be infinitely customized by users
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 05:39
After #1594 gets merged lets focus on that.
Jumar Macato
@jmacato
May 27 2018 05:41
would trigger* gitter mobile extremely sucks
@jkoritzinsky yeah, that was just my musings about it :)
btw, what do you mean by bindings support for our animations layer?
Jeremy Koritzinsky
@jkoritzinsky
May 27 2018 06:17
Right now the animations layer just uses Setter.Value. Because Setter.Value is used the way it is in styles, bindings assigned to it aren't evaluated on assignment. So, if there is a binding for Setter.Value, it is assigned as the binding object, not bound. We need to teach the animations layer how to handle that situation if we want to support binding the values in keyframes instead of using constants.
Jumar Macato
@jmacato
May 27 2018 07:46
Hmm, that would certainly complicate things