Closed AswinPG closed 1 year ago
I suggest creating a reusable stateful component for that with a State property that you then animated using a RxAnimation; it's the usual way to do things in MVU approach. It also has numerous benefits in my opinion. Said that you still have the ability to take a reference to the native control and directly call View extensions methods like FateTo or ScaleTo() Documentation: https://adospace.gitbook.io/mauireactor/components/animation
Is it okay to use behaviors like this
new Image(im=>{ im.Behaviors.Add(new AnimatedTapGesture(Navigate) { Scale = .9 }); })
You could, but it's not recommended. In MauiReactor you should write a component with a state and animate through it. Anyway in your code, it's better to clear all the behaviors before adding the new one, as MauiReactor could reuse the Image.
Got it. Thanks :)
I've further documented how to achieve this in a specific documentation article, please take a look here: https://adospace.gitbook.io/mauireactor/q-and-a/do-we-need-to-add-states-to-create-simple-animations-such-as-scaleto-fadeto-etc-on-tap
In the xaml world I used to create an Animated Tap behavior to add animation and tapgesturerecognizer to any control. I can simply add the behavior to a control and a visual feedback such as scale in and out can be shown and at the same time tap gesture works too. Is there simple way to achieve this type of animated tap control in MauiReactor instead of creating a state each time ? From what I've seen you need to change the state to Animate the control