Create

A code-behind file can be added at the project level or in a project folder. Any number of code-behind files can be added to the project.

A Code-Behind file can be created based on TypeScript or JavaScript. Both have the same technical options and are very similar in terms of programming. Due to the better Visual Studio programming support offered by Visual Studio, TypeScript should be selected for new functions.

Right-click the target node and click Add New Item. Select a code-behind file. The Code-Behind file can be opened by double-clicking in the source code editor.

Create 1:

Code-behind sort order

If you have added several code-behind files to the project, it is possible to specify the order in the build process and thus during inclusion within the HTML file of the HMI. This is necessary if dependencies exist within the individual files.

Right-click on the project node of the HMI project and select CodeBehind Sort Order and Theme Assignment.

Create 2:

Within the editor, the sort order can be defined under the JavaScript Files tab. The order can be changed using the Up and Down buttons.

Create 3:

The browsers only support JavaScript files. The generated JavaScript file is therefore displayed in this window.

Create 4: