nativescript-community / ui-canvas

Implement Canvas into your NativeScript apps.
https://nativescript-community.github.io/ui-canvas/
Apache License 2.0
31 stars 9 forks source link

feat: Added missing support and demo for NativeScript Core. #26

Closed CatchABus closed 3 years ago

CatchABus commented 3 years ago

This PR adds missing draw Event and Shapes support for NativeScript Core. For plain XMLs to set values to events, we needed to register events as static variables inside CanvasView. About Shapes, I created an index file and use it to export them through canvas-common.ts.

Additionally, a demo has been added that contains most of examples.

One drawback for NativeScript Core is that Shapes do not support data binding, therefore expressions like {{ myVar }} will throw errors. For now, one can get a shape from CanvasView using shapes ObservableArray and getItem method to retrieve by index (see demo/app/examples/Shapes.ts).