Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as app from "tns-core-modules/application";
- import {parse} from "tns-core-modules/ui/builder";
- import {Frame, Page} from "tns-core-modules/ui/frame";
- const frame = new Frame();
- const page1 = <Page>parse(
- `<Page><StackLayout><Button text="to Page 2" tap="{{ toPage2 }}"/></StackLayout></Page>`
- );
- const page2 = <Page>parse(
- `
- <Page>
- <StackLayout>
- <Button text="to Page 1" tap="{{ toPage1 }}"/>
- <TabView>
- <TabViewItem title="First Tab">
- <StackLayout>
- <Label text="First Tab"/>
- </StackLayout>
- </TabViewItem>
- <TabViewItem title="Second Tab">
- <StackLayout>
- <Label text="Second Tab"/>
- </StackLayout>
- </TabViewItem>
- </TabView>
- </StackLayout>
- </Page>`
- );
- page1.bindingContext = {
- toPage2: () => frame.navigate(() => page2)
- };
- page2.bindingContext = {
- toPage1: () => frame.navigate(() => page1)
- };
- app.run({
- create: () => {
- frame.navigate(() => page1);
- return frame
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement