MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / parentPage

Function parentPage

apps/automated/src/navigation/navigation-tests.ts:85–96  ·  view source on GitHub ↗
(title, innerPage)

Source from the content-addressed store, hash-verified

83 };
84
85 const parentPage = (title, innerPage) => {
86 const parentPage = new Page();
87 parentPage['tag'] = title;
88
89 const stack = new StackLayout();
90 innerFrame = new frame.Frame();
91 innerFrame.navigate({ create: () => innerPage });
92 stack.addChild(innerFrame);
93 parentPage.content = stack;
94
95 return parentPage;
96 };
97
98 const back = (pages) => Frame.topmost().goBack(Frame.topmost().backStack[Frame.topmost().backStack.length - pages]);
99 const currentPageMustBe = (tag) => TKUnit.assertEqual(Frame.topmost().currentPage['tag'], tag, 'Expected current page to be ' + tag + ' it was ' + Frame.topmost().currentPage['tag'] + ' instead.');

Calls 2

navigateMethod · 0.65
addChildMethod · 0.45

Tested by

no test coverage detected