import { EventData , Page } from "@nativescript/core" ; import { ExtendedShowModalOptions } from "nativescript-windowed-modal/windowed-modal.common" ; let mainPage ; export function pageLoaded ( args ) { mainPage = args . object as Page ; } export function openModal1 ( ) { mainPage . showModal ( "./modal" , { context : { message : "I'm the context" , } , fullscreen : false , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , } ) ; } export function openModal2 ( ) { mainPage . showModal ( "./modal" , { context : { dim : "#00000000" , message : "I'm the context" , } , fullscreen : false , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , dimAmount : 0.05 , } as ExtendedShowModalOptions ) ; } export function openModal3 ( ) { mainPage . showModal ( "./modal" , { context : { dim : "#5C00FFDD" , message : "I'm the context" , } , fullscreen : false , dimAmount : 0.1 , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , } as ExtendedShowModalOptions ) ; } export function openModal4 ( ) { mainPage . showModal ( "./modal" , { context : { dim : "#FFFF0000" , message : "I'm the context" , } , fullscreen : false , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , } ) ; } export function openModal5 ( ) { mainPage . showModal ( "./modal" , { context : { dim : "#5C00FFDD" , message : "I'm the context" , } , fullscreen : true , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , } ) ; } export function openModal6 ( ) { mainPage . showModal ( "./modal" , { context : { message : "I'm the context" , } , fullscreen : true , closeCallback : ( response ) => { console . log ( "Modal response: " + response ) ; } , } ) ; }