mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 12:57:42 +08:00
23 lines
547 B
TypeScript
23 lines
547 B
TypeScript
import {Page} from "ui/page";
|
|
import {ListPicker} from "ui/list-picker";
|
|
|
|
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);
|
|
}
|