How to use the @nativescript/core/ui/page.Page function in @nativescript/core

To help you get started, we’ve selected a few @nativescript/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NativeScript / NativeScript / tests / app / ui / tabs / tabs-root-tests.ts View on Github external
function createPage(i: number) {
    const page = new Page();
    page.id = `Tab${i} Frame${i} Page${i}`;

    return page;
}
github NativeScript / NativeScript / tests / app / ui / root-view / reset-root-view-tests.ts View on Github external
function createTestFrameRootEntry() {
    const page = new Page();
    const frameRoot = new Frame();
    frameRoot.navigate(() => page);

    const entry: NavigationEntry = {
        create: () => frameRoot
    };

    return {
        entry: entry,
        root: frameRoot,
        page: page
    };
}
github NativeScript / NativeScript / tests / app / ui / bottom-navigation / bottom-navigation-root-tests.ts View on Github external
function createPage(i: number) {
    const page = new Page();
    page.id = `Tab${i} Frame${i} Page${i}`;

    return page;
}
github NativeScript / NativeScript / tests / app / ui / frame / frame-tests-common.ts View on Github external
const create = () => {
        const page = new Page();
        pages.push(page);

        return page;
    };
github NativeScript / NativeScript / tests / app / navigation / transition-tests.ts View on Github external
helper.navigate(() => {
        const page = new Page();
        page.id = "TransitionsTestPage_MAIN";
        page.style.backgroundColor = new Color(255, Math.round(Math.random() * 255), Math.round(Math.random() * 255), Math.round(Math.random() * 255));

        return page;
    });
github NativeScript / NativeScript / tests / app / pages / property-bindings.ts View on Github external
export function createPage() {
    var page = new pages.Page();
    var grid = new gridModule.GridLayout();
    grid.addRow(new gridModule.ItemSpec());
    grid.addRow(new gridModule.ItemSpec());
    page.content = grid;

    var count = 0;
    var control = new btns.Button();
    control.text = "test control";
    control.on(btns.Button.tapEvent, (data) => { control.text = "count: " + count++; });
    grid.addChild(control);

    var scrollView = new scroll.ScrollView();
    gridModule.GridLayout.setRow(scrollView, 1);
    grid.addChild(scrollView);
    var stack = new stacks.StackLayout();
    scrollView.content = stack;
github NativeScript / NativeScript / tests / app / ui / bottom-navigation / bottom-navigation-root-tests.ts View on Github external
export function tearDownModule() {
    const page = new Page();
    const frame = new Frame();
    frame.navigate(() => page);

    const entry: NavigationEntry = {
        create: () => frame
    };

    waitUntilNavigatedToMaxTimeout([page], () => _resetRootView(entry));
}
github NativeScript / NativeScript / tests / app / pages / page9.ts View on Github external
grid.addColumn(new ItemSpec(1, "auto"));
    grid.addColumn(new ItemSpec(1, "star"));

    grid.addRow(new ItemSpec(1, "auto"));
    grid.addRow(new ItemSpec(1, "star"));

    var image = new Image();
    image.stretch = "fill";
    image.verticalAlignment = "bottom";
    image.horizontalAlignment = "center";

    image.imageSource = ImageSource.fromFileSync(__dirname + "/test.png");
    grid.addChild(image);

    var page = new Page();
    page.content = grid;
    page.css = "GridLayout { background-color: pink } image { background-color: green }";

    return page;
}