-
Notifications
You must be signed in to change notification settings - Fork 1
/
menu2.js
61 lines (59 loc) · 2.34 KB
/
menu2.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// More Samples Menu page
//
exports.View =
{
title: "More Samples",
elements:
[
{ control: "stackpanel", width: "*", contents: [
{ control: "text", width: "*", value: "These samples are a little nerdier, and are intended to demonstrate how to use various controls and programming techniques in the Synchro environment." },
{ control: "button", caption: "{caption}", binding: { foreach: "pages", command: "goToView", view: "{view}" } },
] }
]
}
exports.InitializeViewModel = function (context, session)
{
var viewModel =
{
pages: [
{ caption: "Login", view: "login" },
{ caption: "Countdown", view: "countdown" },
{ caption: "Image", view: "image" },
{ caption: "Canvas", view: "canvas" },
{ caption: "Text Layout", view: "textlayout" },
{ caption: "Movies2", view: "react2" },
{ caption: "Location", view: "location" },
{ caption: "Launch URL", view: "launchurl" },
{ caption: "Styles", view: "styles" },
{ caption: "Toggle", view: "toggle" },
{ caption: "Button", view: "button" },
{ caption: "ListView", view: "listview" },
{ caption: "Device", view: "device" },
{ caption: "Listbox", view: "list" },
{ caption: "List Click", view: "listclick" },
{ caption: "StackPanel", view: "stack" },
{ caption: "WrapPanel", view: "wrap" },
{ caption: "Border", view: "layout" },
{ caption: "Default Layout", view: "default" },
{ caption: "Fill", view: "fill" },
{ caption: "Flex", view: "flex" },
{ caption: "Flex 2", view: "flexflex" },
{ caption: "Flex 3", view: "flex3" },
{ caption: "Text Flow", view: "textflow" },
{ caption: "Image Scale", view: "imagescale" },
{ caption: "Font", view: "font" },
{ caption: "Binding", view: "binding" },
{ caption: "Picker", view: "picker" },
{ caption: "Webview", view: "webview" },
{ caption: "Sandbox", view: "sandbox" },
]
}
return viewModel;
}
exports.Commands =
{
goToView: function(context, session, viewModel, params)
{
return Synchro.pushAndNavigateTo(context, params.view);
},
}