import { CoreTypes } from '@nativescript/core' ; import * as pageModule from '@nativescript/core/ui/page' ; import * as model from './myview' ; export function onLoaded ( args ) { var page = < pageModule . Page > args . object ; page . bindingContext = new model . ViewModelWithPercentage ( ) ; } export function onOrientation ( args ) { 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 ) { var layout = args . object . parent ; layout . itemWidth = 100 ; layout . itemHeight = 100 ; }