Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

This document presents information about Displays custom properties.


On this page:

Table of Contents
maxLevel3
stylenone


About Custom Properties

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 on Unified Namespace → Tags.

The properties added to your display are created as an array format. They are accessed through an index. The index ordination depends on the order the properties were created.

E.g.:

Code Block
@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 are only valid for a specific Display. Meaning you cannot retain the data from one Page to use in another one.



Methods Available in Runtime

GetCustomPropertiesAsString(string sep)

  • Gets all custom properties
  • Default Separator is ” , ”
  • Returns a string
Code Block
titleExample
string msg = @Display.About.GetCustomPropertiesAsString(",");


GetCustomPropertyValue(string PropertyName,string defaultValue):

  • Gets value of custom property name
  • propertyName: Property Name
  • defaultValue: Default value if property could not be found
  • Returns property value
Code Block
titleExample
string  propValue  =  @Display.MainPage.GetCustomPropertyValue("p1","-1").ToString();


SetCustomProperties(string str, string sep)

  • Sets several custom properties at the same time
  • str: String containing custom properties separated by ’sep’
  • sep: Separator to each custom property 
Code Block
titleExample
@Display.MainPage.SetCustomProperties("p1=10;p2=20",  ";");


SetCustomPropertyValue(string propertyName, object propertyValue)

  • Sets custom property. If the property does not exist, it is created.
  • propertyName: Property Name. If the name starts with at ”@” symbol and the rest of the string is a valid tag name, the property is a reference to the Tag.
  • propertyValue: Property value 
  • Returns always 0. Not used.
Code Block
titleExample
@Display.MainPage.SetCustomPropertyValue("@Tag.Integer1",  50");


RemoveAllCustomProperties():

  • Removes all custom properties
  • Returns always. Not used.
Code Block
titleExample
@Display.LogOn.RemoveAllCustomProperties();


Info
titleNote

If a Tag’s Custom Property is removed, the Tag will retain the old property as its current value.



In this section...

Page Tree
root@parent
spacesV10