Smartface Docs
Smartface Docs
Smartface Home
Smartface Reference
Release Notes
Smartface Docs
Smartface Docs
Getting Started with Smartface
Smartface Native Framework
Core Concepts
UI Elements
FlexLayout
Data & IO & Network
Device
Plugins
Extensions
Miscellaneous Native Features
Tips & Tricks
TUTORIALS
Data Binding
Hello Animation
Masking TextBox
Native Smartface & WebView Interaction
Sample Apps
Using Git with Smartface Cloud IDE to Manage and Sync Projects
TypeScript Support
Encryption & Cryptography
Integrating Test Automation on Smartface
SMARTFACE CLOUD DEVELOPMENT
Creating a New Project
Cloud IDE
Cloud IDE Basics
Runtime Properties
Reusable Components
Script Editor
Safe Area
Using Themes in Apps
Using UI Editor And Classes
Updating the UI Editor
Using ListView with UI Editor
Cloud IDE Notification Center
Panels
Resolving Design File Conflicts
Settings
Setting Component Shadows from the UI Editor
Show In Toolbox
Image Generation
Using UI Editor Components from Code
RTL And LTR Support
LIFECYCLE MANAGEMENT
Building Smartface Apps in the Cloud
Building Apps Locally with the Smartface CLI
KNOWLEDGE BASE
FAQ
Troubleshooting
Open Source
Release Notes
Changelog
Powered by GitBook

Runtime Properties

If you want to assign custom properties using the code, you can use component.dispatch as follows:

Before

JavaScript
JavaScript
this.marginTop = 5;

After

JavaScript
JavaScript
this.dispatch({
type: "updateUserStyle",
userStyle: {
marginTop: 5
}
});
​
// Perform this when position related properties to be changed
page.layout.applyLayout();

​

Previous
Cloud IDE Basics
Next
Reusable Components
Last updated 4 months ago