-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathwrap-page.ts
More file actions
23 lines (20 loc) · 770 Bytes
/
wrap-page.ts
File metadata and controls
23 lines (20 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { CoreTypes } from '@nativescript/core';
import * as pageModule from '@nativescript/core/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 === CoreTypes.Orientation.vertical) {
layout.orientation = CoreTypes.Orientation.horizontal;
} else {
layout.orientation = CoreTypes.Orientation.vertical;
}
}
export function onItemWidthItemHeight(args: { eventName: string; object: any }) {
var layout = args.object.parent;
layout.itemWidth = 40;
layout.itemHeight = 60;
}