-
Notifications
You must be signed in to change notification settings - Fork 1
/
hello.js
34 lines (30 loc) · 1.34 KB
/
hello.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// Hello page
//
exports.View =
{
title: "Hello World",
elements:
[
{ control: "text", value: "This sample app demonstrates Synchro data binding. No procedural code is required to update the greeting from the first and last name controls.", width: "*" },
{ control: "rectangle", width: "*", height: 5, color: "Black" },
{ control: "text", value: "Enter your name:", font: { size: 12, bold: true } },
{ control: "stackpanel", orientation: "Horizontal", contents: [
{ control: "text", value: "First name:", fontsize: 12, width: 200, verticalAlignment: "Center", textAlignment: "Right" },
{ control: "edit", fontsize: 12, width: 200, verticalAlignment: "Center", binding: "firstName" },
] },
{ control: "stackpanel", orientation: "Horizontal", contents: [
{ control: "text", value: "Last name:", fontsize: 12, width: 200, verticalAlignment: "Center", textAlignment: "Right" },
{ control: "edit", fontsize: 12, width: 200, verticalAlignment: "Center", binding: "lastName" },
] },
{ control: "text", value: "Hello {firstName} {lastName}", fontsize: 12, width: "*" },
]
}
exports.InitializeViewModel = function(context, session)
{
var viewModel =
{
firstName: "Planet",
lastName: "Earth",
}
return viewModel;
}