Implement page property for ActionItem

This commit is contained in:
vakrilov
2015-12-22 15:32:47 +02:00
parent 16c5228137
commit 04155368dd
3 changed files with 20 additions and 0 deletions

View File

@@ -297,6 +297,10 @@ export class ActionItem extends bindable.Bindable implements dts.ActionItem {
}
}
get page(): pages.Page {
return this.actionBar ? this.actionBar.page : undefined;
}
public _raiseTap() {
this._emit(ActionItem.tapEvent);
}

View File

@@ -128,6 +128,11 @@ declare module "ui/action-bar" {
*/
actionBar: ActionBar;
/**
* Gets the page that contains the action item.
*/
page: pages.Page;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").