some more comments from @AlbertoD
you can’t call these methods too quickly to reset the style. you may use timer.calllater
I tried this and it works nice. thanks Alberto.
Method
Public Sub ResetRectangleStyle()
Rectangle1.Style.Value("animation") = ""
End Sub
Button Pressed event
Rectangle1.Style.Value("animation") = "shake 0.5s"
Timer.CallLater(500, AddressOf ResetRectangleStyle )
for the records, I used this on a webcontainer and it works fine.