Files
NativeScript/apps/ui/app/list-picker/issue_2895-page.ts
Nathan Walker 1e6fccf272 chore: cleanup
2020-07-23 14:03:37 -07:00

37 lines
899 B
TypeScript

import { Page, Observable, EventData } from '@nativescript/core';
export function navigatingTo(args: EventData) {
let page = <Page>args.object;
page.bindingContext = new ListPickerView();
}
export class ListPickerView extends Observable {
private _showListPicker: string = 'collapsed';
private _isVisisble: boolean;
constructor() {
super();
this._isVisisble = false;
}
get options(): Array<String> {
return ['options1', 'options2', 'options3', 'options1', 'options2', 'options3'];
}
get showListPicker(): string {
return this._showListPicker;
}
set showListPicker(value: string) {
if (this._showListPicker !== value) {
this._showListPicker = value;
this.notifyPropertyChange('showListPicker', value);
}
}
public onTap() {
this._isVisisble ? (this.showListPicker = 'collapsed') : (this.showListPicker = 'visible');
this._isVisisble = !this._isVisisble;
}
}