mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-19 14:20:22 +08:00

* chore(tslint): fix tslint config & errors * chore(tslint): enable double quotes, whitespace, and arrow-return-shorthand rules and fix errors
23 lines
804 B
TypeScript
23 lines
804 B
TypeScript
import * as pageModule from "tns-core-modules/ui/page";
|
|
import * as absoluteLayout from "tns-core-modules/ui/layouts/absolute-layout";
|
|
import * as model from "./myview";
|
|
|
|
var count = 0;
|
|
|
|
export function onLoaded(args: { eventName: string, object: any }) {
|
|
var page = <pageModule.Page>args.object;
|
|
page.bindingContext = new model.ViewModel();
|
|
}
|
|
|
|
export function onSetLeftSetTop(args: { eventName: string, object: any }) {
|
|
var layout = args.object.parent;
|
|
var child = layout.getViewById("setLeftSetTop");
|
|
if (++count % 2 === 1) {
|
|
absoluteLayout.AbsoluteLayout.setLeft(child, 175);
|
|
absoluteLayout.AbsoluteLayout.setTop(child, 375);
|
|
} else {
|
|
absoluteLayout.AbsoluteLayout.setLeft(child, 0);
|
|
absoluteLayout.AbsoluteLayout.setTop(child, 400);
|
|
}
|
|
}
|