Files
NativeScript/apps/ui/app/layouts/absolute-page.ts
Nathan Walker 1e6fccf272 chore: cleanup
2020-07-23 14:03:37 -07:00

23 lines
763 B
TypeScript

import * as pageModule from '@nativescript/core/ui/page';
import * as absoluteLayout from '@nativescript/core/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);
}
}