Switch for Android listener added

This commit is contained in:
Vladimir Enchev
2014-06-16 10:16:00 +03:00
parent 173d352a5d
commit ccc479215d

View File

@ -9,6 +9,14 @@ export class Switch extends view.View {
constructor() { constructor() {
super(); super();
this._android = new android.widget.Switch(application.android.currentContext); this._android = new android.widget.Switch(application.android.currentContext);
var that = this;
this._android.setOnCheckedChangeListener(new android.widget.CompoundButton.OnCheckedChangeListener({
onCheckedChanged: function (sender, isChecked) {
that.updateTwoWayBinding(Switch.checkedProperty, sender.isChecked());
that.setProperty(Switch.checkedProperty, sender.isChecked());
}
}));
} }
get android(): android.widget.Switch { get android(): android.widget.Switch {