mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Replace knownEvents modules with static strings.
This commit is contained in:
@@ -13,13 +13,13 @@ export function createPage() {
|
||||
|
||||
var backButton = new buttonModule.Button();
|
||||
backButton.text = "< back";
|
||||
backButton.on(buttonModule.knownEvents.tap, () => { page.frame.goBack(); });
|
||||
backButton.on(buttonModule.Button.tapEvent, () => { page.frame.goBack(); });
|
||||
stackLayout.addChild(backButton);
|
||||
|
||||
var label = new labelModule.Label();
|
||||
stackLayout.addChild(label);
|
||||
|
||||
page.on(pagesModule.knownEvents.navigatedTo, () => {
|
||||
page.on(pagesModule.Page.navigatedToEvent, () => {
|
||||
var item = page.navigationContext;
|
||||
label.text = "I am detail for " + item;
|
||||
});
|
||||
@@ -30,7 +30,7 @@ export function createPage() {
|
||||
|
||||
var actionButton = new buttonModule.Button();
|
||||
actionButton.text = "Copy";
|
||||
actionButton.on(buttonModule.knownEvents.tap, () => {
|
||||
actionButton.on(buttonModule.Button.tapEvent, () => {
|
||||
label.text = textField.text;
|
||||
});
|
||||
stackLayout.addChild(actionButton);
|
||||
|
||||
@@ -14,7 +14,7 @@ export function createPage() {
|
||||
listView.height = 200;
|
||||
var itemsSource = [1, 2, 3];
|
||||
|
||||
listView.on(listViewModule.knownEvents.itemLoading, (args: listViewModule.ItemEventData) => {
|
||||
listView.on(listViewModule.ListView.itemLoadingEvent, (args: listViewModule.ItemEventData) => {
|
||||
var label = <labelModule.Label>args.view;
|
||||
if (!label) {
|
||||
label = new labelModule.Label();
|
||||
@@ -28,7 +28,7 @@ export function createPage() {
|
||||
}
|
||||
});
|
||||
|
||||
listView.on(listViewModule.knownEvents.itemTap, (args: listViewModule.ItemEventData) => {
|
||||
listView.on(listViewModule.ListView.itemTapEvent, (args: listViewModule.ItemEventData) => {
|
||||
var navigationEntry = {
|
||||
moduleName: "NavigationTest/details-page",
|
||||
context: itemsSource[args.index]
|
||||
@@ -49,7 +49,7 @@ export function createPage() {
|
||||
|
||||
var actionButton = new buttonModule.Button();
|
||||
actionButton.text = "Copy";
|
||||
actionButton.on(buttonModule.knownEvents.tap, () => {
|
||||
actionButton.on(buttonModule.Button.tapEvent, () => {
|
||||
label.text = textField.text;
|
||||
});
|
||||
stackLayout.addChild(actionButton);
|
||||
|
||||
@@ -14,14 +14,14 @@ export function createPage() {
|
||||
|
||||
var changeStateButton = new buttonModule.Button();
|
||||
changeStateButton.text = "CHANGE STATE";
|
||||
changeStateButton.on(buttonModule.knownEvents.tap, () => {
|
||||
changeStateButton.on(buttonModule.Button.tapEvent, () => {
|
||||
stateLabel.text = "CHANGED STATE";
|
||||
});
|
||||
stackLayout.addChild(changeStateButton);
|
||||
|
||||
var navigateButton = new buttonModule.Button();
|
||||
navigateButton.text = "->";
|
||||
navigateButton.on(buttonModule.knownEvents.tap, () => {
|
||||
navigateButton.on(buttonModule.Button.tapEvent, () => {
|
||||
page.frame.navigate("NavigationTest/page2");
|
||||
});
|
||||
stackLayout.addChild(navigateButton);
|
||||
|
||||
@@ -11,7 +11,7 @@ export function createPage() {
|
||||
|
||||
var backButton = new buttonModule.Button();
|
||||
backButton.text = "<-";
|
||||
backButton.on(buttonModule.knownEvents.tap, () => { page.frame.goBack(); });
|
||||
backButton.on(buttonModule.Button.tapEvent, () => { page.frame.goBack(); });
|
||||
stackLayout.addChild(backButton);
|
||||
|
||||
page.content = stackLayout;
|
||||
|
||||
Reference in New Issue
Block a user