@@ -9,6 +9,7 @@ import { Color } from "color";
99import { Label } from "ui/label" ;
1010import { Button } from "ui/button" ;
1111import { StackLayout } from "ui/layouts/stack-layout" ;
12+ import { Observable } from "data/observable" ;
1213
1314
1415declare var CGRectMake : any , CGPointMake : any ;
@@ -23,7 +24,7 @@ export class CheckBox extends Button implements CheckBoxInterface {
2324 private _hideBox : boolean ;
2425 private _boxType : number ;
2526 private _tint : string ;
26- private _checkBoxBackgroundColor :string ;
27+ private _checkBoxBackgroundColor : string ;
2728 private _onCheckColor : string ;
2829 private _animationDuration : number ;
2930 private _onAnimationType : number ;
@@ -51,7 +52,7 @@ export class CheckBox extends Button implements CheckBoxInterface {
5152 this . _setValue ( CheckBox . checkedProperty , value ) ;
5253 }
5354
54- set checkBoxBackgroundColor ( color :string ) {
55+ set checkBoxBackgroundColor ( color : string ) {
5556 ( < any > this . _iosCheckbox ) . backgroundColor = new Color ( color ) . ios ;
5657 this . _checkBoxBackgroundColor = color ;
5758 }
@@ -223,6 +224,14 @@ export class CheckBox extends Button implements CheckBoxInterface {
223224 public _onCheckedPropertyChanged ( data : PropertyChangeData ) {
224225 if ( this . _iosCheckbox ) {
225226 this . _iosCheckbox . setOnAnimated ( data . newValue , true ) ;
227+ let _old = data . oldValue ;
228+ let _new = data . newValue ;
229+ let obj = new Observable ( {
230+ view : this ,
231+ oldValue : _old ,
232+ newValue : _new
233+ } ) ;
234+ this . notify ( { eventName : "checkedChanged" , object : obj } ) ;
226235 }
227236 }
228237}
@@ -258,12 +267,6 @@ class BEMCheckBoxDelegateImpl extends NSObject implements BEMCheckBoxDelegate {
258267 public didTapCheckBox ( checkBox : BEMCheckBox ) : void {
259268 let owner = this . _owner . get ( ) ;
260269 if ( owner ) {
261- var eventData = {
262- eventName : "tap" ,
263- object : owner
264- } ;
265-
266- owner . notify ( eventData ) ;
267270 owner . _onPropertyChangedFromNative ( CheckBox . checkedProperty , checkBox . on ) ;
268271 }
269272 }
0 commit comments