import { EventData, TextBase, TextDecoration } from "tns-core-modules/ui/text-base"; const possibleValues = [ "none", "underline", "line-through", "underline line-through" ]; export function butonTap(args: EventData) { let page = (args.object).page; let lbl = page.getViewById("Label"); let btn = page.getViewById("Button"); let textField = page.getViewById("TextField"); let textView = page.getViewById("TextView"); let currentIndex = possibleValues.indexOf(lbl.textDecoration); let newIndex = (currentIndex + 1) % possibleValues.length; let newValue = possibleValues[newIndex]; lbl.textDecoration = newValue; btn.textDecoration = newValue; textField.textDecoration = newValue; textView.textDecoration = newValue; if (lbl.text === "Change text") { lbl.text = btn.text = textField.text = textView.text = "Text changed"; } else { lbl.text = btn.text = textField.text = textView.text = "Change text"; } }