Files
Hristo Deshev 629eb6e683 Use relative imports in tns-core-modules.
Use tns-core-modules/* imports in outside code (apps, tests, etc)
2017-03-13 14:37:59 +02:00

18 lines
621 B
TypeScript

import * as enums from "tns-core-modules/ui/enums";
import * as pageModule from "tns-core-modules/ui/page";
import * as model from "./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;
}
}