| 3 | const possibleValues = ['none', 'underline', 'line-through', 'underline line-through']; |
| 4 | |
| 5 | export function butonTap(args: EventData) { |
| 6 | let page = (<TextBase>args.object).page; |
| 7 | let lbl = <TextBase>page.getViewById('Label'); |
| 8 | let btn = <TextBase>page.getViewById('Button'); |
| 9 | let textField = <TextBase>page.getViewById('TextField'); |
| 10 | let textView = <TextBase>page.getViewById('TextView'); |
| 11 | |
| 12 | let currentIndex = possibleValues.indexOf(lbl.textDecoration); |
| 13 | let newIndex = (currentIndex + 1) % possibleValues.length; |
| 14 | let newValue = <any>possibleValues[newIndex]; |
| 15 | |
| 16 | lbl.textDecoration = newValue; |
| 17 | btn.textDecoration = newValue; |
| 18 | textField.textDecoration = newValue; |
| 19 | textView.textDecoration = newValue; |
| 20 | |
| 21 | if (lbl.text === 'Change text') { |
| 22 | lbl.text = btn.text = textField.text = textView.text = 'Text changed'; |
| 23 | } else { |
| 24 | lbl.text = btn.text = textField.text = textView.text = 'Change text'; |
| 25 | } |
| 26 | } |