mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 03:31:45 +08:00
22 lines
511 B
TypeScript
22 lines
511 B
TypeScript
import {Page, 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);
|
|
}
|