ViewModelInstance

Represents an instantiated set of properties on a ViewModel. With this class you have access to the individual properties to get and set values from bindings.

Before the property modifications have any effect, you need to assign the instance to an artboard with Artboard.viewModelInstance.

Instances can be created from one File and applied to another. See transfer for more information.

Parameters

unsafeCppPointer

Pointer to the C++ counterpart.

fileLock

Lock shared by the File and native graph this instance belongs to. Updated through updateFileLock when assigned to another native graph.

Types

Link copied to clipboard
class Transfer

Wrapper type for transferring a view model instance between Files.

Properties

Link copied to clipboard

Getter/Setter for the underlying C++ pointer value.

Link copied to clipboard
Link copied to clipboard

Whether this objects underlying pointer is still valid.

Link copied to clipboard

Get the name of the view model instance.

Link copied to clipboard
open val refCount: Int
Link copied to clipboard
override var refs: AtomicInteger

Functions

Link copied to clipboard
open override fun acquire(): Int

Increments the references for this counter. Cannot be used for initialization - use refs.incrementAndGet instead.

Link copied to clipboard
open override fun cppDelete(pointer: Long)
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun release(): Int

Release this instance while holding the current file lock.

Link copied to clipboard

Set a nested, named ViewModelInstance.

Link copied to clipboard

Start a transfer of this ViewModelInstance to another File. This is necessary because normally the C++ lifetime of the instance is managed by the File it belongs to. When transferring, the instance needs to survive the possible deletion of its owning File.