import { Frame } from "tns-core-modules/ui/frame" ; import * as drawerModule from "nativescript-ui-sidedrawer" ; import * as observableModule from "tns-core-modules/data/observable" ; export class DrawerTransitionsModel { public onFadeTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . FadeTransition ( ) ) ; this . openSideDrawer ( ) ; } public onPushTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . PushTransition ( ) ) ; this . openSideDrawer ( ) ; } public onRevealTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . RevealTransition ( ) ) ; this . openSideDrawer ( ) ; } public onReverseSlideOutTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . ReverseSlideOutTransition ( ) ) ; this . openSideDrawer ( ) ; } public onScaleDownPusherTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . ScaleDownPusherTransition ( ) ) ; this . openSideDrawer ( ) ; } public onScaleUpTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . ScaleUpTransition ( ) ) ; this . openSideDrawer ( ) ; } public onSlideAlongTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . SlideAlongTransition ( ) ) ; this . openSideDrawer ( ) ; } public onSlideInOnTopTransitionTap ( args ) { this . setDrawerTransition ( new drawerModule . SlideInOnTopTransition ( ) ) ; this . openSideDrawer ( ) ; } public openSideDrawer ( args ? ) { let drawer = < drawerModule . RadSideDrawer > Frame . topmost ( ) . getViewById ( "sideDrawer" ) ; drawer . showDrawer ( ) ; } public closeDrawer ( args ? ) { let drawer = < drawerModule . RadSideDrawer > Frame . topmost ( ) . getViewById ( "sideDrawer" ) ; drawer . closeDrawer ( ) ; } private setDrawerTransition ( transition ) { let drawer = < drawerModule . RadSideDrawer > Frame . topmost ( ) . getViewById ( "sideDrawer" ) ; drawer . drawerTransition = transition ; } }