gesture binding fixed + test

This commit is contained in:
Vladimir Enchev
2015-08-11 16:31:30 +03:00
parent f7d5d49bfe
commit 384ba394e7
4 changed files with 34 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
import observable = require("data/observable");
import gestures = require("ui/gestures");
import pages = require("ui/page");
export function pageLoaded(args: observable.EventData) {
var page = <pages.Page>args.object;
page.bindingContext = { tapAction: tapAction, doubleTapAction: doubleTapAction };
}
export function tapAction(args: gestures.GestureEventData) {
console.log("tapAction")
}
export function doubleTapAction(args: gestures.GestureEventData) {
console.log("doubleTapAction")
}

View File

@@ -0,0 +1,6 @@
<Page loaded="pageLoaded">
<StackLayout>
<Label text="Handlers as exports" tap="tapAction" doubleTap="doubleTapAction" />
<Label text="Bound handlers" tap="{{ tapAction }}" doubleTap="{{ doubleTapAction }}" />
</StackLayout>
</Page>