Add custom properties to displays.
How-to Guides → Solution Examples → Feature Examples → User Interactions Examples → Displays Custom Properties Example
Display Custom Properties are local variables created for a specific Display. They can be accessed in CodeBehind and in the Display itself.
Custom properties can also be linked to Tags by setting the Property Name as @Tag.<TagName>, where <TagName> is a valid name in Unified Namespace → Tags.
The properties added to your display are stored as an array. They are accessed through an index. The index ordination depends on the order the properties were created.
E.g.:
@Display.<PageName>.CustomProperties[index]; |
This property can be used as an alternative to using tags in any logic.
An advantage is the possibility of decreasing the total communication points while maintaining the same project functionalities. This can be very useful depending on your license type.
On the other hand, the logic programmed with the CustomProperties is only valid for a specific Display, meaning you cannot retain the data from one Page to use in another one.
SetCustomPropertyValue(string propertyName, object propertyValue)
Sets custom property.
If the property does not already exist, it will be created as a new Property. |
@ symbol and the rest of the string is a valid tag name, the property is a reference to the Tag.@Display.MainPage.SetCustomPropertyValue("@Tag.Integer1", 50); |
SetCustomProperties(string str, string sep)
sep.@Display.MainPage.SetCustomProperties("p1=10;p2=20", ";"); |
GetCustomPropertiesAsString(string sep)
,.string msg = @Display.About.GetCustomPropertiesAsString(","); |
GetCustomPropertyValue(string propertyName, string defaultValue)
string propValue = @Display.MainPage.GetCustomPropertyValue("p1", "-1").ToString(); |
RemoveAllCustomProperties()
@Display.LogOn.RemoveAllCustomProperties(); |
If a Tag's Custom Property is removed, the Tag will retain the old property as its current value. |
In this section...