forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe-tests.ts
More file actions
58 lines (54 loc) · 1.63 KB
/
frame-tests.ts
File metadata and controls
58 lines (54 loc) · 1.63 KB
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
// <snippet module="ui/frame" title="frame">
// # Frame
// To perform navigation, you will need a reference to the topmost frame of the application.
// ``` JavaScript
import frameModule = require("ui/frame");
var topmost = frameModule.topmost();
// ```
// </snippet>
import labelModule = require("ui/label");
import pagesModule = require("ui/page");
export var test_DummyTestForSnippetOnly0 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating to a Module
// ``` JavaScript
topmost.navigate("details-page");
// ```
// </snippet>
}
export var test_DummyTestForSnippetOnly1 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating with a Factory Function
// ``` JavaScript
var factoryFunc = function () {
var label = new labelModule.Label();
label.text = "Hello, world!";
var page = new pagesModule.Page();
page.content = label;
return page;
};
topmost.navigate(factoryFunc);
// ```
// </snippet>
}
export var test_DummyTestForSnippetOnly2 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating with NavigationEntry
// ``` JavaScript
var navigationEntry = {
moduleName: "details-page",
context: { info: "something you want to pass to your page" },
animated: false
};
topmost.navigate(navigationEntry);
// ```
// </snippet>
}
export var test_DummyTestForSnippetOnly3 = function () {
// <snippet module="ui/frame" title="frame">
// ### Navigating Back
// ``` JavaScript
topmost.goBack();
// ```
// </snippet>
}