text: var __extends = this.__extends || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      __.prototype = b.prototype;
      d.prototype = new __();
  };
  var common = require("ui/button/button-common");
  var stateChanged = require("ui/core/control-state-change");
  var TapHandlerImpl = (function (_super) {
      __extends(TapHandlerImpl, _super);
      function TapHandlerImpl() {
          _super.apply(this, arguments);
      }
      TapHandlerImpl.new = function () {
          return _super.new.call(this);
      };
      TapHandlerImpl.prototype.initWithOwner = function (owner) {
          this._owner = owner;
          return this;
      };
      TapHandlerImpl.prototype.tap = function (args) {
          this._owner._emit(common.knownEvents.tap);
      };
      TapHandlerImpl.ObjCExposedMethods = {
          "tap": { returns: interop.types.void, params: [interop.types.id] }
      };
      return TapHandlerImpl;
  })(NSObject);
  require("utils/module-merge").merge(common, exports);
  var Button = (function (_super) {
      __extends(Button, _super);
      function Button() {
          var _this = this;
          _super.call(this);
          this._ios = UIButton.buttonWithType(UIButtonType.UIButtonTypeSystem);
          this._tapHandler = TapHandlerImpl.new().initWithOwner(this);
          this._ios.addTargetActionForControlEvents(this._tapHandler, "tap", UIControlEvents.UIControlEventTouchUpInside);
          this._stateChangedHandler = new stateChanged.ControlStateChangeListener(this._ios, function (s) {
              _this._goToVisualState(s);
          });
      }
      Object.defineProperty(Button.prototype, "ios", {
          get: function () {
              return this._ios;
          },
          enumerable: true,
          configurable: true
      });
      return Button;
  })(common.Button);
  exports.Button = Button;
  