Overview
When creating Displays, you have access to the client namespaces: Client, Displays and Layout.
The methods and properties of the those namespaces can be used directly in the Draw area, when applying Dynamic Properties to the UI elements, in expressions, or in the Display Code Behind. This section of the User Guide explores those namespaces and their typical usages.
For the complete reference on namespaces go to Objects and Namespaces.
On this page:
About the Client Namespaces
The Display namespace lists all the displays with their properties and their open and close methods.
The Layout namespace lists all the layouts with their properties and their open and close methods.
The Client namespace contains the properties of the environment on each connected client computer or mobile device.
When accessing a project object in the .NET Script Editor, it is necessary to prefix the namespace with an at ‘@’ symbol in order to avoid conflict with the .NET local variables names.
Display Opening Methods
There are many ways to open a new Display or Popup. For each method, specific characteristics must be considered. Below you will find every method for opening a new Display with some description on their behavior and how to use them.
Display.DisplayName.Open
- Begins Open Display process
- Returns a flag (true or false) indicating success or fail
- Uses the following syntax:
@Display.<DisplayName>.Open(); E.g.: @Display.MainPage.Open();
Display.DisplayName.OpenModal
- Opens Display as Modal
- Not available for Mono and HTML5
- Returns a flag (true or false) indicating success or fail
- Uses the following syntax:
@Display.<DisplayName>.OpenModal();E.g.:@Display.MainPage.OpenModal();
Display.DisplayName.NewPopup
- Opens a new popup. If the Display is already open, a new instance will open
- Always returns an empty string, independent if it succeeds or fails
- Uses the following syntax:
@Display.<DisplayName>.NewPopup(LabelList[label1=tag1;label2=tag2],Left,Top, Width,Height); E.g.: @Display.MyPopup.NewPopup("PID=PID1;NAME=’PID 1’");
Client.OpenDisplay
- Opens a Display
- Returns a flag (true or false) indicating success or fail
- Uses the following syntax:
@Display.OpenDisplay("DisplayName");@Display.OpenDisplay("About");
Client.OpenDisplayAtIndex
- Opens Display at x-order list of displays. Current Display is closed
- Returns a flag (true or false) indicating success or fail
- Uses the following syntax:
@Client.OpenDisplayAtIndex(string DisplayName,int index);E.g.:@Client.OpenDisplayAtIndex("MainPage",0);
Client.NewPopup
- Opens a new popup. If the Display is already open, a new instance will open
- Always returns an empty string, independent if it succeeds or fails
- Uses the following syntax:
@Client.NewPopup(string DisplayName, LabelList[label1=tag1;label2=tag2],Left, Top,Width,Height);E.g.: @Client.NewPopup("PopupPID","PID=PID1;NAME=’PID 1’");
Display Methods
Close()
- Begins close display
- Returns a flag indicating success (true) or fail (false)
bool sts = @Display.About.Close();
GetCustomPropertiesAsString(string sep)
- Gets all custom properties
- Default Separator is a comma ‘, ‘
- Returns a string
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
@Display.MainPage.GetCustomPropertyValue("p1","-1")
NewPopup(object[] items):
- Opens a new popup. If the Display is already open, a new instance will open
- Always returns an empty string, independent if it succeeds or fails
@Display.MyPopup.NewPopup("Max=MaxValue;Min=MinValue");
Open()
- Begins open display
- Returns a flag indicating success (true) or fail (false)
bool sts = @Display.About.Open();
OpenModal()
- Opens Display as modal
- Disabled for Mono and HTML5
- Returns a boolean indicating success (true) or fail (false)
bool sts = @Display.MainPage.OpenModal();
PrintDisplay(bool defaultPrinter)
- Begins print display
- Returns a boolean indicating success (true) or fail (false)
- defaultPrinter: flag indicating whether default printer must be used or not
bool sts = @Display.MainPage.PrintDisplay(true);
- If the default printer is set to false, a popup window will appear.
PrintDisplayDefaultPrinter(int PageOrientation) :
- Begins print display using default printer
- PageOrientation: 0 for Portrait and 1 for Landscape
- Returns a flag indicating success (true) or fail (false)
bool sts = @Display.MainPage.PrintDisplayDefaultPrinter(0);
RemoveAllCustomProperties():
- Removes all custom properties
- Returns always Not used
@Display.LogOn.RemoveAllCustomProperties();
SetCustomProperties(string str, string sep)
- Sets custom property. If property does not exist, it is created.
- propertyName: Property Name. If the name starts with an at ‘@’ symbol and the rest of the string is a valid tag name, the property is a reference to the Tag Value.
- propertyValue: Property value
- Returns always Not used
@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 an at ‘@’ symbol and the rest of the string is a valid tag name, the property is a reference to the Tag Value.
- propertyValue: Property value.
- Returns always Not used.
@Display.MainPage.SetCustomPropertyValue("p1", 50")
Display Runtime Properties
IsOpened: Indicates if the selected display is opened.
- Returns false if is not opened
- Returns true if is opened
Level: ReadOnly property with levels configured for the Display Object on Unified Namespace → Asset Tree.
VerticalScroll: Indicates the vertical scroll value.
ZoomLevel: Indicates the zoom level of the page. One is the normal zoom level. The images below show the difference between zoom level 1 and 2.