mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
23 lines
767 B
TypeScript
23 lines
767 B
TypeScript
import enums = require("ui/enums");
|
|
import pageModule = require("ui/page");
|
|
import model = require("./myview");
|
|
|
|
export function onLoaded(args: { eventName: string, object: any }) {
|
|
var page = <pageModule.Page>args.object;
|
|
page.bindingContext = new model.ViewModel();
|
|
}
|
|
|
|
export function onOrientation(args: { eventName: string, object: any }) {
|
|
var layout = args.object.parent;
|
|
if (layout.orientation === enums.Orientation.vertical) {
|
|
layout.orientation = enums.Orientation.horizontal;
|
|
} else {
|
|
layout.orientation = enums.Orientation.vertical;
|
|
}
|
|
}
|
|
|
|
export function onItemWidthItemHeight(args: { eventName: string, object: any }) {
|
|
var layout = args.object.parent;
|
|
layout.itemWidth = 40;
|
|
layout.itemHeight = 60;
|
|
} |