mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
21 lines
528 B
TypeScript
21 lines
528 B
TypeScript
import {Page, ShownModallyData, ListPicker} from "ui";
|
|
|
|
var closeCallback: Function;
|
|
var page: Page;
|
|
var listPicker: ListPicker;
|
|
|
|
export function onLoaded(args) {
|
|
page = <Page>args.object;
|
|
listPicker = page.getViewById<ListPicker>("listPicker");
|
|
}
|
|
|
|
export function onShownModally(args) {
|
|
closeCallback = args.closeCallback;
|
|
|
|
listPicker.items = args.context.items;
|
|
listPicker.selectedIndex = args.context.selectedIndex || 0;
|
|
}
|
|
|
|
export function onButtonTap() {
|
|
closeCallback(listPicker.selectedIndex);
|
|
} |