This guide explains brief history of Smartface objects, dynamic objects and control manipulation.
Brief history of Smartface Objects
Given this dynamic object definition, it is possible to define the following elements on run-time:
- UI Objects (Any kind of user controls, such as Labels, TextButtons, Pages, Dialogs)
- Static defined functions
Properties of dynamic objects can be set during runtime as normal assignment. Their properties can also be set in their constructor using a key object which contains the properties for the target object.
- Create the Dynamic Object Variable
- Add it to the parent object
- Modify it any time
It is possible assign the properties for the object on any time:
In constructor, with the given key object Before adding to the parent After adding to the parent.It is also possible to combine all of those approaches together.
Using a key object within the constructor is highly recommended, because it will perform the operation slightly faster.
Using a key object also enables the developer to use it as style object.
In the Smartface project, there is an XML file saved with the project: “defaults.xml” which is located under config folder. This XML file contains the standard initial declaration property values for UI objects. To provide a standard UI feeling in the App, modify the values in this file, this will ease the customization of the UI for run-time dynamic objects.
To check the number of child controls can be done using length property of controls property. Pages and dialogs do not need to be added to somewhere, because they do not have any parent. In order to show them, just call the show function.
Cloning is used to create a new object using the same reference. The Event functions for both objects maintain their function as before, but the newly created (cloned) object does not have any parent. In order to display the cloned object, it should be added to a parent. All size-related properties are cloned as well.
Cloning has two options for container type objects:
|Normal Clone:||Just clones the container type object, not the child objects|
|Deep Clone:||Clones both the container type object and their child objects recursively.|