mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 21:01:34 +08:00
25 lines
832 B
TypeScript
25 lines
832 B
TypeScript
import { EventData } from "data/observable";
|
|
import { MainPageViewModel } from "../mainPage";
|
|
import { WrapLayout } from "ui/layouts/wrap-layout";
|
|
import { Page } from "ui/page";
|
|
|
|
export function pageLoaded(args: EventData) {
|
|
let page = <Page>args.object;
|
|
let view = require("ui/core/view");
|
|
|
|
let wrapLayout = view.getViewById(page, "wrapLayoutWithExamples");
|
|
|
|
let examples: Map<string, string> = new Map<string, string>();
|
|
|
|
examples.set("webview", "web-view/web-view");
|
|
examples.set("webtest", "web-view/web-view-test");
|
|
|
|
let viewModel = new SubMainPageViewModel(wrapLayout, examples);
|
|
page.bindingContext = viewModel;
|
|
}
|
|
|
|
export class SubMainPageViewModel extends MainPageViewModel {
|
|
constructor(container: WrapLayout, examples: Map<string, string>) {
|
|
super(container, examples);
|
|
}
|
|
} |